瀏覽代碼

时间实体补充规则;公告分类关键词补充

znj 1 月之前
父節點
當前提交
cb2d3cdcbc

+ 2 - 0
BiddingKG/dl/channel/channel_bert.py

@@ -513,6 +513,7 @@ def merge_channel(list_articles,channel_dic,original_docchannel):
         front_text_len = len(text)//3 if len(text)>300 else 100
         front_text = text[:front_text_len]
         pred_channel = class_dict[pred_channel]
+        # print('pred_channel',pred_channel,'docchannel',docchannel,'original_docchannel',original_docchannel)
         if pred_channel == docchannel:
             channel_dic['docchannel']['use_original_docchannel'] = 0
         else:
@@ -583,6 +584,7 @@ def merge_channel(list_articles,channel_dic,original_docchannel):
 
     elif doctype=='采招数据' and docchannel=="":
         pred = channel_predict(title, text)
+        # print(text, '\n pred_res', pred)
         if pred is not None:
             pred = class_dict[pred]
             channel_dic['docchannel']['docchannel'] = pred

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

@@ -3941,7 +3941,7 @@ def get_preprocessed_entitys(list_sentences,useselffool=True,cost_time=dict()):
                            begin_index_temp, end_index_temp,in_attachment=in_attachment))
 
             # 时间实体格式补充
-            re_time_new = re.compile("20\d{2}-\d{1,2}-\d{1,2}|20\d{2}/\d{1,2}/\d{1,2}|20\d{2}\.\d{1,2}\.\d{1,2}|20\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[1-2][0-9]|3[0-1])")
+            re_time_new = re.compile("20\d{2}-\d{1,2}-\d{1,2}|20\d{2}-(:?0[1-9]|1[0-2]|[1-9])|20\d{2}/\d{1,2}/\d{1,2}|20\d{2}\.\d{1,2}\.\d{1,2}|20\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[1-2][0-9]|3[0-1])")
             entity_type = "time"
             for _time in re.finditer(re_time_new,sentence_text):
                 entity_text = _time.group()
@@ -3961,6 +3961,10 @@ def get_preprocessed_entitys(list_sentences,useselffool=True,cost_time=dict()):
                     if _time.end()!=len(sentence_text) and re.search("[\da-zA-z]",sentence_text[_time.end():_time.end()+1]):
                         continue
                     entity_text = entity_text[:4] + "-" + entity_text[4:6] + "-" + entity_text[6:8]
+                # 例:2025-05
+                if re.search("^20\d{2}-(:?0[1-9]|1[0-2]|[1-9])$",entity_text):
+                    if _time.end()!=len(sentence_text) and re.search("[\da-zA-z]",sentence_text[_time.end():_time.end()+1]):
+                        continue
                 if not timeFormat(entity_text):
                     continue
 

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

@@ -886,7 +886,9 @@ def getPackagesFromArticle(list_sentence, list_entity):
 # km配对方法
 def dispatch(match_list):
     main_roles = list(set([match.main_role for match in match_list]))
+    # print('main_roles',[i.entity_text for i in main_roles])
     attributes = list(set([match.attribute for match in match_list]))
+    # print('attributes',[i.entity_text for i in attributes])
 
     label = np.zeros(shape=(len(main_roles), len(attributes)))
     for match in match_list:
@@ -1699,7 +1701,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
         if entity.entity_type in ['company', 'org'] and entity.label!=5:
             match_nums = 0
             company_nums = 0  # 经过其他公司的数量
-            location_nums = 0  # 经过电话的数量
+            location_nums = 0  # 经过住址的数量
             for after_index in range(ent_idx + 1, min(len(company_lacation_EntityList), ent_idx + 5)):
                 after_entity = company_lacation_EntityList[after_index]
                 if after_entity.entity_type == "location":
@@ -1711,7 +1713,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
                     sentence_distance = after_entity.sentence_index - entity.sentence_index
                     value = (-1 / 2 * (distance ** 2)) / 10000
                     if sentence_distance == 0:
-                        if distance < 80:
+                        if distance < 60:
                             t_match_list.append(Match(entity, after_entity, value))
                             match_nums += 1
                             if company_nums:

+ 3 - 2
BiddingKG/dl/interface/predictor.py

@@ -3771,6 +3771,7 @@ class ProductAttributesPredictor():
             order_times = []
             for entity in list_entity:
                 if entity.entity_type=='time':
+                    # print('time',entity.entity_text)
                     sentence = list_sentence[entity.sentence_index]
                     s = spanWindow(tokens=sentence.tokens, begin_index=entity.begin_index,
                                    end_index=entity.end_index,size=20)
@@ -4174,7 +4175,7 @@ class DocChannel():
           '采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示',
           '采购意向neg': '发布政府采购意向|采购意向公告已于',
           '招标预告': '(预计|计划)(招标|采购|发标|发包)(时间|日期)|采购(计划编号|需求方案|预告|预案)|(预|需求)公示|需求(方案|信息|论证|公告|公示)',
-          '招标公告': '(采购|招标|竞选|报名)条件|报名(时间|流程|方法|要求|\w{,5}材料)[:\s]|[^\w]成交规则|参加竞价采购交易资格|(申请人|投标人|供应商|报价人|参选人)的?资格(要求|条件)|获取(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件的?(获取|领取)|评选方式:?\s*价格最低',
+          '招标公告': '(采购|招标|竞选|报名)条件|报名(时间|流程|方法|要求|\w{,5}材料)[:\s]|[^\w]成交规则|参加竞价采购交易资格|(申请人|投标人|供应商|报价人|参选人)的?资格(要求|条件)|获取(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件的?(获取|领取)|评选方式:?\s*价格最低|求购信息',
           '资审结果': '资审及业绩公示|资审结果及业绩|资格后审情况报告|资格(后审|预审|审查)结果(公告|公示)|(预审|审查)工作已经?结束|未通过原因', #|资格
           '招标答疑': '现澄清(为|如下)|答疑补遗|澄清内容如下|第[0-9一二三四五]次澄清|答疑澄清|(最高(投标)?限价|控制价|拦标价)公示',  # |异议的回复
           '公告变更': '第[\d一二]次变更|(更正|变更)(公告|公示|信息|内容|事项|原因|理由|日期|时间|如下)|原公告((主要)?(信息|内容)|发布时间)|(变更|更正)[前后]内容|现?在?(变更|更正|修改|更改)(内容)?为|(公告|如下|信息|内容|事项|结果|文件|发布|时间|日期)(更正|变更)',
@@ -4187,7 +4188,7 @@ class DocChannel():
           '中标信息neg': '按项目控制价下浮\d%即为成交价|成交原则|不得确定为(中标|成交)|招标人按下列原则选择中标人|评选成交供应商:|拟邀请供应商|除单一来源采购项目外|单一来源除外|(各.{,5}|尊敬的)(供应商|供货商)[:\s]|竞拍起止时间:|询价结果[\s\n::]*不公开|本项目已具备招标条件|现对该项目进行招标公告|发布\w{2}结果后\d天内送达|本次\w{2}结果不对外公示|供应商\s*资格要求|成交情况:\s*[流废]标|中标单位:本次招标拟?中标单位\d家|通知中标单位|影响(成交|中标)结果|确定为成交供应商|(成交|中标|中选)公[告示](发布|\w{,2})后|竞价成交后', # 503076535 按照服务方案的优劣 确定为成交供应商
       # |确定成交供应商[:,\s]
           '合同公告': '合同(公告|公示|信息|内容)|合同(编号|名称|主体|基本情况|完成(日期|时间))|(供应商乙方|乙方供应商):|合同总?金额|履约信息',
-          '废标公告': '(终止|中止|废标|流标|流采|失败|作废|异常|撤销)(结果)?(公告|公示|招标|采购|竞价)|(谈判结果为|结果类型):?废标|((本|该)(项目|标段|合同|合同包|采购包|次)\w{,5})((失败|终止|流标|废标)|予以废标|(按|做|作)?(流标|废标|废置)处理)|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答|项目)(终止|中止|废标|流标|失败|作废|异常|撤销)',
+          '废标公告': '(终止|中止|废标|流标|流采|失败|作废|异常|撤销)(结果)?(公告|公示|招标|采购|竞价)|(谈判结果为|结果类型|采购结果):?废标|((本|该)(项目|标段|合同|合同包|采购包|次)\w{,5})((失败|终止|流标|废标)|予以废标|(按|做|作)?(流标|废标|废置)处理)|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答|项目)(终止|中止|废标|流标|失败|作废|异常|撤销)',
           '废标公告2': '(无效|中止|终止|废标|流标|失败|作废|异常|撤销)的?(原因|理由)|本项目因故取消|本(项目|次)(公开)?\w{2}失败|已终止\s*原因:|(人|人数|供应商|单位)(不足|未达\w{,3}数量)|已终止|不足[3三]家|无(废标)|成交情况:\s*[流废]标|现予以废置|报名未够三家',
           '废标公告neg': '超过此报价将作为[废流]标处理|否则按[废流]标处理|终止规则:|成交规则:|视为流标|竞价失败的一切其他情形|是否废标:否|若不足三家公司参与|供应商数量:?\s*报名供应商不足三家|有效报价不足三家,\s*系统自动废标|如遇项目流[标采]' # 503076535 供应商数量: 报名供应商不足三家。
       }