|
@@ -430,50 +430,50 @@ class CodeNamePredict():
|
|
code_set.add(it)
|
|
code_set.add(it)
|
|
# item['code'].append(it)
|
|
# item['code'].append(it)
|
|
if re.search("(项目编号|招标编号):?$", pre_text[h]):
|
|
if re.search("(项目编号|招标编号):?$", pre_text[h]):
|
|
- item['code'].append((it, 0))
|
|
|
|
|
|
+ item['code'].append((it, 0, sentence.sentence_index))
|
|
elif re.search('采购(计划)?编号:?$', pre_text[h]):
|
|
elif re.search('采购(计划)?编号:?$', pre_text[h]):
|
|
- item['code'].append((it, 1))
|
|
|
|
|
|
+ item['code'].append((it, 1, sentence.sentence_index))
|
|
elif re.search('(询价|合同)编号:?$', pre_text[h]):
|
|
elif re.search('(询价|合同)编号:?$', pre_text[h]):
|
|
- item['code'].append((it, 2))
|
|
|
|
|
|
+ item['code'].append((it, 2, sentence.sentence_index))
|
|
else:
|
|
else:
|
|
- item['code'].append((it, 3))
|
|
|
|
|
|
+ item['code'].append((it, 3, sentence.sentence_index))
|
|
elif len(item['code']) > 0:
|
|
elif len(item['code']) > 0:
|
|
new_it = item['code'][-1][0] + re.search(',|/|;|、|,', the_code).group(0) + it
|
|
new_it = item['code'][-1][0] + re.search(',|/|;|、|,', the_code).group(0) + it
|
|
if new_it not in code_set:
|
|
if new_it not in code_set:
|
|
code_set.add(new_it)
|
|
code_set.add(new_it)
|
|
# item['code'][-1] = new_it
|
|
# item['code'][-1] = new_it
|
|
if re.search("(项目编号|招标编号):?$", pre_text[h]):
|
|
if re.search("(项目编号|招标编号):?$", pre_text[h]):
|
|
- item['code'][-1] = (new_it, 0)
|
|
|
|
|
|
+ item['code'][-1] = (new_it, 0, sentence.sentence_index)
|
|
elif re.search('采购(计划)?编号:?$', pre_text[h]):
|
|
elif re.search('采购(计划)?编号:?$', pre_text[h]):
|
|
- item['code'][-1] = (new_it, 1)
|
|
|
|
|
|
+ item['code'][-1] = (new_it, 1, sentence.sentence_index)
|
|
elif re.search('(询价|合同)编号:?$', pre_text[h]):
|
|
elif re.search('(询价|合同)编号:?$', pre_text[h]):
|
|
- item['code'][-1] = (new_it, 2)
|
|
|
|
|
|
+ item['code'][-1] = (new_it, 2, sentence.sentence_index)
|
|
else:
|
|
else:
|
|
- item['code'][-1] = (new_it, 3)
|
|
|
|
|
|
+ item['code'][-1] = (new_it, 3, sentence.sentence_index)
|
|
else:
|
|
else:
|
|
if the_code not in code_set:
|
|
if the_code not in code_set:
|
|
code_set.add(the_code)
|
|
code_set.add(the_code)
|
|
# item['code'].append(the_code)
|
|
# item['code'].append(the_code)
|
|
if re.search("(项目编号|招标编号):?$", pre_text[h]):
|
|
if re.search("(项目编号|招标编号):?$", pre_text[h]):
|
|
- item['code'].append((the_code, 0))
|
|
|
|
|
|
+ item['code'].append((the_code, 0, sentence.sentence_index))
|
|
elif re.search('采购(计划)?编号:?$', pre_text[h]):
|
|
elif re.search('采购(计划)?编号:?$', pre_text[h]):
|
|
- item['code'].append((the_code, 1))
|
|
|
|
|
|
+ item['code'].append((the_code, 1, sentence.sentence_index))
|
|
elif re.search('(询价|合同)编号:?$', pre_text[h]):
|
|
elif re.search('(询价|合同)编号:?$', pre_text[h]):
|
|
- item['code'].append((the_code, 2))
|
|
|
|
|
|
+ item['code'].append((the_code, 2, sentence.sentence_index))
|
|
else:
|
|
else:
|
|
- item['code'].append((the_code, 3))
|
|
|
|
|
|
+ item['code'].append((the_code, 3, sentence.sentence_index))
|
|
break
|
|
break
|
|
elif the_code not in code_set:
|
|
elif the_code not in code_set:
|
|
code_set.add(the_code)
|
|
code_set.add(the_code)
|
|
# item['code'].append(the_code)
|
|
# item['code'].append(the_code)
|
|
if re.search("(项目编号|招标编号):?$", pre_text[h]):
|
|
if re.search("(项目编号|招标编号):?$", pre_text[h]):
|
|
- item['code'].append((the_code, 0))
|
|
|
|
|
|
+ item['code'].append((the_code, 0, sentence.sentence_index))
|
|
elif re.search('采购(计划)?编号:?$', pre_text[h]):
|
|
elif re.search('采购(计划)?编号:?$', pre_text[h]):
|
|
- item['code'].append((the_code, 1))
|
|
|
|
|
|
+ item['code'].append((the_code, 1, sentence.sentence_index))
|
|
elif re.search('(询价|合同)编号:?$', pre_text[h]):
|
|
elif re.search('(询价|合同)编号:?$', pre_text[h]):
|
|
- item['code'].append((the_code, 2))
|
|
|
|
|
|
+ item['code'].append((the_code, 2, sentence.sentence_index))
|
|
else:
|
|
else:
|
|
- item['code'].append((the_code, 3))
|
|
|
|
|
|
+ item['code'].append((the_code, 3, sentence.sentence_index))
|
|
|
|
|
|
# if the_code not in code_set:
|
|
# if the_code not in code_set:
|
|
# code_set.add(the_code)
|
|
# code_set.add(the_code)
|
|
@@ -573,18 +573,18 @@ class CodeNamePredict():
|
|
if othercode != None:
|
|
if othercode != None:
|
|
# item['code'].append(othercode.group('code'))
|
|
# item['code'].append(othercode.group('code'))
|
|
if re.search("(项目编号|招标编号):?$", othercode.group(0)):
|
|
if re.search("(项目编号|招标编号):?$", othercode.group(0)):
|
|
- item['code'].append((othercode.group('code'), 0))
|
|
|
|
|
|
+ item['code'].append((othercode.group('code'), 0, sentence.sentence_index))
|
|
elif re.search('采购(计划)?编号:?$', othercode.group(0)):
|
|
elif re.search('采购(计划)?编号:?$', othercode.group(0)):
|
|
- item['code'].append((othercode.group('code'), 1))
|
|
|
|
|
|
+ item['code'].append((othercode.group('code'), 1, sentence.sentence_index))
|
|
elif re.search('(询价|合同)编号:?$', othercode.group(0)):
|
|
elif re.search('(询价|合同)编号:?$', othercode.group(0)):
|
|
- item['code'].append((othercode.group('code'), 2))
|
|
|
|
|
|
+ item['code'].append((othercode.group('code'), 2, sentence.sentence_index))
|
|
else:
|
|
else:
|
|
- item['code'].append((othercode.group('code'), 3))
|
|
|
|
|
|
+ item['code'].append((othercode.group('code'), 3, sentence.sentence_index))
|
|
# print('规则召回项目编号:', othercode.group('code'))
|
|
# print('规则召回项目编号:', othercode.group('code'))
|
|
# item['code'] = [code for code in item['code'] if len(code)<500]
|
|
# item['code'] = [code for code in item['code'] if len(code)<500]
|
|
# item['code'].sort(key=lambda x:len(x),reverse=True)
|
|
# item['code'].sort(key=lambda x:len(x),reverse=True)
|
|
item['code'] = [code for code in item['code'] if len(code[0]) < 500]
|
|
item['code'] = [code for code in item['code'] if len(code[0]) < 500]
|
|
- item['code'].sort(key=lambda x: x[1])
|
|
|
|
|
|
+ item['code'].sort(key=lambda x: [x[1],x[2]])
|
|
item['code'] = [it[0] for it in item['code']]
|
|
item['code'] = [it[0] for it in item['code']]
|
|
result.append(item)
|
|
result.append(item)
|
|
|
|
|
|
@@ -703,7 +703,7 @@ class PREMPredict():
|
|
text_sen = sentence.sentence_text
|
|
text_sen = sentence.sentence_text
|
|
b = entity.wordOffset_begin
|
|
b = entity.wordOffset_begin
|
|
e = entity.wordOffset_end
|
|
e = entity.wordOffset_end
|
|
- text_list.append((text_sen[max(0, b-13):b], text_sen[b:e], text_sen[e:e+10]))
|
|
|
|
|
|
+ text_list.append((text_sen[max(0, b-13):b], text_sen[b:e], text_sen[e:e+15]))
|
|
# item_x = embedding(spanWindow(tokens=sentence.tokens,begin_index=entity.begin_index,end_index=entity.end_index,size=settings.MODEL_ROLE_INPUT_SHAPE[1]),shape=settings.MODEL_ROLE_INPUT_SHAPE)
|
|
# item_x = embedding(spanWindow(tokens=sentence.tokens,begin_index=entity.begin_index,end_index=entity.end_index,size=settings.MODEL_ROLE_INPUT_SHAPE[1]),shape=settings.MODEL_ROLE_INPUT_SHAPE)
|
|
# item_x = self.model_role.encode(tokens=sentence.tokens,begin_index=entity.begin_index,end_index=entity.end_index,entity_text=entity.entity_text)
|
|
# item_x = self.model_role.encode(tokens=sentence.tokens,begin_index=entity.begin_index,end_index=entity.end_index,entity_text=entity.entity_text)
|
|
item_x = self.model_role.encode_word(sentence_text=text_sen, begin_index=entity.wordOffset_begin, end_index=entity.wordOffset_end, size=30)
|
|
item_x = self.model_role.encode_word(sentence_text=text_sen, begin_index=entity.wordOffset_begin, end_index=entity.wordOffset_end, size=30)
|
|
@@ -805,6 +805,9 @@ class PREMPredict():
|
|
# print('模型预测角色:', front, entity.entity_text, behind,label, values)
|
|
# print('模型预测角色:', front, entity.entity_text, behind,label, values)
|
|
# if label in [0, 1, 2, 3, 4]:
|
|
# if label in [0, 1, 2, 3, 4]:
|
|
# self.role_file.write("{0}#split#{1}#split#{2}#split#{3}#split#{4}\n".format(front, entity.entity_text, behind,label, entity.doc_id))
|
|
# self.role_file.write("{0}#split#{1}#split#{2}#split#{3}#split#{4}\n".format(front, entity.entity_text, behind,label, entity.doc_id))
|
|
|
|
+ if re.search('^以\d+[\d,.]+万?元中标', behind) and label != 2: # 优化244261884预测错误 大连长之琳科技发展有限公司以7.63277万元中标
|
|
|
|
+ label = 2
|
|
|
|
+ values[label] = 0.8
|
|
if label in [0, 1, 2, 3, 4] and values[label] < 0.5: # 小于阈值的设为其他,让后面的规则召回重新判断
|
|
if label in [0, 1, 2, 3, 4] and values[label] < 0.5: # 小于阈值的设为其他,让后面的规则召回重新判断
|
|
# print(' # 小于阈值的设为其他,让后面的规则召回重新判断', values[label])
|
|
# print(' # 小于阈值的设为其他,让后面的规则召回重新判断', values[label])
|
|
label = 5
|
|
label = 5
|
|
@@ -835,7 +838,7 @@ class PREMPredict():
|
|
elif re.search('尊敬的供应商:$', front):
|
|
elif re.search('尊敬的供应商:$', front):
|
|
label = 0
|
|
label = 0
|
|
values[label] = 0.501
|
|
values[label] = 0.501
|
|
- elif re.search('第[4-9四五六]中标候选人', front): #修复第4以上的预测错为中标人
|
|
|
|
|
|
+ elif re.search('第[4-9四五六]中标候选人|(提交单位|竞投单位):$', front): #修复第4以上的预测错为中标人
|
|
label = 5
|
|
label = 5
|
|
values[label] = 0.5
|
|
values[label] = 0.5
|
|
elif re.search('(排名|排序|名次):([4-9]|\d{2,}),', front) or re.search('序号:\d+,(供应商|投标|候选)', front): # 293225236 附件中 排名预测错误
|
|
elif re.search('(排名|排序|名次):([4-9]|\d{2,}),', front) or re.search('序号:\d+,(供应商|投标|候选)', front): # 293225236 附件中 排名预测错误
|
|
@@ -846,7 +849,10 @@ class PREMPredict():
|
|
elif re.search('第一候补|第一后备|备选', front):
|
|
elif re.search('第一候补|第一后备|备选', front):
|
|
label = 3
|
|
label = 3
|
|
values[label] = 0.6
|
|
values[label] = 0.6
|
|
- elif re.search('放弃中标资格$|是否中标:否|^(中标|成交)(公示|公告)', behind):
|
|
|
|
|
|
+ elif re.search('^放弃中标资格|是否中标:否|^(中标|成交)(公示|公告)', behind):
|
|
|
|
+ values[2] = 0.5
|
|
|
|
+ label = 5
|
|
|
|
+ elif re.search('^,?(投标报价|(资格性审查:|符合性审查:)?(不通过|不符合))', behind) and re.search('中标|成交|中选|排名|排序|名次|第[一1]名', front)==None:
|
|
values[2] = 0.5
|
|
values[2] = 0.5
|
|
label = 5
|
|
label = 5
|
|
elif re.search('(承包权人|帐户名称|债务人|推荐预审合格投标人名单):$|确定为标的的受让方,$|[主次出]入口?,?$|确定(项目|\w{,2})成交供应商,$', front): # 234501112 民币元,序号:1,债务人: 东营市海宁工贸有限责任公司 ,债权本金: 262414286 八、中标后签约单位,合同签约单位:
|
|
elif re.search('(承包权人|帐户名称|债务人|推荐预审合格投标人名单):$|确定为标的的受让方,$|[主次出]入口?,?$|确定(项目|\w{,2})成交供应商,$', front): # 234501112 民币元,序号:1,债务人: 东营市海宁工贸有限责任公司 ,债权本金: 262414286 八、中标后签约单位,合同签约单位:
|
|
@@ -881,6 +887,9 @@ class PREMPredict():
|
|
label = 5
|
|
label = 5
|
|
elif re.search('委托$', front) and re.search('^(抽样|送检|看样)', behind):
|
|
elif re.search('委托$', front) and re.search('^(抽样|送检|看样)', behind):
|
|
label = 5
|
|
label = 5
|
|
|
|
+ elif re.search('推荐入围的招标代理单位:$', front): # 20240709 修复302505502预测错为代理
|
|
|
|
+ label = 2
|
|
|
|
+ values[label] = 0.501
|
|
elif label in [3,4]:
|
|
elif label in [3,4]:
|
|
if re.search('第[二三]分(公司|店),中标(人|供应商|单位|公司):$', front):
|
|
if re.search('第[二三]分(公司|店),中标(人|供应商|单位|公司):$', front):
|
|
label = 2
|
|
label = 2
|
|
@@ -891,7 +900,7 @@ class PREMPredict():
|
|
elif re.search('\d+\.\d+,供应商名称:', front): # 341385226 30.2,供应商名称: 预测为第二名
|
|
elif re.search('\d+\.\d+,供应商名称:', front): # 341385226 30.2,供应商名称: 预测为第二名
|
|
label = 2
|
|
label = 2
|
|
values[label] = 0.501
|
|
values[label] = 0.501
|
|
- elif re.search('\d+\.\d+[,、]?(中标|成交)候选人', front):
|
|
|
|
|
|
+ elif re.search('\d+\.\d+[,、]?(中标|成交)候选人|[;,][23]、(中标|中选|成交)候选人:', front):
|
|
label = 5
|
|
label = 5
|
|
values[label] = 0.501
|
|
values[label] = 0.501
|
|
elif re.search('第一名:$', front):
|
|
elif re.search('第一名:$', front):
|
|
@@ -952,16 +961,16 @@ class PREMPredict():
|
|
values[label] = 0.5
|
|
values[label] = 0.5
|
|
elif re.search('[\+=]((中标|成交)(金?额|价格?)|[若如]果?(中标|成交)(金?额|价格?)为?', front): # 处理例如 241561780 如中标金额为 500-1000万元,则代理服务费=100 万元×0.5%+400万元×0.35%+(中标金额-500)万元
|
|
elif re.search('[\+=]((中标|成交)(金?额|价格?)|[若如]果?(中标|成交)(金?额|价格?)为?', front): # 处理例如 241561780 如中标金额为 500-1000万元,则代理服务费=100 万元×0.5%+400万元×0.35%+(中标金额-500)万元
|
|
values[label] = 0.49
|
|
values[label] = 0.49
|
|
- elif re.search('^(以[上下])?按[\d.%]+收取|^以[上下]|^[()]?[+×*-][\d.%]+', behind):
|
|
|
|
|
|
+ elif re.search('^(以[上下])?按[\d.%]+收取|^及?以[上下]|^[()]?[+×*-][\d.%]+', behind):
|
|
values[label] = 0.49
|
|
values[label] = 0.49
|
|
- elif re.search('(含|在|包括|[大小等高低]于)$|[\d.%]+[+×*-]$', front):
|
|
|
|
|
|
+ elif re.search('(含|在|包括|[大小等高低]于|达到)$|[\d.%]+[+×*-]$', front):
|
|
values[label] = 0.49
|
|
values[label] = 0.49
|
|
elif entity.notes == '单价' and float(entity.entity_text)<5000:
|
|
elif entity.notes == '单价' and float(entity.entity_text)<5000:
|
|
label = 2
|
|
label = 2
|
|
elif label ==0: # 错误招标金额处理
|
|
elif label ==0: # 错误招标金额处理
|
|
- if entity.notes in ["投资", "总投资","工程造价"] or re.search('最低限价:?$', front) or re.search('服务内容:([\d,.]+万?亿?元?-?)$', front):
|
|
|
|
|
|
+ if entity.notes in ["投资", "总投资","工程造价"] or re.search('最低限价:?$|注册资本', front) or re.search('服务内容:([\d,.]+万?亿?元?-?)$', front):
|
|
values[label] = 0.49
|
|
values[label] = 0.49
|
|
- elif re.search('^(以[上下])?按[\d.%]+收取|^以[上下]|^[()]?[+×*-][\d.%]+|(含)', behind):
|
|
|
|
|
|
+ elif re.search('^(以[上下])?按[\d.%]+收取|^及?以[上下]|^[()]?[+×*-][\d.%]+|(含)', behind):
|
|
values[label] = 0.49
|
|
values[label] = 0.49
|
|
elif re.search('(含|在|包括|[大小等高低]于|如预算金额为)$|[\d.%]+((含))?[+×*-]$', front):
|
|
elif re.search('(含|在|包括|[大小等高低]于|如预算金额为)$|[\d.%]+((含))?[+×*-]$', front):
|
|
values[label] = 0.49
|
|
values[label] = 0.49
|
|
@@ -1396,27 +1405,27 @@ class RoleRulePredictor():
|
|
self.pattern_agency_left = "(?P<agency_left>((代理|拍卖)(?:人|机构|公司|企业|单位|组织)|专业采购机构|集中采购机构|招标组织机构|交易机构|集采机构|[招议))]+标机构|(采购|招标)代理)(名称|.{,4}名,?称|全称)?(是|为|:|:|[,,]?\s*)$|(受.{5,20}委托,?$))"
|
|
self.pattern_agency_left = "(?P<agency_left>((代理|拍卖)(?:人|机构|公司|企业|单位|组织)|专业采购机构|集中采购机构|招标组织机构|交易机构|集采机构|[招议))]+标机构|(采购|招标)代理)(名称|.{,4}名,?称|全称)?(是|为|:|:|[,,]?\s*)$|(受.{5,20}委托,?$))"
|
|
self.pattern_agency_right = "(?P<agency_right>^([((](以下简称)?[,\"“]*(代理)(人|单位|机构)[,\"”]*[))])|^受.{5,20}委托|^受委?托,)" # |^受托 会与 受托生产等冲突,代理表达一般会在后面有逗号
|
|
self.pattern_agency_right = "(?P<agency_right>^([((](以下简称)?[,\"“]*(代理)(人|单位|机构)[,\"”]*[))])|^受.{5,20}委托|^受委?托,)" # |^受托 会与 受托生产等冲突,代理表达一般会在后面有逗号
|
|
# 2020//11/24 大网站规则 中标关键词添加 选定单位|指定的中介服务机构
|
|
# 2020//11/24 大网站规则 中标关键词添加 选定单位|指定的中介服务机构
|
|
- self.pattern_winTenderer_left_50 = "(?P<winTenderer_left_50>" \
|
|
|
|
|
|
+ self.pattern_winTenderer_left_50 = "(?P<winTenderer_left_51>" \
|
|
"(乙|竞得|受让|买受|签约|施工|供货|供应?|合作|承做|承包|承建|承销|承保|承接|承制|承担|承修|承租((包))?|入围|入选|竞买)(候选|投标)?(人|单位|机构|供应商|方|公司|企业|厂商|商|社会资本方?)(:?单位名称|:?名称|盖章)?[::是为]+$" \
|
|
"(乙|竞得|受让|买受|签约|施工|供货|供应?|合作|承做|承包|承建|承销|承保|承接|承制|承担|承修|承租((包))?|入围|入选|竞买)(候选|投标)?(人|单位|机构|供应商|方|公司|企业|厂商|商|社会资本方?)(:?单位名称|:?名称|盖章)?[::是为]+$" \
|
|
"|(选定单位|指定的中介服务机构|实施主体|中标银行|中标通知书,致|征集结果|选择中介|选择结果|成交对象|勘察人|(,|审计|处置|勘察|设计)服务单位|受托[人方])[::是为]+$" \
|
|
"|(选定单位|指定的中介服务机构|实施主体|中标银行|中标通知书,致|征集结果|选择中介|选择结果|成交对象|勘察人|(,|审计|处置|勘察|设计)服务单位|受托[人方])[::是为]+$" \
|
|
"|((评审结果|名次|排名|中标结果)[::]*第?[一1]名?)[::是为]+$|成交供应商信息[,:]?(序号1)?:?|供应商名称$" \
|
|
"|((评审结果|名次|排名|中标结果)[::]*第?[一1]名?)[::是为]+$|成交供应商信息[,:]?(序号1)?:?|供应商名称$" \
|
|
- "|单一来源(采购)?(供应商|供货商|服务商|方式向)$|((中标|成交)(结果|信息))[::是为]+$" \
|
|
|
|
|
|
+ "|单一来源(采购)?(供应商|供货商|服务商|方式向)$|((中标|成交)(结果|信息))[::是为]+$|(中标|成交)供应商、(中标|成交)(金额|价格),$" \
|
|
"|现(公布|宣布|公示)中标单位如下:$|现将中标单位(公布|公示)如下:$|现宣布以下(企业|单位|公司)中标:$|经讨论,决定采用$)" # 承办单位:不作为中标 83914772
|
|
"|现(公布|宣布|公示)中标单位如下:$|现将中标单位(公布|公示)如下:$|现宣布以下(企业|单位|公司)中标:$|经讨论,决定采用$)" # 承办单位:不作为中标 83914772
|
|
self.pattern_winTenderer_left_60 = "(?P<winTenderer_left_60>" \
|
|
self.pattern_winTenderer_left_60 = "(?P<winTenderer_left_60>" \
|
|
"(,|。|:|^)((中标(投标)?|[拟预]中标|中选|中价|中签|成交)(人|单位|机构|中介(服务)?机构|供应商|客户|方|公司|企业|厂商|商家?|社会资本方?)|(中标候选人)?第?[一1]名|第[一1](中标|中选|成交)?候选人|服务机构)" \
|
|
"(,|。|:|^)((中标(投标)?|[拟预]中标|中选|中价|中签|成交)(人|单位|机构|中介(服务)?机构|供应商|客户|方|公司|企业|厂商|商家?|社会资本方?)|(中标候选人)?第?[一1]名|第[一1](中标|中选|成交)?候选人|服务机构)" \
|
|
- "(:?单位名称|:?名称|盖章)?[,,]?([((]按综合排名排序[))]|:择优选取)?[::,,]$)" # 解决表头识别不到加逗号情况,需前面为,。空
|
|
|
|
|
|
+ "(:?单位名称|:?名称|盖章)?[,,]?([((]按综合排名排序[))]|:择优选取)?[::,,]$|选取(情况|说明):中选,中介机构名称:$|排名如下:1、$)" # 解决表头识别不到加逗号情况,需前面为,。空 20240621补充 中选 云南省投资审批中介超市 补充排名如下 南阳师范学院
|
|
self.pattern_winTenderer_left_55 = "(?P<winTenderer_left_55>(中标(投标)?|[拟预]中标|中选|中价|中签|成交|入选)(人|单位|机构|中介(服务)?机构|供应商|客户|方|公司|企业|厂商|商家?|社会资本方?)" \
|
|
self.pattern_winTenderer_left_55 = "(?P<winTenderer_left_55>(中标(投标)?|[拟预]中标|中选|中价|中签|成交|入选)(人|单位|机构|中介(服务)?机构|供应商|客户|方|公司|企业|厂商|商家?|社会资本方?)" \
|
|
"(:?单位名称|:?名称|盖章)?([((]按综合排名排序[))]|:择优选取)?[::是为]+$" \
|
|
"(:?单位名称|:?名称|盖章)?([((]按综合排名排序[))]|:择优选取)?[::是为]+$" \
|
|
"|结果公示如下:摇出球号:\d+号,中介机构:$)" # 取消逗号 并拒绝执行改进计划的供应商,华新水泥将可能终止与其合作关系 # 中标候选人不能作为中标 # |直购企业:$不能作为中标人,看到有些公告会又多个公司,然后还会发布中选结果的公告,其中一个公司中标
|
|
"|结果公示如下:摇出球号:\d+号,中介机构:$)" # 取消逗号 并拒绝执行改进计划的供应商,华新水泥将可能终止与其合作关系 # 中标候选人不能作为中标 # |直购企业:$不能作为中标人,看到有些公告会又多个公司,然后还会发布中选结果的公告,其中一个公司中标
|
|
|
|
|
|
self.pattern_winTenderer_right = "(?P<winTenderer_right>(^[是为](首选)?((采购|中标|成交)(供应商|供货商|服务商)|(第[一1]|预)?(拟?(中标|中选|中价|成交)(候选|排序)?(人|单位|机构|供应商|公司|企业|厂商)))|" \
|
|
self.pattern_winTenderer_right = "(?P<winTenderer_right>(^[是为](首选)?((采购|中标|成交)(供应商|供货商|服务商)|(第[一1]|预)?(拟?(中标|中选|中价|成交)(候选|排序)?(人|单位|机构|供应商|公司|企业|厂商)))|" \
|
|
"^((报价|价格)最低,|以\w{5,10})?(确定|成|作)?为[\w“”()]{3,25}((成交|中选|中标|服务)(人|单位|供应商|企业|公司)|供货单位|供应商|第一中标候选人)[,。]" \
|
|
"^((报价|价格)最低,|以\w{5,10})?(确定|成|作)?为[\w“”()]{3,25}((成交|中选|中标|服务)(人|单位|供应商|企业|公司)|供货单位|供应商|第一中标候选人)[,。]" \
|
|
- "|^:贵公司参与|^:?你方于|^(胜出)?中标。|^取得中标(单位)?资格" \
|
|
|
|
|
|
+ "|^:贵公司参与|^:?你方于|^(胜出)?中标。|^取得中标(单位)?资格|^以\d+[\d,.]+万?元(中标|成交|中选)" \
|
|
"|^通过(挂牌|拍卖)方式(以[\d.,]+万?元)?竞得|^[((](中标|成交|承包)人名?称?[))]))" # 去掉 |\w{,20} 修复 460216955 网上公布的与本次采购项目有关的信息视为已送达各响应供应商。 作为中标
|
|
"|^通过(挂牌|拍卖)方式(以[\d.,]+万?元)?竞得|^[((](中标|成交|承包)人名?称?[))]))" # 去掉 |\w{,20} 修复 460216955 网上公布的与本次采购项目有关的信息视为已送达各响应供应商。 作为中标
|
|
self.pattern_winTenderer_whole = "(?P<winTenderer_center>(贵公司|由).{,15}以\w{,15}中标|确定[\w()]{5,20}为[^,。;]{5,50}的?中标单位" \
|
|
self.pattern_winTenderer_whole = "(?P<winTenderer_center>(贵公司|由).{,15}以\w{,15}中标|确定[\w()]{5,20}为[^,。;]{5,50}的?中标单位" \
|
|
"|选定报价最低的[“”\w()]{5,25}为[^,。;]{5,50}的?(服务|中标|成交)单位" \
|
|
"|选定报价最低的[“”\w()]{5,25}为[^,。;]{5,50}的?(服务|中标|成交)单位" \
|
|
- "|拟邀请[\w()]{5,20}(进行)?单一来源谈判|(承办单位|报价人|投标人|中介机构)(名称)?:[\w()]{5,20},(中标|承办|中选)价格" \
|
|
|
|
- "|(谈判结果:|结果|最终|确定|决定)[以由为][^,。;]{5,25}(向我单位)?(供货|承担|承接|中标|竞买成功)|中标通知书.{,15}你方|单一来源方?式?[从向][()\w]{5,20}采购)" # 2020//11/24 大网站规则 中标关键词添加 谈判结果:由.{5,20}供货
|
|
|
|
|
|
+ "|拟邀请[\w()]{5,20}(进行)?单一来源谈判|(承办单位|报价人|投标人|中介机构)(名称)?:[\w()]{5,20},(中标|承办|中选)(价格|金额)" \
|
|
|
|
+ "|(谈判结果:|结果|最终|确定|决定)[以由为][^,。;]{5,25}(向我单位)?(供货|承担|承接|中标|竞买成功)|中标通知书.{,15}你方|单一来源方?式?[从向][()\w]{5,20}采购|供应商名称:[()\w]{5,20},独家采购原因)" # 2020//11/24 大网站规则 中标关键词添加 谈判结果:由.{5,20}供货
|
|
|
|
|
|
self.pattern_secondTenderer_left = "(?P<secondTenderer_left>((第[二2]名?(名|((中标|中选|中价|成交|候选)(候选)?(人|单位|机构|供应商|公司))))(名称)?[::是为]+$)|((评审结果|名次|排名|排序)[::]第?[二2]名?,?(投标(供应)?商|供应商)(名称)?[::]+$))"
|
|
self.pattern_secondTenderer_left = "(?P<secondTenderer_left>((第[二2]名?(名|((中标|中选|中价|成交|候选)(候选)?(人|单位|机构|供应商|公司))))(名称)?[::是为]+$)|((评审结果|名次|排名|排序)[::]第?[二2]名?,?(投标(供应)?商|供应商)(名称)?[::]+$))"
|
|
self.pattern_secondTenderer_right = "(?P<secondTenderer_right>^[是为\(]第[二2](名|(中标|中选|中价|成交)(候选)?(人|单位|机构|供应商|公司)))"
|
|
self.pattern_secondTenderer_right = "(?P<secondTenderer_right>^[是为\(]第[二2](名|(中标|中选|中价|成交)(候选)?(人|单位|机构|供应商|公司)))"
|
|
@@ -1453,7 +1462,7 @@ class RoleRulePredictor():
|
|
|
|
|
|
self.SET_NOT_TENDERER = set(["人民政府","人民法院","中华人民共和国","人民检察院","评标委员会","中国政府","中国海关","中华人民共和国政府"])
|
|
self.SET_NOT_TENDERER = set(["人民政府","人民法院","中华人民共和国","人民检察院","评标委员会","中国政府","中国海关","中华人民共和国政府"])
|
|
|
|
|
|
- self.pattern_money_tenderee = re.compile("投?标?最高限价|采购计划金额|项目预算|招标金额|采购金额|项目金额|投资估算|采购(单位|人)委托价|招标限价|拦标价|预算金额|标底|总计|限额|资金来源,?为\w{2,4}资金|采购成本价") # |建安费用 不作为招标金额
|
|
|
|
|
|
+ self.pattern_money_tenderee = re.compile("投?标?最高限价|采购计划金额|项目预算|招标金额|采购金额|项目金额|投资估算|采购(单位|人)委托价|招标限价|拦标价|预算金额|标底|总计|限额|资金来源,?为\w{2,4}资金|采购成本价|总费用约?为") # |建安费用 不作为招标金额
|
|
self.pattern_money_tenderer = re.compile("((合同|成交|中标|应付款|交易|投标|验收|订单)[)\)]?(综合)?(总?金额|结果|[单报总]?价))|标的基本情况|承包价|报酬(含税):|经评审的价格") # 单写 总价 不能作为中标金额,很多表格有单价、总价
|
|
self.pattern_money_tenderer = re.compile("((合同|成交|中标|应付款|交易|投标|验收|订单)[)\)]?(综合)?(总?金额|结果|[单报总]?价))|标的基本情况|承包价|报酬(含税):|经评审的价格") # 单写 总价 不能作为中标金额,很多表格有单价、总价
|
|
self.pattern_money_tenderer_whole = re.compile("(以金额.*中标)|中标供应商.*单价|以.*元中标")
|
|
self.pattern_money_tenderer_whole = re.compile("(以金额.*中标)|中标供应商.*单价|以.*元中标")
|
|
self.pattern_money_other = re.compile("代理费|服务费")
|
|
self.pattern_money_other = re.compile("代理费|服务费")
|
|
@@ -1515,6 +1524,8 @@ class RoleRulePredictor():
|
|
_label = 5
|
|
_label = 5
|
|
elif _label == 2 and re.search('评委|未中标', after[:5]): # 397194341 过滤掉错误召回中标人
|
|
elif _label == 2 and re.search('评委|未中标', after[:5]): # 397194341 过滤掉错误召回中标人
|
|
_label = 5
|
|
_label = 5
|
|
|
|
+ elif _label == 2 and re.search('^,?(投标报价|(资格性审查:|符合性审查:)?(不通过|不符合))', after) and re.search('中标|成交|中选|排名|排序|名次|第[一1]名', before[-10:])==None: #20240705 处理类似 493939047 错误
|
|
|
|
+ _label = 5
|
|
if _label == 5:
|
|
if _label == 5:
|
|
_label, _prob, keyword = self.ser_role(self.pattern_whole, before + center + after, entity_text) # 前后文匹配
|
|
_label, _prob, keyword = self.ser_role(self.pattern_whole, before + center + after, entity_text) # 前后文匹配
|
|
keyword = 'whole_'+ keyword[:keyword.find(entity_text)] if keyword!="" else keyword
|
|
keyword = 'whole_'+ keyword[:keyword.find(entity_text)] if keyword!="" else keyword
|
|
@@ -1614,7 +1625,7 @@ class RoleRulePredictor():
|
|
if _span[2].startswith(":"): # 实体后面为冒号的不作为招标人,避免项目名称出错中标变招标 368122675 陇西兴恒建建筑有限责任公司:线路安全保护区内环境治理专项整改(第二标段)项目
|
|
if _span[2].startswith(":"): # 实体后面为冒号的不作为招标人,避免项目名称出错中标变招标 368122675 陇西兴恒建建筑有限责任公司:线路安全保护区内环境治理专项整改(第二标段)项目
|
|
break
|
|
break
|
|
if str(_span[0][-len(str(_name)):]+_span[1] + _span[2][:len(str(_name))]).find(
|
|
if str(_span[0][-len(str(_name)):]+_span[1] + _span[2][:len(str(_name))]).find(
|
|
- _name) >= 0:
|
|
|
|
|
|
+ _name) >= 0 or str(_name).startswith(p_entity.entity_text): # 20240621 补充公司开头的项目名称召回,避免name太长召回失败 例 367033697
|
|
# if p_entity.entity_text in agency_set or re.search('(代理|管理|咨询|招投?标|采购)\w{,6}公司', p_entity.entity_text): # 在代理人集合的作为代理人
|
|
# if p_entity.entity_text in agency_set or re.search('(代理|管理|咨询|招投?标|采购)\w{,6}公司', p_entity.entity_text): # 在代理人集合的作为代理人
|
|
if is_agency(p_entity.entity_text): # 2024/3/29 统一方法判断是否为代理
|
|
if is_agency(p_entity.entity_text): # 2024/3/29 统一方法判断是否为代理
|
|
find_flag = True
|
|
find_flag = True
|
|
@@ -1783,7 +1794,7 @@ class RoleRulePredictor():
|
|
p_entity.label = 0
|
|
p_entity.label = 0
|
|
# print('规则召回预算金额2:', p_entity.entity_text, _sentence.sentence_text[:p_entity.wordOffset_begin])
|
|
# print('规则召回预算金额2:', p_entity.entity_text, _sentence.sentence_text[:p_entity.wordOffset_begin])
|
|
if notfound_tenderer and len(set([ent.entity_text for ent in candidates])) == 1 and re.search(
|
|
if notfound_tenderer and len(set([ent.entity_text for ent in candidates])) == 1 and re.search(
|
|
- '(中标|中选|中价|中租|成交|入选|确认)(候选人|人|供应商|记录|结果|变更)?(公告|公示|结果)|(遴选|采购|招标|竞价|议价|比选|询比?价|评选|谈判|邀标|邀请|洽谈|约谈|评标|发包|磋商|交易)\w{,2}结果|单一来源(采购|招标)?的?(中标|成交|结果)|中标通知书',
|
|
|
|
|
|
+ '(中标|中选|中价|中租|成交|入选|确认)(候选人|人|供应商|记录|结果|变更)?(公告|公示|结果)|(遴选|采购|招标|竞价|议价|比选|询比?价|评选|谈判|邀标|邀请|洽谈|约谈|评标|发包|磋商|交易|评审)\w{,2}结果|单一来源(采购|招标)?的?(中标|成交|结果)|中标通知书',
|
|
article.title+article.content[:100]):
|
|
article.title+article.content[:100]):
|
|
for p_entity in candidates:
|
|
for p_entity in candidates:
|
|
# print('只有一个候选人的作为中标人', p_entity.entity_text)
|
|
# print('只有一个候选人的作为中标人', p_entity.entity_text)
|
|
@@ -2229,10 +2240,11 @@ class RoleGrade():
|
|
self.winTenderer_left_9 = "(?P<winTenderer_left_9>(中标|中选|中价|成交|竞得)|第[1一]名|排[名序]:1|名次:1)"
|
|
self.winTenderer_left_9 = "(?P<winTenderer_left_9>(中标|中选|中价|成交|竞得)|第[1一]名|排[名序]:1|名次:1)"
|
|
self.winTenderer_left_8 = "(?P<winTenderer_left_8>(入选供应商|供货商|乙方|最[终后]选[择取]))" # 229435497 最后选择西平,县中原彩印有限公司,作为此项目中标供应商,
|
|
self.winTenderer_left_8 = "(?P<winTenderer_left_8>(入选供应商|供货商|乙方|最[终后]选[择取]))" # 229435497 最后选择西平,县中原彩印有限公司,作为此项目中标供应商,
|
|
self.winTenderer_left_6 = "(?P<winTenderer_left_6>(入围|承[接建包修做制担租销]))"
|
|
self.winTenderer_left_6 = "(?P<winTenderer_left_6>(入围|承[接建包修做制担租销]))"
|
|
|
|
+ self.winTenderer_right_9 = "(?P<winTenderer_right_9>^(为(中标|成交|中选)(人|单位|供应商|公司)|以\d+[\d.,]+万?元中标))"
|
|
self.secondTenderer_left_9 = "(?P<secondTenderer_left_9>(第[二2](中标|中选|中价|成交)?候选(人|单位|供应商|公司)|第[二2]名|排[名序]:2|名次:2))"
|
|
self.secondTenderer_left_9 = "(?P<secondTenderer_left_9>(第[二2](中标|中选|中价|成交)?候选(人|单位|供应商|公司)|第[二2]名|排[名序]:2|名次:2))"
|
|
self.thirdTenderer_left_9 = "(?P<thirdTenderer_left_9>(第[三3](中标|中选|中价|成交)?候选(人|单位|供应商|公司)|第[三3]名|排[名序]:3|名次:3))"
|
|
self.thirdTenderer_left_9 = "(?P<thirdTenderer_left_9>(第[三3](中标|中选|中价|成交)?候选(人|单位|供应商|公司)|第[三3]名|排[名序]:3|名次:3))"
|
|
self.pattern_list = [self.tenderee_left_9,self.tenderee_center_8, self.tenderee_left_8,self.tenderee_left_6,self.tenderee_left_5,self.agency_left_9,
|
|
self.pattern_list = [self.tenderee_left_9,self.tenderee_center_8, self.tenderee_left_8,self.tenderee_left_6,self.tenderee_left_5,self.agency_left_9,
|
|
- self.winTenderer_left_6, self.winTenderer_left_9,self.winTenderer_left_8, self.secondTenderer_left_9, self.thirdTenderer_left_9]
|
|
|
|
|
|
+ self.winTenderer_left_6, self.winTenderer_left_9,self.winTenderer_left_8, self.winTenderer_right_9, self.secondTenderer_left_9, self.thirdTenderer_left_9]
|
|
def predict(self, list_sentences, list_entitys, original_docchannel, span=15, min_prob=0.7):
|
|
def predict(self, list_sentences, list_entitys, original_docchannel, span=15, min_prob=0.7):
|
|
'''
|
|
'''
|
|
根据规则给角色分配不同等级概率;分三级:0.9-1,0.8-0.9,0.7-0.8;附件0.7-0.8,0.6-0.7,0.5-0.6
|
|
根据规则给角色分配不同等级概率;分三级:0.9-1,0.8-0.9,0.7-0.8;附件0.7-0.8,0.6-0.7,0.5-0.6
|
|
@@ -2328,7 +2340,7 @@ class RoleGrade():
|
|
low_prob_tenderee.append(entity)
|
|
low_prob_tenderee.append(entity)
|
|
elif entity.entity_type in ['org', 'company'] and entity.label == 2 and 0.5<=entity.values[entity.label]<0.6:
|
|
elif entity.entity_type in ['org', 'company'] and entity.label == 2 and 0.5<=entity.values[entity.label]<0.6:
|
|
low_prob_winner.append(entity)
|
|
low_prob_winner.append(entity)
|
|
- if entity.entity_type in ['org', 'company'] and entity.label in [1, 0] and 0.5<entity.values[entity.label]:
|
|
|
|
|
|
+ if entity.entity_type in ['org', 'company'] and entity.label in [1, 0] and 0.6<entity.values[entity.label]: # 由0.5调为0.6,避免367217504 同时为低概率招标、中标被改
|
|
all_tenderee_agency.append(entity.entity_text)
|
|
all_tenderee_agency.append(entity.entity_text)
|
|
|
|
|
|
|
|
|
|
@@ -3918,7 +3930,7 @@ class DocChannel():
|
|
self.type_dic = {
|
|
self.type_dic = {
|
|
'土地矿产': '供地结果|(土地|用地|宗地|地块|海域|矿)的?(基本信息|基本情况|概况|信息|详情|来源|用途|性质|编号|位置|坐落|使用年限|出让年限)|(土地|山地|农田)(经营权)?(出让|出租|招租|租赁|承包|流转)|流转土地',
|
|
'土地矿产': '供地结果|(土地|用地|宗地|地块|海域|矿)的?(基本信息|基本情况|概况|信息|详情|来源|用途|性质|编号|位置|坐落|使用年限|出让年限)|(土地|山地|农田)(经营权)?(出让|出租|招租|租赁|承包|流转)|流转土地',
|
|
'拍卖出让': '(拍卖|变卖|流拍|竞拍)的?(公告|活动|信息|结果|成交|主体|标的|资产|财产|方式|类型|流程|程序|规则|价格|保证金|时间)|(公开|进行|密封)(拍卖|变卖|竞拍)|第[一二三]次拍卖|(资产|司法|网络)拍卖|交易方式.{,2}拍卖|拍卖会',
|
|
'拍卖出让': '(拍卖|变卖|流拍|竞拍)的?(公告|活动|信息|结果|成交|主体|标的|资产|财产|方式|类型|流程|程序|规则|价格|保证金|时间)|(公开|进行|密封)(拍卖|变卖|竞拍)|第[一二三]次拍卖|(资产|司法|网络)拍卖|交易方式.{,2}拍卖|拍卖会',
|
|
- '产权交易': '(产权|资产|权证)的?(类型|信息|名称|编号|(基本)?情况)|(经营权|承包权|使用权|租赁权|股权|债权|排污权|化学需氧量|储备量)(挂牌|转让|出让)|竞价销售|销售结果|房屋所有权房产|免租期限|交易期限|(受让|转让|承租|出租)(人|方)|(店面|店铺|商铺|铺位?|门面|门市|食堂|饭堂|校舍|车位|停车场|厂?房|仓?库|馆|资产|物业|房产|房屋|场地|农田|鱼?塘)\w{,4}(处置|招租|出租|续租|租赁|转让)|(出租|转让|产权|资产)(项目|中标|成交|流标|废标)|出租(用途|类型)|转让底价|租赁(标的物|情况)|看样(时间|地[点址]|方式)|最小加价|加价幅度',
|
|
|
|
|
|
+ '产权交易': '(产权|资产|权证)的?(类型|类别|用途|性质|状态|信息|名称|编号|(基本)?情况)|(经营权|承包权|使用权|租赁权|股权|债权|排污权|化学需氧量|储备量)(挂牌|转让|出让)|竞价销售|销售结果|房屋所有权房产|免租期限|交易期限|(受让|转让|承租|出租)(人|方)|(店面|店铺|商铺|铺位?|门面|门市|食堂|饭堂|校舍|车位|停车场|厂?房|仓?库|馆|资产|物业|房产|房屋|场地|农田|鱼?塘)\w{,4}(处置|招租|出租|续租|租赁|转让)|(出租|转让|产权|资产)(项目|中标|成交|流标|废标)|出租(用途|类型)|转让底价|租赁(标的物|情况)|看[样货](时间|地[点址]|方式|仓库|验货)|最小加价|加价[幅梯]度|交易模式[::\s]*延时竞价销售|挂牌(开始|结束)时间',
|
|
'采招数据': '(采购|招标)(条件|范围|文件|内容)|(申请人|投标人|供应商|报价人|参选人)的?资格要求;|采购需求清单|最低价排序|竞争性采购方式|采购进行公开竞价|竞价模式[::\s]*一次报价|预算金额' # |变更|答疑|澄清|中标|成交|合同|废标|流标 |(采购|招标|代理)(人|机构|单位)|
|
|
'采招数据': '(采购|招标)(条件|范围|文件|内容)|(申请人|投标人|供应商|报价人|参选人)的?资格要求;|采购需求清单|最低价排序|竞争性采购方式|采购进行公开竞价|竞价模式[::\s]*一次报价|预算金额' # |变更|答疑|澄清|中标|成交|合同|废标|流标 |(采购|招标|代理)(人|机构|单位)|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3926,7 +3938,7 @@ class DocChannel():
|
|
'土地矿产': '(土地|用地|宗地|荒地|山地|海域|矿)(出让|出租|招租|租赁|承包|流转|使用权|经营权|征收|划拨|中标|成交)|供地结果|矿业权|探矿权|采矿权|(土地|用地|宗地|地块)(使用权)?(终止|中止|网上)?(挂牌|出让|拍卖|招拍|划拨)|征收土地',
|
|
'土地矿产': '(土地|用地|宗地|荒地|山地|海域|矿)(出让|出租|招租|租赁|承包|流转|使用权|经营权|征收|划拨|中标|成交)|供地结果|矿业权|探矿权|采矿权|(土地|用地|宗地|地块)(使用权)?(终止|中止|网上)?(挂牌|出让|拍卖|招拍|划拨)|征收土地',
|
|
'拍卖出让': '(拍卖|变卖|流拍|竞拍)的?(公告|公示)|拍卖|变卖|流拍|竞拍',
|
|
'拍卖出让': '(拍卖|变卖|流拍|竞拍)的?(公告|公示)|拍卖|变卖|流拍|竞拍',
|
|
'产权交易': '经营权|承包权|使用权|租赁权|股权|债权|排污权|化学需氧量|储备量|竞价销售|销售结果|出租|招租|拍租|竞租|续租|挂牌|出让',
|
|
'产权交易': '经营权|承包权|使用权|租赁权|股权|债权|排污权|化学需氧量|储备量|竞价销售|销售结果|出租|招租|拍租|竞租|续租|挂牌|出让',
|
|
- '采招数据': '(采购|招标|询价|议价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判)的?(公告|公示|中标|成交|结果|$)|工程招标|定点服务',
|
|
|
|
|
|
+ '采招数据': '(采购|招标|询价|议价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|征询|调研)的?(公告|公示|中标|成交|结果|$)|工程招标|定点服务|竞价采购|(设备|服务)采购|网上超市采购|定点采购',
|
|
# |竞价 采招/产权都有竞价方式 # 意向|需求|预公?告|报建|总承包|工程|施工|设计|勘察|代理|监理 |变更|答疑|澄清|中标|成交|合同|废标|流标
|
|
# |竞价 采招/产权都有竞价方式 # 意向|需求|预公?告|报建|总承包|工程|施工|设计|勘察|代理|监理 |变更|答疑|澄清|中标|成交|合同|废标|流标
|
|
'新闻资讯': '(考试|面试|笔试)成绩|成绩的?(公告|公示|公布)|公开招聘|招聘(公告|简章|启事|合同制)|疫情防控\s{,5}(通知|情况|提示)|行政审批结果'
|
|
'新闻资讯': '(考试|面试|笔试)成绩|成绩的?(公告|公示|公布)|公开招聘|招聘(公告|简章|启事|合同制)|疫情防控\s{,5}(通知|情况|提示)|行政审批结果'
|
|
}
|
|
}
|
|
@@ -3934,22 +3946,22 @@ class DocChannel():
|
|
'采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示',
|
|
'采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示',
|
|
'采购意向neg': '发布政府采购意向|采购意向公告已于',
|
|
'采购意向neg': '发布政府采购意向|采购意向公告已于',
|
|
'招标预告': '(预计|计划)(采购|招标)(时间|日期)|采购(计划编号|需求方案|预告|预案)|(预|需求)公示|需求(方案|信息|论证|公告|公示)',
|
|
'招标预告': '(预计|计划)(采购|招标)(时间|日期)|采购(计划编号|需求方案|预告|预案)|(预|需求)公示|需求(方案|信息|论证|公告|公示)',
|
|
- '招标公告': '(采购|招标|竞选|报名)条件|报名(时间|流程|方法|要求|\w{,5}材料)[:\s]|[^\w]成交规则|参加竞价采购交易资格|(申请人|投标人|供应商|报价人|参选人)的?资格要求|获取(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件的?(获取|领取)',
|
|
|
|
|
|
+ '招标公告': '(采购|招标|竞选|报名)条件|报名(时间|流程|方法|要求|\w{,5}材料)[:\s]|[^\w]成交规则|参加竞价采购交易资格|(申请人|投标人|供应商|报价人|参选人)的?资格要求|获取(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件的?(获取|领取)|评选方式:?\s*价格最低',
|
|
'资审结果': '资审及业绩公示|资审结果及业绩|资格后审情况报告|资格(后审|预审|审查)结果(公告|公示)|(预审|审查)工作已经?结束|未通过原因', #|资格
|
|
'资审结果': '资审及业绩公示|资审结果及业绩|资格后审情况报告|资格(后审|预审|审查)结果(公告|公示)|(预审|审查)工作已经?结束|未通过原因', #|资格
|
|
'招标答疑': '现澄清(为|如下)|答疑补遗|澄清内容如下|第[0-9一二三四五]次澄清|答疑澄清|(最高(投标)?限价|控制价|拦标价)公示', # |异议的回复
|
|
'招标答疑': '现澄清(为|如下)|答疑补遗|澄清内容如下|第[0-9一二三四五]次澄清|答疑澄清|(最高(投标)?限价|控制价|拦标价)公示', # |异议的回复
|
|
'公告变更': '第[\d一二]次变更|(更正|变更)(公告|公示|信息|内容|事项|原因|理由|日期|时间|如下)|原公告((主要)?(信息|内容)|发布时间)|(变更|更正)[前后]内容|现?在?(变更|更正|修改|更改)(内容)?为|(公告|如下|信息|内容|事项|结果|文件|发布|时间|日期)(更正|变更)',
|
|
'公告变更': '第[\d一二]次变更|(更正|变更)(公告|公示|信息|内容|事项|原因|理由|日期|时间|如下)|原公告((主要)?(信息|内容)|发布时间)|(变更|更正)[前后]内容|现?在?(变更|更正|修改|更改)(内容)?为|(公告|如下|信息|内容|事项|结果|文件|发布|时间|日期)(更正|变更)',
|
|
'公告变更neg': '履约变更内容',
|
|
'公告变更neg': '履约变更内容',
|
|
'候选人公示': '候选人公示|评标结果公示|中标候选人名单公示|现将中标候选人(进行公示|公[示布]如下)|(中标|中选)候选人(信息|情况)[::\s]',
|
|
'候选人公示': '候选人公示|评标结果公示|中标候选人名单公示|现将中标候选人(进行公示|公[示布]如下)|(中标|中选)候选人(信息|情况)[::\s]',
|
|
'候选人公示neg': '中标候选人公示期|中标候选人公示前',
|
|
'候选人公示neg': '中标候选人公示期|中标候选人公示前',
|
|
- '中标信息': '供地结果信息|采用单源直接采购的?情况说明|[特现]?将\w{,4}(成交|中标|中选|选定结果|选取结果|入围结果|竞价结果)\w{,4}(进行公示|公[示布]如下)|(询价|竞价|遴选)(成交|中标|中选)(公告|公示)|(成交|中标|中选|选定|选取|入围|询价)结果(如下|公告|公示)|(中标|中选)(供应商|承包商|候选人|入围单位)如下|拟定供应商的情况|((中标|中选)(人|成交)|成交)\w{,3}(信息|情况)[::\s]',
|
|
|
|
- '中标信息2': '\s(成交|中标|中选)(信息|日期|时间|总?金额|价格)[::\s]|(采购|招标|成交|中标|中选|评标)结果|单一来源(采购|招标)?的?(中标|成交|结果)|项目已结束|中标公示 ', # |单一来源采购原因|拟采取单一来源方式采购|单一来源采购公示
|
|
|
|
|
|
+ '中标信息': '供地结果信息|采用单源直接采购的?情况说明|[特现]?将\w{,4}(成交|中标|中选|选定结果|选取结果|入围结果|竞价结果)\w{,4}(进行公示|公[示布]如下)|(询价|竞价|遴选)?(成交|中标|中选)(公告|公示)|(成交|中标|中选|选定|选取|入围|询价)结果(如下|公告|公示)|(中标|中选)(供应商|承包商|候选人|入围单位)如下|拟定供应商的情况|((中标|中选)(人|成交)|成交)\w{,3}(信息|情况)[::\s]',
|
|
|
|
+ '中标信息2': '\s(成交|中标|中选)(信息|日期|时间|总?金额|价格)[::\s]|(成交|中标|中选)价格\s*[\d.,]+(?万?元|(采购|招标|成交|中标|中选|评标)结果|单一来源(采购|招标)?的?(中标|成交|结果)|项目已结束|中标公示 ', # |单一来源采购原因|拟采取单一来源方式采购|单一来源采购公示
|
|
'中标信息3': '(中标|中选|成交|拟定|拟选用|最终选定的?|受让)(供应商|供货商|服务商|机构|企业|公司|单位|候选人|人)(信息[,:]?)?(名称)?[::\s]|[、\s](第一名|(拟定|推荐|入围)?(供应商|供货商)|(中选|中标|供货)单位|中选人)[::\s]|确定[\w()]{6,25}为中标人', # |唯一
|
|
'中标信息3': '(中标|中选|成交|拟定|拟选用|最终选定的?|受让)(供应商|供货商|服务商|机构|企业|公司|单位|候选人|人)(信息[,:]?)?(名称)?[::\s]|[、\s](第一名|(拟定|推荐|入围)?(供应商|供货商)|(中选|中标|供货)单位|中选人)[::\s]|确定[\w()]{6,25}为中标人', # |唯一
|
|
- '中标信息neg': '按项目控制价下浮\d%即为成交价|成交原则|不得确定为(中标|成交)|招标人按下列原则选择中标人|评选成交供应商:|拟邀请供应商|除单一来源采购项目外|单一来源除外|(各.{,5}|尊敬的)(供应商|供货商)[:\s]|竞拍起止时间:|询价结果[\s\n::]*不公开|本项目已具备招标条件|现对该项目进行招标公告|发布\w{2}结果后\d天内送达|本次\w{2}结果不对外公示|供应商\s*资格要求|成交情况:\s*[流废]标|中标单位:本次招标拟?中标单位\d家|通知中标单位|影响(成交|中标)结果',
|
|
|
|
|
|
+ '中标信息neg': '按项目控制价下浮\d%即为成交价|成交原则|不得确定为(中标|成交)|招标人按下列原则选择中标人|评选成交供应商:|拟邀请供应商|除单一来源采购项目外|单一来源除外|(各.{,5}|尊敬的)(供应商|供货商)[:\s]|竞拍起止时间:|询价结果[\s\n::]*不公开|本项目已具备招标条件|现对该项目进行招标公告|发布\w{2}结果后\d天内送达|本次\w{2}结果不对外公示|供应商\s*资格要求|成交情况:\s*[流废]标|中标单位:本次招标拟?中标单位\d家|通知中标单位|影响(成交|中标)结果|确定为成交供应商|(成交|中标|中选)公[告示](发布|\w{,2})后|竞价成交后', # 503076535 按照服务方案的优劣 确定为成交供应商
|
|
# |确定成交供应商[:,\s]
|
|
# |确定成交供应商[:,\s]
|
|
'合同公告': '合同(公告|公示|信息|内容)|合同(编号|名称|主体|基本情况|完成(日期|时间))|(供应商乙方|乙方供应商):|合同总?金额|履约信息',
|
|
'合同公告': '合同(公告|公示|信息|内容)|合同(编号|名称|主体|基本情况|完成(日期|时间))|(供应商乙方|乙方供应商):|合同总?金额|履约信息',
|
|
'废标公告': '(终止|中止|废标|流标|流采|失败|作废|异常|撤销)(结果)?(公告|公示|招标|采购|竞价)|(谈判结果为|结果类型):?废标|((本|该)(项目|标段|合同|合同包|采购包|次)\w{,5})((失败|终止|流标|废标)|予以废标|(按|做|作)?(流标|废标|废置)处理)|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答|项目)(终止|中止|废标|流标|失败|作废|异常|撤销)',
|
|
'废标公告': '(终止|中止|废标|流标|流采|失败|作废|异常|撤销)(结果)?(公告|公示|招标|采购|竞价)|(谈判结果为|结果类型):?废标|((本|该)(项目|标段|合同|合同包|采购包|次)\w{,5})((失败|终止|流标|废标)|予以废标|(按|做|作)?(流标|废标|废置)处理)|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答|项目)(终止|中止|废标|流标|失败|作废|异常|撤销)',
|
|
'废标公告2': '(无效|中止|终止|废标|流标|失败|作废|异常|撤销)的?(原因|理由)|本项目因故取消|本(项目|次)(公开)?\w{2}失败|已终止\s*原因:|(人|人数|供应商|单位)(不足|未达\w{,3}数量)|已终止|不足[3三]家|无(废标)|成交情况:\s*[流废]标|现予以废置',
|
|
'废标公告2': '(无效|中止|终止|废标|流标|失败|作废|异常|撤销)的?(原因|理由)|本项目因故取消|本(项目|次)(公开)?\w{2}失败|已终止\s*原因:|(人|人数|供应商|单位)(不足|未达\w{,3}数量)|已终止|不足[3三]家|无(废标)|成交情况:\s*[流废]标|现予以废置',
|
|
- '废标公告neg': '超过此报价将作为[废流]标处理|否则按[废流]标处理|终止规则:|成交规则:|视为流标|竞价失败的一切其他情形'
|
|
|
|
|
|
+ '废标公告neg': '超过此报价将作为[废流]标处理|否则按[废流]标处理|终止规则:|成交规则:|视为流标|竞价失败的一切其他情形|是否废标:否|若不足三家公司参与|供应商数量:?\s*报名供应商不足三家|有效报价不足三家,\s*系统自动废标' # 503076535 供应商数量: 报名供应商不足三家。
|
|
}
|
|
}
|
|
self.title_life_dic = {
|
|
self.title_life_dic = {
|
|
'采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示|意向公开',
|
|
'采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示|意向公开',
|
|
@@ -3958,8 +3970,8 @@ class DocChannel():
|
|
'招标答疑': '质疑|澄清|答疑(文件)?|补遗书?|(最高(投标)?限价|控制价|拦标价)(公示|公告|$)',
|
|
'招标答疑': '质疑|澄清|答疑(文件)?|补遗书?|(最高(投标)?限价|控制价|拦标价)(公示|公告|$)',
|
|
'废标公告': '(终止|中止|废标|废除|废置|流标|失败|作废|异常|撤销|撤回|取消成?交?|流拍)(结果|竞价|项目)?的?(公告|公示|$)|(终止|中止)(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|拍卖|招租|交易|出让)|关于废置',
|
|
'废标公告': '(终止|中止|废标|废除|废置|流标|失败|作废|异常|撤销|撤回|取消成?交?|流拍)(结果|竞价|项目)?的?(公告|公示|$)|(终止|中止)(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|拍卖|招租|交易|出让)|关于废置',
|
|
'合同公告': '(合同(成交|变更)?)(公告|公示|信息|公式|公开|签订)|合同备案|合同书|合同$', # |(履约|验收)(结果)?
|
|
'合同公告': '(合同(成交|变更)?)(公告|公示|信息|公式|公开|签订)|合同备案|合同书|合同$', # |(履约|验收)(结果)?
|
|
- '候选人公示': '候选人(变更)?公示|评标(结果)?公示|中标前?公示|中标预公示',
|
|
|
|
- '中标信息': '(中标|中选|中价|中租|成交|入选|确认)(候选人|人|供应商|记录|结果|变更)?(公告|公示|结果)|未?入围(公示|公告)|(遴选|采购|招标|竞价|议价|比选|询比?价|评选|谈判|邀标|邀请|洽谈|约谈|评标|发包|遴选|交易)\w{,2}结果|单一来源(采购|招标)?的?(中标|成交|结果)|中标通知书|中标$', # |开标(记录|信息|情况)
|
|
|
|
|
|
+ '候选人公示': '候选人(变更)?公示|评标(结果)?公示|中标前?公示|中标预公示|评审结果',
|
|
|
|
+ '中标信息': '(中标|中选|中价|中租|成交|入选|确认)(候选人|人|供应商|记录|结果|变更)?(公告|公示|结果)|未?入围(公示|公告)|(遴选|采购|招标|竞价|议价|比选|询比?价|评选|谈判|邀标|邀请|洽谈|约谈|评标|发包|遴选|交易)\w{,2}结果|单一来源(采购|招标)?的?(中标|成交|结果)|中标通知书|中标$|项目中标', # |开标(记录|信息|情况)
|
|
'资审结果': '((资格|资质)(审查|预审|后审|审核)|资审)结果(公告|公示)?|(资质|资格)(预审|后审)公示|资审及业绩公示',
|
|
'资审结果': '((资格|资质)(审查|预审|后审|审核)|资审)结果(公告|公示)?|(资质|资格)(预审|后审)公示|资审及业绩公示',
|
|
'招标公告': '(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|拍卖|招租|交易|出让)的?(公告|公示|$)|公开(采购|招标|招租|拍卖|挂牌|出让)|(资审|预审|后审)公告',
|
|
'招标公告': '(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|拍卖|招租|交易|出让)的?(公告|公示|$)|公开(采购|招标|招租|拍卖|挂牌|出让)|(资审|预审|后审)公告',
|
|
'开标记录': '开标记录|截标信息|评委名单公示|开标安排|开标数据表|开标信息|开标情况|开标一览表|开标结果|开标会',
|
|
'开标记录': '开标记录|截标信息|评委名单公示|开标安排|开标数据表|开标信息|开标情况|开标一览表|开标结果|开标会',
|
|
@@ -4254,16 +4266,16 @@ class DocChannel():
|
|
def get_type(title, text):
|
|
def get_type(title, text):
|
|
if re.search(self.title_type_dic['土地矿产'], title) or re.search(self.type_dic['土地矿产'],
|
|
if re.search(self.title_type_dic['土地矿产'], title) or re.search(self.type_dic['土地矿产'],
|
|
text): # and re.search('(土地|用地|宗地|地块)(经营权)?(流转|承包|出租|招租|租赁|确权)', text)==None
|
|
text): # and re.search('(土地|用地|宗地|地块)(经营权)?(流转|承包|出租|招租|租赁|确权)', text)==None
|
|
- if re.search(self.title_type_dic['采招数据'], 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['采招数据'], text.strip().split(' ')[0] + title):
|
|
|
|
+ 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)
|
|
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['拍卖出让'], text)):
|
|
elif (re.search(self.title_type_dic['拍卖出让'], title) or re.search(self.type_dic['拍卖出让'], text)):
|
|
- if re.search(self.title_type_dic['采招数据'], 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['采招数据'], text.strip().split(' ')[0] + title):
|
|
|
|
+ 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)
|
|
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['产权交易'], text):
|
|
elif re.search(self.title_type_dic['产权交易'], title) or re.search(self.type_dic['产权交易'], text):
|
|
- if re.search(self.title_type_dic['采招数据'], 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['采招数据'], text.strip().split(' ')[0] + title):
|
|
|
|
+ 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)
|
|
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):
|
|
return '采招数据', (
|
|
return '采招数据', (
|
|
@@ -4363,7 +4375,7 @@ class DocChannel():
|
|
elif '验收合同' in life_kw_title:
|
|
elif '验收合同' in life_kw_title:
|
|
return '验收合同', msc
|
|
return '验收合同', msc
|
|
elif '候选人公示' in life_kw_title or '候选人公示' in life_list:
|
|
elif '候选人公示' in life_kw_title or '候选人公示' in life_list:
|
|
- if '招标公告' in life_kw_title and life_score.get('招标公告', 0) > 3:
|
|
|
|
|
|
+ if '招标公告' in life_kw_title and '候选人公示' not in life_kw_title: # and life_score.get('招标公告', 0) > 3
|
|
return '招标公告', msc
|
|
return '招标公告', msc
|
|
elif '废标公告' in life_kw_title or life_score.get('废标公告', 0) > 5:
|
|
elif '废标公告' in life_kw_title or life_score.get('废标公告', 0) > 5:
|
|
return '废标公告', msc
|
|
return '废标公告', msc
|
|
@@ -4376,8 +4388,7 @@ class DocChannel():
|
|
return '合同公告', msc
|
|
return '合同公告', msc
|
|
|
|
|
|
elif '中标信息' in life_kw_title or '中标信息' in life_list:
|
|
elif '中标信息' in life_kw_title or '中标信息' in life_list:
|
|
- if '招标公告' in life_kw_title and life_score.get('招标公告',
|
|
|
|
- 0) > 2: # (life_score.get('招标公告', 0)>2 or life_score.get('中标信息', 0)<4) 0.7886409793924245
|
|
|
|
|
|
+ if '招标公告' in life_kw_title and '中标信息' not in life_kw_title and life_score.get('招标公告',0) >= life_score.get('中标信息',0): # (life_score.get('招标公告', 0)>2 or life_score.get('中标信息', 0)<4) 0.7886409793924245
|
|
return '招标公告', msc
|
|
return '招标公告', msc
|
|
elif '废标公告' in life_kw_title or life_score.get('废标公告', 0) > 5:
|
|
elif '废标公告' in life_kw_title or life_score.get('废标公告', 0) > 5:
|
|
return '废标公告', msc
|
|
return '废标公告', msc
|
|
@@ -4453,7 +4464,8 @@ class DocChannel():
|
|
11、预测预告,原始为意向、招标且标题无预告关键词,返回原始类别
|
|
11、预测预告,原始为意向、招标且标题无预告关键词,返回原始类别
|
|
'''
|
|
'''
|
|
if result['docchannel']['docchannel'] in ['中标信息', '合同公告'] and origin_dic.get(
|
|
if result['docchannel']['docchannel'] in ['中标信息', '合同公告'] and origin_dic.get(
|
|
- original_docchannel, '') in ['招标公告', '采购意向', '招标预告', '公告变更'] and is_contain_winner(prem_json)==False:
|
|
|
|
|
|
+ original_docchannel, '') in ['招标公告', '采购意向', '招标预告', '公告变更'] and is_contain_winner(
|
|
|
|
+ prem_json)==False and re.search(self.title_life_dic['中标信息'], title)==None:
|
|
result['docchannel']['docchannel'] = origin_dic.get(original_docchannel, '')
|
|
result['docchannel']['docchannel'] = origin_dic.get(original_docchannel, '')
|
|
msc += '最终规则修改:中标公告、合同公告无中标人且原始为非中标,返回原类型'
|
|
msc += '最终规则修改:中标公告、合同公告无中标人且原始为非中标,返回原类型'
|
|
elif result['docchannel']['docchannel'] == '废标公告' and is_contain_winner(prem_json) and re.search(
|
|
elif result['docchannel']['docchannel'] == '废标公告' and is_contain_winner(prem_json) and re.search(
|
|
@@ -4498,10 +4510,16 @@ class DocChannel():
|
|
|
|
|
|
if result['docchannel']['doctype'] in ['产权交易', '土地矿产', '拍卖出让'] and origin_dic.get(
|
|
if result['docchannel']['doctype'] in ['产权交易', '土地矿产', '拍卖出让'] and origin_dic.get(
|
|
original_docchannel, '') not in ['产权交易', '土地矿产', '拍卖出让'] \
|
|
original_docchannel, '') not in ['产权交易', '土地矿产', '拍卖出让'] \
|
|
- and re.search('产权|转让|受让|招租|招商|出租|承租|竞价|资产|挂牌|出让|拍卖|招拍|划拨|销售', title) == None\
|
|
|
|
- and re.search('(采购|招投?标|投标)(信息|内容|项目|公告|数量|人|单位|方式)|(建设|工程|服务|施工|监理|勘察|设计)项目', text):
|
|
|
|
|
|
+ and (re.search(self.title_type_dic['采招数据'], title) or re.search('工程|服务|采购|询价|磋商', title) or re.search('(采购|招投?标|投标)(信息|内容|项目|公告|数量|人|单位|方式)|(建设|工程|服务|施工|监理|勘察|设计)项目|(%s)'%self.type_dic['采招数据'], text)):
|
|
result['docchannel']['doctype'] = '采招数据'
|
|
result['docchannel']['doctype'] = '采招数据'
|
|
msc += ' 最终规则修改:预测为非采招数据,原始为采招数据且有招标关键词,返回采招数据'
|
|
msc += ' 最终规则修改:预测为非采招数据,原始为采招数据且有招标关键词,返回采招数据'
|
|
|
|
+ elif result['docchannel']['doctype'] in ['土地矿产'] and origin_dic.get(original_docchannel, '') in ['拍卖出让', '产权交易']:
|
|
|
|
+ if origin_dic.get(original_docchannel, '') in ['拍卖出让'] and (re.search(self.title_type_dic['拍卖出让'], title) or re.search(self.type_dic['拍卖出让'], text)):
|
|
|
|
+ result['docchannel']['doctype'] = '拍卖出让'
|
|
|
|
+ msc += "最终规则修改:预测为土地矿产原始为拍卖且有拍卖关键词,返回拍卖"
|
|
|
|
+ elif (re.search(self.title_type_dic['产权交易'], title) or re.search(self.type_dic['产权交易'], text)):
|
|
|
|
+ result['docchannel']['doctype'] = '产权交易'
|
|
|
|
+ msc += "最终规则修改:预测为土地矿产原始为产权交易且有产权交易关键词,返回产权交易"
|
|
|
|
|
|
'''下面是新格式增加返回字段'''
|
|
'''下面是新格式增加返回字段'''
|
|
if result['docchannel']['docchannel'] != '': # 预测到生命周期的复制到life_docchannel,否则用数据源结果
|
|
if result['docchannel']['docchannel'] != '': # 预测到生命周期的复制到life_docchannel,否则用数据源结果
|
|
@@ -4548,6 +4566,8 @@ class DocChannel():
|
|
return {'docchannel': {'docchannel': '', 'doctype': not_extract_dic[original_docchannel], 'life_docchannel': origin_dic.get(original_docchannel, '原始类别')}}, '公告类别不在提取范围'
|
|
return {'docchannel': {'docchannel': '', 'doctype': not_extract_dic[original_docchannel], 'life_docchannel': origin_dic.get(original_docchannel, '原始类别')}}, '公告类别不在提取范围'
|
|
if web_source_no in ['02104-7', '04733', 'DX007628-6']: # 这些数据源无法识别
|
|
if web_source_no in ['02104-7', '04733', 'DX007628-6']: # 这些数据源无法识别
|
|
return {'docchannel': {'docchannel': '', 'doctype': '采招数据', 'life_docchannel': origin_dic.get(original_docchannel, '原始类别')}}, '此数据源公告分类不明确,返回数据源类别'
|
|
return {'docchannel': {'docchannel': '', 'doctype': '采招数据', 'life_docchannel': origin_dic.get(original_docchannel, '原始类别')}}, '此数据源公告分类不明确,返回数据源类别'
|
|
|
|
+ if original_docchannel == 303:
|
|
|
|
+ return {'docchannel': {'docchannel': '处罚公告', 'doctype': '处罚公告', 'life_docchannel': '处罚公告'}}, "源类别为处罚公告"
|
|
|
|
|
|
title = re.sub('[^\u4e00-\u9fa5]+|出租车', '', title)
|
|
title = re.sub('[^\u4e00-\u9fa5]+|出租车', '', title)
|
|
if len(title) > 50:
|
|
if len(title) > 50:
|
|
@@ -4567,9 +4587,9 @@ class DocChannel():
|
|
# print('channel正则预测结果:', result)
|
|
# print('channel正则预测结果:', result)
|
|
msc = '正则结果:类型:%s, 关键词:%s, 周期:%s, 关键词:%s'%(doc_type, type_kw,doc_life, life_kw)+'\n'+'模型结果:'
|
|
msc = '正则结果:类型:%s, 关键词:%s, 周期:%s, 关键词:%s'%(doc_type, type_kw,doc_life, life_kw)+'\n'+'模型结果:'
|
|
# print('类型:%s, 关键词:%s, 周期:%s, 关键词:%s'%(doc_type, type_kw,doc_life, life_kw))
|
|
# print('类型:%s, 关键词:%s, 周期:%s, 关键词:%s'%(doc_type, type_kw,doc_life, life_kw))
|
|
- if doc_type == "" or doc_life == "":
|
|
|
|
|
|
+ if doc_type == "" or doc_life == "" or (doc_type != '采招数据' and origin_dic.get(original_docchannel, '原始类别') in ['招标公告', '中标信息', '招标预告', '采购意向']):
|
|
array_content, array_title, text_len, title_len, content = get_model_inputs(list_sentence)
|
|
array_content, array_title, text_len, title_len, content = get_model_inputs(list_sentence)
|
|
- if doc_type =="":
|
|
|
|
|
|
+ if doc_type =="" or (doc_type != '采招数据' and origin_dic.get(original_docchannel, '原始类别') in ['招标公告', '中标信息', '招标预告', '采购意向']):
|
|
type_id, type_prob = type_model_predict()
|
|
type_id, type_prob = type_model_predict()
|
|
type_model = self.id2type[type_id]
|
|
type_model = self.id2type[type_id]
|
|
if type_model == '新闻资讯' and doc_life!='': # 修复bug 78584245 "docchannel": "合同公告", "doctype": "新闻资讯",
|
|
if type_model == '新闻资讯' and doc_life!='': # 修复bug 78584245 "docchannel": "合同公告", "doctype": "新闻资讯",
|
|
@@ -4583,9 +4603,10 @@ class DocChannel():
|
|
if doc_life=="" and result['docchannel']['doctype'] not in ['', '新闻资讯']:
|
|
if doc_life=="" and result['docchannel']['doctype'] not in ['', '新闻资讯']:
|
|
if len(text)>150 and re.search(self.kws, content):
|
|
if len(text)>150 and re.search(self.kws, content):
|
|
life_id, life_prob = life_model_predict()
|
|
life_id, life_prob = life_model_predict()
|
|
- life_model = self.id2life[life_id]
|
|
|
|
- result['docchannel']['docchannel'] = life_model
|
|
|
|
- msc += life_model + ' 概率:%.4f;\n'%life_prob
|
|
|
|
|
|
+ if life_prob>=0.8:
|
|
|
|
+ life_model = self.id2life[life_id]
|
|
|
|
+ result['docchannel']['docchannel'] = life_model
|
|
|
|
+ msc += life_model + ' 概率:%.4f;\n'%life_prob
|
|
|
|
|
|
msc = final_change(msc)
|
|
msc = final_change(msc)
|
|
# print('channel ', msc)
|
|
# print('channel ', msc)
|
|
@@ -5289,8 +5310,8 @@ class IndustryPredictor():
|
|
text = text.replace('(', '(').replace(')', ')')
|
|
text = text.replace('(', '(').replace(')', ')')
|
|
text = re.sub(
|
|
text = re.sub(
|
|
'(废标|终止|综?合?评审|评标|开标|资审|履约|验收|成交|中标人?|中选人?|单一来源|合同|候选人|结果|变更|更正|答疑|澄清|意向|需求|采购|招标|询比?价|磋商|谈判|比选|比价|竞价|议价)的?(公告|预告|公示)?|关于为?|选取|定点|直接|邀请函?|通知书?|备案|公开|公示|公告|记录|竞争性',
|
|
'(废标|终止|综?合?评审|评标|开标|资审|履约|验收|成交|中标人?|中选人?|单一来源|合同|候选人|结果|变更|更正|答疑|澄清|意向|需求|采购|招标|询比?价|磋商|谈判|比选|比价|竞价|议价)的?(公告|预告|公示)?|关于为?|选取|定点|直接|邀请函?|通知书?|备案|公开|公示|公告|记录|竞争性',
|
|
- '', text)
|
|
|
|
- text = text.replace(tenderee, '')
|
|
|
|
|
|
+ ' ', text)
|
|
|
|
+ text = text.replace(tenderee, ' ')
|
|
text = ' ' if text=="" else text
|
|
text = ' ' if text=="" else text
|
|
words_docs_list = selffool.cut(text)
|
|
words_docs_list = selffool.cut(text)
|
|
words_docs_list = [[it for it in l if re.search('^[\u4e00-\u9fa5]+$', it)][-maxSententLen:] for l in words_docs_list]
|
|
words_docs_list = [[it for it in l if re.search('^[\u4e00-\u9fa5]+$', it)][-maxSententLen:] for l in words_docs_list]
|
|
@@ -5323,6 +5344,7 @@ class IndustryPredictor():
|
|
product = product if product else ''
|
|
product = product if product else ''
|
|
|
|
|
|
text_ind = (doctitle + project_name + product).replace(tenderee, '')
|
|
text_ind = (doctitle + project_name + product).replace(tenderee, '')
|
|
|
|
+ text_ind = text_ind.replace('墙面粉刷', '墙面 粉刷')
|
|
text_com = win_tenderer
|
|
text_com = win_tenderer
|
|
|
|
|
|
length_ind_text = len(text_ind) + 1
|
|
length_ind_text = len(text_ind) + 1
|
|
@@ -5878,15 +5900,54 @@ class DistrictPredictor():
|
|
name, b, e = it
|
|
name, b, e = it
|
|
area_list.append((name, (e - b + e) / max_len / 2))
|
|
area_list.append((name, (e - b + e) / max_len / 2))
|
|
return area_list
|
|
return area_list
|
|
|
|
+
|
|
|
|
+ def find_whole_areas(text):
|
|
|
|
+ '''
|
|
|
|
+ 通过正则匹配字符串返回地址
|
|
|
|
+ :param pettern: 地址正则 广东省|广西省|...
|
|
|
|
+ :param text: 待匹配文本
|
|
|
|
+ :return:
|
|
|
|
+ '''
|
|
|
|
+ pettern = "((?P<prov>%s)(?P<city>%s)?(?P<dist>%s)?)|((?P<city1>%s)(?P<dist1>%s)?)|(?P<dist2>%s)" % (
|
|
|
|
+ p_pro, p_city, p_dis, p_city, p_dis, p_dis)
|
|
|
|
+ province_l, city_l, district_l = [], [], []
|
|
|
|
+ for it in re.finditer(pettern, text):
|
|
|
|
+ if re.search('[省市区县旗盟]$', it.group(0)) == None and re.search(
|
|
|
|
+ '^([东南西北中一二三四五六七八九十大小]?(村|镇|街|路|道|社区)|酒店|宾馆)', text[it.end():]):
|
|
|
|
+ continue
|
|
|
|
+ if it.group(0) == '站前': # 20240314 修复类似 中铁二局新建沪苏湖铁路工程站前VI标项目 错识别为 省份:辽宁, 城市:营口,区县:站前
|
|
|
|
+ continue
|
|
|
|
+ for k, v in it.groupdict().items():
|
|
|
|
+ if v != None:
|
|
|
|
+ if k in ['prov']:
|
|
|
|
+ province_l.append((it.group(k), it.start(k), it.end(k)))
|
|
|
|
+ elif k in ['city', 'city1']:
|
|
|
|
+ if re.search('^(经济开发区|开发区|新区)', text[it.end(k):]): # 城市不匹配为区的地址 修复 滨州北海经济开发区 北海新区 等提取为北海
|
|
|
|
+ continue
|
|
|
|
+ city_l.append((it.group(k), it.start(k), it.end(k)))
|
|
|
|
+ if re.search('^([分支](公司|局|行|校|院|干?线)|\w{,3}段|地铁|(火车|高铁)?站|\w{,3}项目)', text[it.end(k):]):
|
|
|
|
+ city_l.append((it.group(k), it.start(k), it.end(k)))
|
|
|
|
+ elif k in ['dist', 'dist1', 'dist2']:
|
|
|
|
+ if it.group(k)=='昌江' and '景德镇' not in it.group(0):
|
|
|
|
+ district_l.append(('昌江黎族', it.start(k), it.end(k)))
|
|
|
|
+ else:
|
|
|
|
+ district_l.append((it.group(k), it.start(k), it.end(k)))
|
|
|
|
+ return province_l, city_l, district_l
|
|
|
|
+
|
|
def get_pro_city_dis_score(text, text_weight=1):
|
|
def get_pro_city_dis_score(text, text_weight=1):
|
|
text = re.sub('复合肥|海南岛|兴业银行|双河口|阳光|杭州湾', ' ', text)
|
|
text = re.sub('复合肥|海南岛|兴业银行|双河口|阳光|杭州湾', ' ', text)
|
|
text = re.sub('珠海城市', '珠海', text) # 修复 426624023 珠海城市 预测为海城市
|
|
text = re.sub('珠海城市', '珠海', text) # 修复 426624023 珠海城市 预测为海城市
|
|
text = re.sub('怒江州', '怒江傈僳族自治州', text) # 修复 423589589 所属地域:怒江州 识别为广西 - 崇左 - 江州
|
|
text = re.sub('怒江州', '怒江傈僳族自治州', text) # 修复 423589589 所属地域:怒江州 识别为广西 - 崇左 - 江州
|
|
text = re.sub('茂名滨海新区', '茂名市', text)
|
|
text = re.sub('茂名滨海新区', '茂名市', text)
|
|
text = re.sub('中山([东南西][部区环]|黄圃|南头|东凤|小榄|石岐|翠亨|南朗)', '中山市', text)
|
|
text = re.sub('中山([东南西][部区环]|黄圃|南头|东凤|小榄|石岐|翠亨|南朗)', '中山市', text)
|
|
- province_l = find_areas(p_pro, text)
|
|
|
|
- city_l = find_areas(p_city, text)
|
|
|
|
- district_l = find_areas(p_dis, text)
|
|
|
|
|
|
+ ser = re.search('海南(昌江|白沙|乐东|陵水|保亭|琼中)(黎族)?', text)
|
|
|
|
+ if ser and '黎族' not in ser.group(0):
|
|
|
|
+ text = text.replace(ser.group(0), ser.group(0)+'黎族')
|
|
|
|
+ # province_l = find_areas(p_pro, text)
|
|
|
|
+ # city_l = find_areas(p_city, text)
|
|
|
|
+ # district_l = find_areas(p_dis, text)
|
|
|
|
+
|
|
|
|
+ province_l, city_l, district_l = find_whole_areas(text) # 20240703 优化地址提取,解决类似 海南昌江 得到 海南 南昌 结果
|
|
|
|
|
|
if len(province_l) == len(city_l) == 0:
|
|
if len(province_l) == len(city_l) == 0:
|
|
district_l = [it for it in district_l if
|
|
district_l = [it for it in district_l if
|
|
@@ -6066,8 +6127,11 @@ class DistrictPredictor():
|
|
|
|
|
|
def get_project_addr(text):
|
|
def get_project_addr(text):
|
|
p1 = '(项目|施工|实施|建设|工程|服务|交货|送货|收货|展示|看样|拍卖)(地址|地点|位置|所在地区?)(位于)?:(?P<addr>(\w{1,13}(自治[区州县旗]|地区|[省市区县旗盟])[^\w]*)+|\w{2,15}[,。])'
|
|
p1 = '(项目|施工|实施|建设|工程|服务|交货|送货|收货|展示|看样|拍卖)(地址|地点|位置|所在地区?)(位于)?:(?P<addr>(\w{1,13}(自治[区州县旗]|地区|[省市区县旗盟])[^\w]*)+|\w{2,15}[,。])'
|
|
|
|
+ p2 = '项目位于(?P<addr>\w{2}市\w{2,4}区)'
|
|
if re.search(p1, text):
|
|
if re.search(p1, text):
|
|
return re.search(p1, text).group('addr')
|
|
return re.search(p1, text).group('addr')
|
|
|
|
+ elif re.search(p2, text):
|
|
|
|
+ return re.search(p2, text).group('addr')
|
|
else:
|
|
else:
|
|
return ''
|
|
return ''
|
|
|
|
|
|
@@ -6722,15 +6786,16 @@ class CandidateExtractor(object):
|
|
'project_code': "(项目|招标|采购|计划|公告|包[段组件]|标[段包的]|标段(包)|分[包标])(编号|编码)",
|
|
'project_code': "(项目|招标|采购|计划|公告|包[段组件]|标[段包的]|标段(包)|分[包标])(编号|编码)",
|
|
"project_name": "(包[段组件]|标[段包的项]|标段(包)|分[包标]|采购|项目|工程|货物|商品|产品|设备|通用|主要标的|^包)(名称?|内容)",
|
|
"project_name": "(包[段组件]|标[段包的项]|标段(包)|分[包标]|采购|项目|工程|货物|商品|产品|设备|通用|主要标的|^包)(名称?|内容)",
|
|
"win_sort": "排名|排序|名次|推荐顺序",
|
|
"win_sort": "排名|排序|名次|推荐顺序",
|
|
- 'win_or_not': '是否中标|是否入围|是否入库|入围结论',
|
|
|
|
- "candidate": "((候选|入围|入选|投标)(供应商库)?的?(人|人?单位|机构|供应商|供货商|服务商|投标人|(中标)?公司|(中标)?企业)|(通过)?名单|中标候选人)(名称|名单|全称|\d)?$|^供应商(名称|信息)?$",
|
|
|
|
|
|
+ 'win_or_not': '是否(建议|推荐)?(中标|成交)|是否入围|是否入库|入围结论',
|
|
|
|
+ "candidate": "((候选|入围|入选|投标)(供应商库)?的?(人|人?单位|机构|供应商|供货商|服务商|投标人|(中标)?公司|(中标)?企业)|(通过)?名单|中标候选人)(名称|名单|全称|\d)?$|^供应商(名称|信息)?$|投标个人/单位", #补充 368295593 投标个人/单位 提取
|
|
"bid_amount": "投标[报总]?价|报价(总?金额|总价|总额)|总报价|^\w{,5}报价(([\w、/]{1,15}))?$|(中标|成交|合同))?([金总]额|[报均总]价|价[格款]?)|承包价|含税价|经评审的价格",
|
|
"bid_amount": "投标[报总]?价|报价(总?金额|总价|总额)|总报价|^\w{,5}报价(([\w、/]{1,15}))?$|(中标|成交|合同))?([金总]额|[报均总]价|价[格款]?)|承包价|含税价|经评审的价格",
|
|
"win_tenderer": "第一名|第一(中标|成交)?候选人",
|
|
"win_tenderer": "第一名|第一(中标|成交)?候选人",
|
|
"second_tenderer": "第二名|第二(中标|成交)?候选人",
|
|
"second_tenderer": "第二名|第二(中标|成交)?候选人",
|
|
"third_tenderer": "第三名|第三(中标|成交)?候选人",
|
|
"third_tenderer": "第三名|第三(中标|成交)?候选人",
|
|
}
|
|
}
|
|
'''非表格候选人正则'''
|
|
'''非表格候选人正则'''
|
|
- self.p = '((候选|入围|入选|投标)(供应商库)?的?(人|人?单位|机构|供应商|供货商|服务商|投标人|(中标)?公司|(中标)?企业)|(通过)?名单)(名称|名单|全称|\d)?:$'
|
|
|
|
|
|
+ # self.p = '((候选|入围|入选|投标)(供应商库)?的?(人|人?单位|机构|供应商|供货商|服务商|投标人|(中标)?公司|(中标)?企业|应答人)|(通过)?名单)(名称|名单|全称|\d)?:$'
|
|
|
|
+ self.p = '((候选|入围|入选|投标|报价|成交|中标|中选|供[货应]|应答)(人|方|人?单位|机构|厂?商|商家|服务商|公司|企业)|(通过|入围)名单)(名称|名单|全称|\d)?:?$'
|
|
self.tb = TableTag2List()
|
|
self.tb = TableTag2List()
|
|
with open(os.path.dirname(__file__)+'/header_set.pkl', 'rb') as f:
|
|
with open(os.path.dirname(__file__)+'/header_set.pkl', 'rb') as f:
|
|
self.headerset = pickle.load(f)
|
|
self.headerset = pickle.load(f)
|
|
@@ -6869,7 +6934,10 @@ class CandidateExtractor(object):
|
|
package = uniform_package_name(package) if package !="" else "Project"
|
|
package = uniform_package_name(package) if package !="" else "Project"
|
|
if candidate:
|
|
if candidate:
|
|
if win_or_not and re.search('否|未入围', win_or_not):
|
|
if win_or_not and re.search('否|未入围', win_or_not):
|
|
- pass
|
|
|
|
|
|
+ candidate_set.add(candidate)
|
|
|
|
+ elif re.search('^((建议|推荐)(中标|成交)|是)$', win_or_not) and win_sort in ['', '参与投标单位及排名'] and win_tenderer=='':
|
|
|
|
+ win_sort = '第一名'
|
|
|
|
+ candidate_set.add(candidate)
|
|
else:
|
|
else:
|
|
candidate_set.add(candidate)
|
|
candidate_set.add(candidate)
|
|
|
|
|
|
@@ -6884,8 +6952,7 @@ class CandidateExtractor(object):
|
|
if type not in role_dic:
|
|
if type not in role_dic:
|
|
role_dic[type] = dict()
|
|
role_dic[type] = dict()
|
|
role_dic[type]['role_text'] = text
|
|
role_dic[type]['role_text'] = text
|
|
- if type in ['second_tenderer', 'third_tenderer']:
|
|
|
|
- candidate_set.add(text)
|
|
|
|
|
|
+ candidate_set.add(text)
|
|
|
|
|
|
elif re.search('投标报价|报价$', df.loc[i, 0]) or re.search('投标报价|报价$', df.loc[i, 1]):
|
|
elif re.search('投标报价|报价$', df.loc[i, 0]) or re.search('投标报价|报价$', df.loc[i, 1]):
|
|
findmoney = True
|
|
findmoney = True
|
|
@@ -7042,7 +7109,7 @@ class CandidateExtractor(object):
|
|
e = ent.wordOffset_end
|
|
e = ent.wordOffset_end
|
|
if ent.label in [2,3,4]: # 直接加实体预测的候选人, 否则规则检查是否为候选人
|
|
if ent.label in [2,3,4]: # 直接加实体预测的候选人, 否则规则检查是否为候选人
|
|
candidates.add(ent.entity_text)
|
|
candidates.add(ent.entity_text)
|
|
- elif isinstance(b, int) and isinstance(e, int):
|
|
|
|
|
|
+ elif isinstance(b, int) and isinstance(e, int) and ent.label in [5]:
|
|
foreword = text[max(0, b - 10):b]
|
|
foreword = text[max(0, b - 10):b]
|
|
if re.search(self.p, foreword):
|
|
if re.search(self.p, foreword):
|
|
candidates.add(ent.entity_text)
|
|
candidates.add(ent.entity_text)
|
|
@@ -7065,8 +7132,8 @@ class CandidateExtractor(object):
|
|
if prem == {} and richText:
|
|
if prem == {} and richText:
|
|
prem, candidate_set = self.get_prem(richText)
|
|
prem, candidate_set = self.get_prem(richText)
|
|
in_attachment = True
|
|
in_attachment = True
|
|
- if prem == {} and candidate_set == set():
|
|
|
|
- candidate_set = self.get_candidates_from_text(list_sentences, list_entitys)
|
|
|
|
|
|
+ candidate_set2 = self.get_candidates_from_text(list_sentences, list_entitys)
|
|
|
|
+ candidate_set.update(candidate_set2)
|
|
return prem, {'candidate': ','.join(candidate_set)}, in_attachment
|
|
return prem, {'candidate': ','.join(candidate_set)}, in_attachment
|
|
|
|
|
|
def role_special_predictor(web_source_name, content, nlp_enterprise):
|
|
def role_special_predictor(web_source_name, content, nlp_enterprise):
|
|
@@ -7150,15 +7217,15 @@ class ApprovalPredictor():
|
|
项目(法人)单位
|
|
项目(法人)单位
|
|
'''
|
|
'''
|
|
self.other_part = {
|
|
self.other_part = {
|
|
- "project_name": "(项目|工程|采购|招标|计划)名称?:(?P<main>[^:。]{5,50})[,。](\w{2,10}:|$)?", # 项目名称
|
|
|
|
- "project_code": "(立案号|项目(统一)?代码|(项目|工程|采购|招标|计划|任务|备案)(编[号码]|号)):(?P<main>(\w{2,8})?[()〔〕【】\[\]a-zA-Z0-9-]{5,30}号?)(\w{2,10}:|$)?", # 项目编号
|
|
|
|
- "doc_num": "((审[批查核]|批[复准]|立项|[定知]书|[公发批]文|用地|决定|备案|核准|许可|确认)[文编]?号|综合受理号|文书号):(?P<main>(\w{2,8})?[()〔〕【】\[\]a-zA-Z0-9-.]{5,30}号?)[,。]?(\w{2,10}:|$)?", # 文号
|
|
|
|
- "pro_type": "(申[报请](类型|种类)|项目所属行业|行业(分类|归属)|产业领域|项目行业|项目类型|立项类型):(?P<main>[^:。]{2,30})[,。](\w{2,10}:|$)?", # 项目类型
|
|
|
|
- "year_limit": "((建设|工程|服务|项目)(年限|期限|时长)):(?P<main>[\d个年月日.-]{2,20})[,。](\w{2,10}:|$)?", # 建设年限
|
|
|
|
- "construction_scale": "(建设内容[及和](建设)?规模|建设规模[及和](主要)?(建设)?内容|(建设|工程|项目)规模(如下)?):(?P<main>[^:。]{2,50})[,。](\w{2,10}:|$)?", # 建设规模
|
|
|
|
- "approval_items": "((审[批查核]|批[复准]申请)(事项|内容)|事项名称|事项审批):(?P<main>[^:。]{2,50})[,。](\w{2,10}:|$)?", # 审批事项
|
|
|
|
|
|
+ "project_name": "((项目|工程|采购|招标|计划|建设|规划)名称?|生产建设项目|申请项目):(?P<main>[^:。]{5,50})[,。](\w{2,10}:|$)?", # 项目名称
|
|
|
|
+ "project_code": "(立案号|项目(统一)?代码|(项目|工程|采购|招标|计划|任务|备案|索引)(编[号码]|号)):?(?P<main>(\w{2,8})?[()〔〕【】\[\]a-zA-Z0-9-]{5,30}号?)(\w{2,10}:|$)?", # 项目编号
|
|
|
|
+ "doc_num": "((审[批查核]|批[复准]|立项|[定知]书|[公发批]文|用地|决定|备案|核准|许可|确认|受理|申请报告|文件|意见书|办件)[文编]?号|综合受理号|文书?号|合格书号):?(?P<main>(\w{2,8})?[()〔〕【】\[\]a-zA-Z0-9-.]{5,30}号?)[,。]?(\w{2,10}:|$)?", # 文号
|
|
|
|
+ "pro_type": "((申[报请]|审核备|项目|立项)(类型|种类)|项目所属行业|行业(分类|归属)|产业领域|项目行业):(?P<main>[^:。]{2,30})[,。](\w{2,10}:|$)?", # 项目类型
|
|
|
|
+ "year_limit": "((建设|工程|服务|项目)(起止|\w{,2})?(年限|期限|时长|工期)):(约|超过|大概|建设工期|共计|合计)?(?P<main>[\d一二三四五六七八九十]+个月|\d{1,3}(日?历?天|小时)|20\d{2}[年/-](\d{1,2}[月/-]?)?(\d{1,2}日?)?([至—-]+20\d{2}[年/-](\d{1,2}[月/-]?)?(\d{1,2}日?)?)?)[(,。](\w{2,10}:|$)?", # 建设年限
|
|
|
|
+ "construction_scale": "(建设内容[及和](建设)?规模|建设规模[及和](主要)?(建设)?内容|(建设|招标|采购))?内容|(建设|工程|项目)(主要)?(规模|内容|概况|面积)([及和](主要)?(规模|内容|概况|面积))?(如下)?):(?P<main>[^:。]{2,250})[,。](\w{2,10}:|$)?", # 建设规模
|
|
|
|
+ "approval_items": "((审[批查核]|批[复准]|申请|监管)(事项|内容|名称)|事项名称|事项审批):(?P<main>[^:。]{2,70})[,。](\w{2,10}:|$)?", # 审批事项
|
|
"properties": "((建设|工程|项目)性质):(?P<main>[^:。]{2,50})[,。](\w{2,10}:|$)?", # 建设性质
|
|
"properties": "((建设|工程|项目)性质):(?P<main>[^:。]{2,50})[,。](\w{2,10}:|$)?", # 建设性质
|
|
- "approval_result": "((审[批查核]|批[复准])(结果|决定|结论|状态|回复)|(办理|,)(状态|意见|结果)):(?P<main>[^:。]{2,50})[,。](\w{2,10}:|$)?", # 审批结果
|
|
|
|
|
|
+ "approval_result": "((审[批查核]|批[复准]|核[发准]|许可|抽查|备案)(结果|决定|结论|状态|回复|意见)|(办[理件]|,)(状态|意见|结果)|项目(当前|目前)?状态):(?P<main>[^:。]{2,20})[,。](\w{2,10}:|$)?", # 审批结果
|
|
"phone": "(联系)?电话:(?P<main>1[3-9][0-9][-—-―]?\d{4}[-—-―]?\d{4}|" # 联系电话
|
|
"phone": "(联系)?电话:(?P<main>1[3-9][0-9][-—-―]?\d{4}[-—-―]?\d{4}|" # 联系电话
|
|
'\+86.?1[3-9]\d{9}|'
|
|
'\+86.?1[3-9]\d{9}|'
|
|
'0[1-9]\d{1,2}[-—-―][2-9]\d{6}\d?[-—-―]\d{1,4}|'
|
|
'0[1-9]\d{1,2}[-—-―][2-9]\d{6}\d?[-—-―]\d{1,4}|'
|
|
@@ -7172,22 +7239,26 @@ class ApprovalPredictor():
|
|
}
|
|
}
|
|
|
|
|
|
self.role_type = {
|
|
self.role_type = {
|
|
- "declare_company": "(申[请报]|填报|呈报)(部门|机关|单位|企业|公司|机构|组织)", # 申报单位
|
|
|
|
- "construct_company": "(业主|建设|用地|委托|发包|产权|项目))?(部门|机关|单位|企业|公司|方)|主送机关|法人单位|甲方", # 建设单位
|
|
|
|
- "approver": "(审[批查核]|许可|批准|发证|批复|管理)(部门|机关|单位|企业|公司|机构)", # 审批部门
|
|
|
|
- "evaluation_agency": "(环境|环保)?(影响)?(环评|评价|评估)(机构|单位|公司)" # 环评机构
|
|
|
|
|
|
+ "declare_company": "(申[请报]|填报|呈报)(人|部门|机关|单位|企业|公司|机构|组织)", # 申报单位
|
|
|
|
+ "construct_company": "(业主|建设|用地|委托|发包|产权|项目))?(部门|机关|单位|企业|公司|方|业主)|主送机关|法人单位|甲方", # 建设单位
|
|
|
|
+ "approver": "(审[批查核议图]|许可|批[复准](用地)?|发证|管理|办理|受理|核[发准]|备案|承办)(部门|机关|单位|企业|公司|机构)|实施主体", # 审批部门
|
|
|
|
+ "evaluation_agency": "(环境|环保)?(影响)?(环评|评价|评估)(机构|单位|公司)" , # 环评机构
|
|
|
|
+ "compilation_unit": "编制单位", # 编制单位 20240701加
|
|
|
|
+ "publisher": "(发布|发文|公示|公告)(人|部门|机关|单位|企业|公司|机构|组织)" # 发布机构 20240703加
|
|
}
|
|
}
|
|
self.person_type = {
|
|
self.person_type = {
|
|
"legal_person": "项目法人|法定代表人|企业法人" # 项目法人
|
|
"legal_person": "项目法人|法定代表人|企业法人" # 项目法人
|
|
}
|
|
}
|
|
self.date_type = {
|
|
self.date_type = {
|
|
"time_declare": "(申[请报]|填报|呈报)(时间|日期)", # 申报时间
|
|
"time_declare": "(申[请报]|填报|呈报)(时间|日期)", # 申报时间
|
|
- "time_commencement": "(开工|动工|施工开始)(时间|日期)", # 开工时间
|
|
|
|
- "time_completion": "(竣工|完工|验收|(项目|建设|工程)(完成|结束))(备案)?(时间|日期)" # 竣工时间
|
|
|
|
|
|
+ "time_commencement": "(开工|动工|(项目|建设|工程|施工)开始)(时间|日期)", # 开工时间
|
|
|
|
+ "time_completion": "(竣工|完工|验收|(项目|建设|工程|施工)(完成|结束))(备案)?(时间|日期)", # 竣工时间
|
|
|
|
+ "time_approval": "(审[批查核查议]|许可|批[复准](用地)?|发证|管理|办理|受理|核[发准]|备案|决定)(时间|日期)", # 审批时间 20240701加
|
|
|
|
+ "time_release": "(发布|发文|公告|生成|成文)(时间|日期)" # 发布时间
|
|
}
|
|
}
|
|
|
|
|
|
self.addr_type = {
|
|
self.addr_type = {
|
|
- "project_addr": "(建设|工程|项目|施工)(地址|地点|位置|所在地)|[宗土]地坐落|用地位置" # 建设地址
|
|
|
|
|
|
+ "project_addr": "(建设|工程|项目|施工|地块|用地)\w{,2}(地址|地点|位置|所在地)|[宗土]地坐落" # 建设地址
|
|
}
|
|
}
|
|
|
|
|
|
self.money_type = {
|
|
self.money_type = {
|
|
@@ -7203,6 +7274,7 @@ class ApprovalPredictor():
|
|
rs_l = []
|
|
rs_l = []
|
|
found_key = 0
|
|
found_key = 0
|
|
code_name_set = set() # 项目编号、名称集合
|
|
code_name_set = set() # 项目编号、名称集合
|
|
|
|
+ org_set = set() # 保存可能为审批部门的角色
|
|
for entity in list_entitys[0]:
|
|
for entity in list_entitys[0]:
|
|
entities[entity.sentence_index].append(entity)
|
|
entities[entity.sentence_index].append(entity)
|
|
|
|
|
|
@@ -7214,12 +7286,16 @@ class ApprovalPredictor():
|
|
for entity in entities[i]:
|
|
for entity in entities[i]:
|
|
b, e = entity.wordOffset_begin, entity.wordOffset_end
|
|
b, e = entity.wordOffset_begin, entity.wordOffset_end
|
|
if entity.entity_type in ['org', 'company']:
|
|
if entity.entity_type in ['org', 'company']:
|
|
|
|
+ flag = 1
|
|
for k, v in self.role_type.items():
|
|
for k, v in self.role_type.items():
|
|
if re.search(v, sentences[entity.sentence_index][max(0, b - span):b]):
|
|
if re.search(v, sentences[entity.sentence_index][max(0, b - span):b]):
|
|
if rs_dic[k] == '':
|
|
if rs_dic[k] == '':
|
|
rs_dic[k] = entity.entity_text
|
|
rs_dic[k] = entity.entity_text
|
|
multi_project[k] = entity.entity_text
|
|
multi_project[k] = entity.entity_text
|
|
found_key = 1
|
|
found_key = 1
|
|
|
|
+ flag = 0
|
|
|
|
+ if flag and entity.entity_type == "org" and re.search('(局|委员会|委|厅)$', entity.entity_text):
|
|
|
|
+ org_set.add(entity.entity_text)
|
|
elif entity.entity_type in ['person']:
|
|
elif entity.entity_type in ['person']:
|
|
for k, v in self.person_type.items():
|
|
for k, v in self.person_type.items():
|
|
if re.search(v, sentences[entity.sentence_index][max(0, b - span):b]):
|
|
if re.search(v, sentences[entity.sentence_index][max(0, b - span):b]):
|
|
@@ -7231,9 +7307,12 @@ class ApprovalPredictor():
|
|
elif entity.entity_type in ['time']:
|
|
elif entity.entity_type in ['time']:
|
|
for k, v in self.date_type.items():
|
|
for k, v in self.date_type.items():
|
|
if re.search(v, sentences[entity.sentence_index][max(0, b - span):b]):
|
|
if re.search(v, sentences[entity.sentence_index][max(0, b - span):b]):
|
|
|
|
+ time = timeFormat(entity.entity_text, default_first_day=False) if k in ['time_completion'] else timeFormat(entity.entity_text)
|
|
|
|
+ if time == "":
|
|
|
|
+ continue
|
|
if rs_dic[k] == '':
|
|
if rs_dic[k] == '':
|
|
- rs_dic[k] = entity.entity_text
|
|
|
|
- multi_project[k] = entity.entity_text
|
|
|
|
|
|
+ rs_dic[k] = time
|
|
|
|
+ multi_project[k] = time
|
|
found_key = 1
|
|
found_key = 1
|
|
elif entity.entity_type in ['location']:
|
|
elif entity.entity_type in ['location']:
|
|
for k, v in self.addr_type.items():
|
|
for k, v in self.addr_type.items():
|
|
@@ -7275,6 +7354,16 @@ class ApprovalPredictor():
|
|
multi_project[k] = iter.group('main')
|
|
multi_project[k] = iter.group('main')
|
|
found_key = 1
|
|
found_key = 1
|
|
break
|
|
break
|
|
|
|
+ for k, v in self.date_type.items():
|
|
|
|
+ for iter in re.finditer(v+':?(?P<main>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])?)', text): # 规则补充实体识别不到的日期时间
|
|
|
|
+ time = timeFormat(iter.group('main'), default_first_day=False) if k in ['time_completion'] else timeFormat(iter.group('main'))
|
|
|
|
+ if time == "":
|
|
|
|
+ continue
|
|
|
|
+ if rs_dic[k] == '':
|
|
|
|
+ rs_dic[k] = time
|
|
|
|
+ multi_project[k] = time
|
|
|
|
+ found_key = 1
|
|
|
|
+ break
|
|
if (multi_project['project_code'] != "" or multi_project['project_name'] != "") and multi_project['project_code']+multi_project['project_name'] not in code_name_set:
|
|
if (multi_project['project_code'] != "" or multi_project['project_name'] != "") and multi_project['project_code']+multi_project['project_name'] not in code_name_set:
|
|
code_name_set.add(multi_project['project_code']+multi_project['project_name'])
|
|
code_name_set.add(multi_project['project_code']+multi_project['project_name'])
|
|
district = getPredictor('district').get_area(
|
|
district = getPredictor('district').get_area(
|
|
@@ -7296,6 +7385,8 @@ class ApprovalPredictor():
|
|
rs_dic['province'] = district['district']['province']
|
|
rs_dic['province'] = district['district']['province']
|
|
rs_dic['city'] = district['district']['city']
|
|
rs_dic['city'] = district['district']['city']
|
|
rs_dic['district'] = district['district']['district']
|
|
rs_dic['district'] = district['district']['district']
|
|
|
|
+ if len(org_set) == 1 and rs_dic['approver'] == "":
|
|
|
|
+ rs_dic['approver'] == org_set.pop()
|
|
rs_dic = {k: v for k, v in rs_dic.items() if v != ''}
|
|
rs_dic = {k: v for k, v in rs_dic.items() if v != ''}
|
|
return [rs_dic]
|
|
return [rs_dic]
|
|
return []
|
|
return []
|