Переглянути джерело

修复其他属性没有返回到最终结果的bug

lsm 3 роки тому
батько
коміт
06519b1198

+ 1 - 1
BiddingKG/dl/interface/extract.py

@@ -245,7 +245,7 @@ def predict(doc_id,text,title="",page_time="",web_source_no='',original_docchann
 
     # data_res = Preprocessing.union_result(Preprocessing.union_result(codeName, prem),list_punish_dic)[0]
     # data_res = Preprocessing.union_result(Preprocessing.union_result(Preprocessing.union_result(codeName, prem),list_punish_dic), list_channel_dic)[0]
-    data_res = dict(codeName[0], **prem[0], **channel_dic, **product_attrs[0], **product_attrs[1], **payment_way_dic, **fail_reason)
+    data_res = dict(codeName[0], **prem[0],**getAttributes.getOtherAttributes(list_entitys[0]), **channel_dic, **product_attrs[0], **product_attrs[1], **payment_way_dic, **fail_reason)
     data_res["doctitle_refine"] = doctitle_refine
     data_res["nlp_enterprise"] = nlp_enterprise
     # 要素的个数

+ 11 - 4
BiddingKG/dl/interface/getAttributes.py

@@ -2875,10 +2875,17 @@ def getPREMs(list_sentences,list_entitys,list_articles,list_outlines):
     result = []
     for list_sentence,list_entity,list_article,list_outline in zip(list_sentences,list_entitys,list_articles,list_outlines):
         RoleList = getPackageRoleMoney(list_sentence,list_entity,list_outline)
-        result.append(dict({"prem":RoleList,"docid":list_article.doc_id},**getOtherAttributes(list_entity),**getTimeAttributes(list_entity,list_sentence),
-                           **{"fingerprint":list_article.fingerprint,"match_enterprise":list_article.match_enterprise,
-                              "match_enterprise_type":list_article.match_enterprise_type,"process_time":getCurrent_date(),
-                              "attachmentTypes":list_article.attachmentTypes, "bidway": list_article.bidway}))
+        result.append(dict({"prem": RoleList, "docid": list_article.doc_id},
+                           **getTimeAttributes(list_entity, list_sentence),
+                           **{"fingerprint": list_article.fingerprint,
+                              "match_enterprise": list_article.match_enterprise,
+                              "match_enterprise_type": list_article.match_enterprise_type,
+                              "process_time": getCurrent_date(),
+                              "attachmentTypes": list_article.attachmentTypes, "bidway": list_article.bidway}))
+        # result.append(dict({"prem":RoleList,"docid":list_article.doc_id},**getOtherAttributes(list_entity),**getTimeAttributes(list_entity,list_sentence),
+        #                    **{"fingerprint":list_article.fingerprint,"match_enterprise":list_article.match_enterprise,
+        #                       "match_enterprise_type":list_article.match_enterprise_type,"process_time":getCurrent_date(),
+        #                       "attachmentTypes":list_article.attachmentTypes, "bidway": list_article.bidway}))
     return result