znj 3 жил өмнө
parent
commit
28cc633ad5

+ 1 - 1
.idea/misc.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.5 (py3.5)" project-jdk-type="Python SDK" />
   <component name="PythonCompatibilityInspectionAdvertiser">
     <option name="version" value="3" />
   </component>

+ 1 - 1
BiddingKG.iml

@@ -7,7 +7,7 @@
   </component>
   <component name="NewModuleRootManager">
     <content url="file://$MODULE_DIR$" />
-    <orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
+    <orderEntry type="jdk" jdkName="Python 3.5 (py3.5)" jdkType="Python SDK" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" exported="" name="Python 3.5 (dl_nlp) interpreter library" level="application" />
   </component>

+ 1 - 1
BiddingKG/dl/common/models.py

@@ -12,7 +12,7 @@ import keras.backend as K
 import tensorflow as tf
 import math
 import six
-layers.Dense
+
 
 def getTextCNNModel(input_shape,vocab,embedding_weights,classes):
 

+ 0 - 1
BiddingKG/dl/interface/Entitys.py

@@ -165,7 +165,6 @@ class Entity():
         # self.person_phone = person_phone
         self.person_phone = []
         self.is_tail = False
-        self.person_phone = person_phone
         self.notes = ''  # 2021/7/20 新增,保存金额大小写,单位等备注
         self.money_unit = '' #2021/8/17 新增,保存金额单位 元、万元 、亿元
 

+ 3 - 3
BiddingKG/dl/interface/modelFactory.py

@@ -260,7 +260,7 @@ class Model_relation_extraction():
 
     def predict(self,text_in, words, rate=0.5):
         # text_words = text_in
-        R = []
+        triple_list = []
         # _t2 = [self.words2id.get(c, 1) for c in words]
         _t2 = np.zeros((len(words), self.words_size))
         for i in range(len(words)):
@@ -292,8 +292,8 @@ class Model_relation_extraction():
                 for _ooo1, _c1 in zip(*_oo1):
                     _object = text_in[_ooo1]
                     _predicate = self.id2predicate[_c1]
-                    R.append((_subject[0], _predicate, _object))
-            return R
+                    triple_list.append((_subject[0], _predicate, _object))
+            return triple_list
         else:
             return []
 

+ 2 - 2
BiddingKG/dl/test/测试整个要素提取流程.py

@@ -429,8 +429,8 @@ if __name__=="__main__":
 # '''
     a = time.time()
     print("start")
-    # print(predict("12",content))
-    result = predict("12",text)
+    print(predict("12",content))
+    # result = predict("12",text)
     # result = predict("12",content)
     # print(json.loads(result))
     #test("12",text)