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

修复多中标人规则召回错误;特定实体少字问题

lsm 9 місяців тому
батько
коміт
88e9d655d7

+ 4 - 5
BiddingKG/dl/interface/Preprocessing.py

@@ -3511,11 +3511,10 @@ def get_preprocessed_entitys(list_sentences,useselffool=True,cost_time=dict()):
                     re.search('\d[楼层号]', entity_text)==None: # 2024/06/07 修改错误地址实体为角色
                     entity_type = 'org'
 
-                if entity_text.startswith('石山县'): # 2024/04/24 修复实体识别积石山县 识别少字问题
-                    entity_text = '积' + entity_text
-                    if 0<=begin_index_temp-1<len(sentence_text) and sentence_text[begin_index_temp-1] == '积':
-                        begin_index_temp -= 1
-                        ner_entity = (begin_index_temp, end_index_temp, entity_type, entity_text)
+                if begin_index_temp>0 and '县' in entity_text and re.match('前郭尔罗斯蒙古族自治县|积石山县', sentence_text[begin_index_temp-1:end_index_temp]): #20240905 修复实体识别少字问题
+                    entity_text = sentence_text[begin_index_temp-1] + entity_text
+                    begin_index_temp -= 1
+                    ner_entity = (begin_index_temp, end_index_temp, entity_type, entity_text)
                 elif entity_text == '中华人民共和国' and re.search('^\w{2,4}海关', sentence_text[end_index_temp: end_index_temp+6]):  # 2024/04/24 修复 采购单位:中华人民共和国汕尾海关, 识别不到海关
                     ser = re.search('^\w{2,4}海关', sentence_text[end_index_temp: end_index_temp+6])
                     entity_text += ser.group(0)

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

@@ -442,7 +442,7 @@ def predict(doc_id,text,title="",page_time="",web_source_no='',web_source_name="
 
     # 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]
-    version_date = {'version_date': '2024-09-03'}
+    version_date = {'version_date': '2024-09-05'}
     data_res = dict(codeName[0], **prem[0], **channel_dic, **product_attrs[0], **product_attrs[1], **payment_way_dic, **fail_reason, **industry, **district, **candidate_dic, **version_date, **all_moneys, **pb_json)
 
     if original_docchannel == 302:

+ 4 - 4
BiddingKG/dl/interface/predictor.py

@@ -868,7 +868,7 @@ class PREMPredict():
                 elif re.search('^,?(投标报价|(资格性审查:|符合性审查:)?(不通过|不符合))', behind) and re.search('中标|成交|中选|排名|排序|名次|第[一1]名', front)==None:
                     values[2] = 0.5
                     label = 5
-                elif re.search('(承包权人|帐户名称|债务人|推荐预审合格投标人名单):$|确定为标的的受让方,$|[主次出]入口?,?$|确定(项目|\w{,2})成交供应商,$', front):  # 234501112 民币元,序号:1,债务人: 东营市海宁工贸有限责任公司 ,债权本金: 262414286 八、中标后签约单位,合同签约单位:
+                elif re.search('(承包权人|帐户名称|债务人|推荐预审合格投标人名单):$|确定为标的的受让方,$|[主次出]入口?,?$|确定(项目|\w{,2})成交供应商,$|,承刻单位:$', front):  # 234501112 民币元,序号:1,债务人: 东营市海宁工贸有限责任公司 ,债权本金: 262414286 八、中标后签约单位,合同签约单位: 241929628 1月9,承刻单位: 肃宁县超凡网络光敏印章刻印部 ,印章预留印模
                     label = 5
                 elif re.search(',来源:$', front) and re.search('^,', behind): # 修复 472062585 项目采购-关于定制手机询比价采购中标公告,来源:深圳市网联安瑞网络科技有限公司 预测为中标
                     label = 0
@@ -1689,8 +1689,8 @@ class RoleRulePredictor():
                                 entity_text = p_entity.entity_text
                                 _label, _prob, _flag, kw = self.rule_predict(before, center, after, entity_text)
 
-                                if _label == 5 and re.search(':(1[.、])?$', before) and re.search('^[、;,&/。]', after) and re.search(
-                                        '(中标|成交|中选))?(人|单位|供应商|银行|候选人|合作伙伴)?(公示)?(信息|情况|结果|如下|:)|(遴选|寻源|采购|招标|竞价|议价|比选|委托|询比?价|比价|评选|谈判|邀标|邀请|洽谈|约谈|选取|抽取)结果', list_sentence[s_index].sentence_text[:p_entity.wordOffset_begin]): # 补充召回 例:514053647 标段1:中国建设银行西安南大街支行,标段2:中国农业银行股份有限公司西安分行,
+                                if _label == 5 and re.search(':(1[.、])?$', before) and re.search('^[、;,&/。]', after) and re.search('(监督|管理)(机构|部门|单位):', before)==None and re.search(
+                                        '(中标|成交|中选))?(人|单位|供应商|银行|合作伙伴)?(公示)?(信息|情况|结果|如下)(公[示告]如下)?:|(遴选|寻源|采购|招标|竞价|议价|比选|委托|询比?价|比价|评选|谈判|邀标|邀请|洽谈|约谈|选取|抽取)结果(如下)(公[示告]如下)?:', list_sentence[s_index].sentence_text[:p_entity.wordOffset_begin]): # 补充召回 例:514053647 标段1:中国建设银行西安南大街支行,标段2:中国农业银行股份有限公司西安分行,
                                     _flag = True
                                     _label = 2
                                     _prob = 0.5
@@ -1699,7 +1699,7 @@ class RoleRulePredictor():
                                         _flag = True
                                         _label = 2
                                         _prob = 0.55
-                                    elif re.search('(:|[::,]\d{1,2}[.、])$', before) and re.search('^[、;,&/。]', after) and re.search('(入围|合格)(人|单位|供应商|银行|候选人|合作伙伴)?(公示)?(信息|情况|结果|如下|:)', list_sentence[s_index].sentence_text[:p_entity.wordOffset_begin]):
+                                    elif re.search('(:|[::,]\d{1,2}[.、])$', before) and re.search('^[、;,&/。]', after) and re.search('(监督|管理)(机构|部门|单位):', before)==None and re.search('(入围|合格)(人|单位|供应商|银行|候选人|合作伙伴)?(信息|情况|结果|如下)(公[示告]如下)?(:|,?((入围)?排名不分先后))', list_sentence[s_index].sentence_text[:p_entity.wordOffset_begin]):
                                         _flag = True
                                         _label = 2
                                         _prob = 0.51