Explorar o código

公告分类规则优化;截止时间优化

znj hai 4 meses
pai
achega
441dc1f5f8

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

@@ -3638,7 +3638,7 @@ def getTimeAttributes(list_entity,list_sentence,page_time):
             #                     content_text += c["text"] + ""
             #                 print('concat_text', content_text)
 
-            if re.search(",(完成|截止|结束)(时间|日期)", entity_left2[-8:]) and entity.label==0:
+            if re.search("[;](完成|截止|结束)(时间|日期)", entity_left2[-8:]) and entity.label==0:
                 if entity.sentence_index == last_sentence_index:
                     time_type = last_time_index.get(last_time_type)
                     if time_type:
@@ -3704,7 +3704,7 @@ def getTimeAttributes(list_entity,list_sentence,page_time):
                         last_time_type = ''
                 elif entity.label==6 and label_prob>0.5:
                     if len(extract_time)==1:
-                        if re.search("前|止|截止",entity_right) or re.search("至|止|到",entity_left) or re.search("前",entity_text[-2:]):
+                        if (re.search("前|截?",entity_right) and re.search("前|截?(?!时间|日期)",entity_right2[:len(entity_right)+3])) or re.search("至|止|到",entity_left) or re.search("前",entity_text[-2:]):
                             dict_time['time_getFileEnd'].append((extract_time[0], label_prob,in_attachment))
                             last_time_type = 'time_getFileEnd'
                         else:

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

@@ -4143,7 +4143,7 @@ class DocChannel():
           '产权交易': '经营权|承包权|使用权|租赁权|股权|债权|排污权|化学需氧量|储备量|竞价销售|销售结果|出租|招租|拍租|竞租|续租|挂牌|出让|废[旧弃]?(物资|设备|资源|金属|钢筋|料)处[置理]',
           '产权交易2': '使用权|租赁权|股权|债权|排污权|竞价销售|销售结果|出租|招租|拍租|竞租|续租|挂牌|出让|废[旧弃]?(物资|设备|资源|金属|钢筋|料)处[置理]',
           # '采招数据': '(采购|招标|询价|议价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|征询|调研)的?(公告|公示|中标|成交|结果|$)|工程招标|定点服务|(设备|服务|\w{2})[直采]购|(建设|改造)项目|工程|拦标价|控制价|银行|资格选定|资金|公款|存款|存放|现金管理|招募|入围|入库',
-          '采招数据': '(采购|招标|询价|议价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|征询|调研)的?(公告|公示|中标|成交|结果|$)|工程招标|定点服务|(设备|服务|\w{2})[直采]购|(建设|改造)项目|拦标价|控制价|资格选定|资金|公款|存款|现金管理|招募|入库',
+          '采招数据': '(采购|招标|询价|议价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|征询|调研)的?(公告|公示|中标|成交|结果|$)|工程招标|定点服务|(设备|服务|\w{2})[直采]购|(建设|改造)项目|拦标价|控制价|资格选定|资格认定|资金|公款|存款|现金管理|招募|入库',
           # |竞价 采招/产权都有竞价方式 # 意向|需求|预公?告|报建|总承包|工程|施工|设计|勘察|代理|监理 |变更|答疑|澄清|中标|成交|合同|废标|流标
           '新闻资讯': '(考试|面试|笔试)成绩|成绩的?(公告|公示|公布)|公开招聘|招聘(公告|简章|启事|合同制)|疫情防控\s{,5}(通知|情况|提示)|行政审批结果'
       }
@@ -4481,13 +4481,13 @@ class DocChannel():
                   return '采招数据', re.search(self.title_type_dic['采招数据'], text.strip().split(' ')[0] + title).group(0)
               return '产权交易', (re.search(self.title_type_dic['产权交易'], title) or re.search(self.type_dic['产权交易'], text)).group(0)
 
-          elif re.search(self.title_type_dic['采招数据'], title) or re.search(self.type_dic['采招数据'], title + text):
+          elif re.search(self.title_type_dic['采招数据'], title) or re.search(self.type_dic['采招数据'], title + text) or re.search("银行|资格选定|资格认定|资金|公款|存款|存放|现金管理|招募|入围|入库", title +text.strip().split(' ')[0]):
               return '采招数据', (
-                          re.search(self.title_type_dic['采招数据'], title) or re.search(self.type_dic['采招数据'], title + text)).group(
+                          re.search(self.title_type_dic['采招数据'], title) or re.search(self.type_dic['采招数据'], title + text) or re.search("银行|资格选定|资格认定|资金|公款|存款|存放|现金管理|招募|入围|入库", title +text.strip().split(' ')[0])).group(
                   0)
           elif re.search(self.title_type_dic['新闻资讯'], title):
-              if re.search(self.title_type_dic['采招数据'], title +text.strip().split(' ')[0]) or re.search("银行|资格选定|资金|公款|存款|存放|现金管理|招募|入围|入库", title +text.strip().split(' ')[0]):
-                  return '采招数据', re.search(self.title_type_dic['采招数据'], title +text.strip().split(' ')[0]).group(0)
+              if re.search(self.title_type_dic['采招数据'], title +text.strip().split(' ')[0]) or re.search("银行|资格选定|资格认定|资金|公款|存款|存放|现金管理|招募|入围|入库", title +text.strip().split(' ')[0]):
+                  return '采招数据', (re.search(self.title_type_dic['采招数据'], title +text.strip().split(' ')[0]) or re.search("银行|资格选定|资格认定|资金|公款|存款|存放|现金管理|招募|入围|入库", title +text.strip().split(' ')[0])).group(0)
               return '新闻资讯', re.search(self.title_type_dic['新闻资讯'], title).group(0)
           else:
               return '', '没有公告类型关键词,返回空'