|
@@ -872,7 +872,7 @@ class PREMPredict():
|
|
elif re.search('^,?(投标报价|(资格性审查:|符合性审查:)?(不通过|不符合))', behind) and re.search('中标|成交|中选|排名|排序|名次|第[一1]名', front)==None:
|
|
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 八、中标后签约单位,合同签约单位: 241929628 1月9,承刻单位: 肃宁县超凡网络光敏印章刻印部 ,印章预留印模
|
|
|
|
|
|
+ elif re.search('(承包权人|帐户名称|债务人|推荐预审合格投标人名单):$|确定为标的的受让方,$|[主次出]入口?,?$|确定(项目|\w{,2})成交供应商,$|,承刻单位:$|乙方接受为$|丙方:$', front): # 234501112 民币元,序号:1,债务人: 东营市海宁工贸有限责任公司 ,债权本金: 262414286 八、中标后签约单位,合同签约单位: 241929628 1月9,承刻单位: 肃宁县超凡网络光敏印章刻印部 ,印章预留印模
|
|
label = 5
|
|
label = 5
|
|
elif re.search(',来源:$', front) and re.search('^,', behind): # 修复 472062585 项目采购-关于定制手机询比价采购中标公告,来源:深圳市网联安瑞网络科技有限公司 预测为中标
|
|
elif re.search(',来源:$', front) and re.search('^,', behind): # 修复 472062585 项目采购-关于定制手机询比价采购中标公告,来源:深圳市网联安瑞网络科技有限公司 预测为中标
|
|
label = 0
|
|
label = 0
|
|
@@ -985,12 +985,15 @@ class PREMPredict():
|
|
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 re.search('投资(金额|规模):$', front): # 545988699 金额不大的投资金额作为备选招标金额
|
|
|
|
+ values[label] = 0.51
|
|
|
|
+ elif entity.notes in ["投资", "总投资","工程造价"] or re.search('最低限价:?$|注册资本', front) or re.search('服务内容:([\d,.]+万?亿?元?-?)$', front):
|
|
values[label] = 0.49
|
|
values[label] = 0.49
|
|
|
|
+ label = 2
|
|
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):
|
|
|
|
- values[label] = 0.49
|
|
|
|
|
|
+ # elif re.search('(含|在|包括|[大小等高低]于|如预算金额为)$|[\d.%]+((含))?[+×*-]$', front): # 2024/10/30 注销,避免漏提 预算金额:控制在26000元以内由合作银行出资 ;投资金额不低于人民币500万元
|
|
|
|
+ # 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 re.search('报价:预估不?含税总价[为:]$', front) and (label != 1 or values[label]<0.5):
|
|
elif re.search('报价:预估不?含税总价[为:]$', front) and (label != 1 or values[label]<0.5):
|
|
@@ -1423,11 +1426,11 @@ class RoleRulePredictor():
|
|
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_51>" \
|
|
self.pattern_winTenderer_left_50 = "(?P<winTenderer_left_51>" \
|
|
- "(乙|竞得|受让|买受|签约|施工|供货|供应?|合作|承做|承包|承建|承销|承保|承接|承制|承担|承修|承租((包))?|入围|入选|竞买)(候选|投标)?(人|单位|机构|供应商|方|公司|企业|厂商|商|社会资本方?|银行)(:?单位名称|:?名称|盖章)?[::是为]+$" \
|
|
|
|
|
|
+ "(乙|竞得|受让|买受|签约|供货|供应?|合作|承做|承包|承建|承销|承保|承接|承制|承担|承修|承租((包))?|入围|入选|竞买)(候选|投标)?(人|单位|机构|供应商|方|公司|企业|厂商|商|社会资本方?|银行)(:?单位名称|:?名称|盖章)?[::是为]+$" \
|
|
"|(选定单位|指定的中介服务机构|实施主体|中标银行|中标通知书,致|征集结果|选择中介|选择结果|成交对象|勘察人|(,|审计|处置|勘察|设计)服务单位|受托[人方])[::是为]+$" \
|
|
"|(选定单位|指定的中介服务机构|实施主体|中标银行|中标通知书,致|征集结果|选择中介|选择结果|成交对象|勘察人|(,|审计|处置|勘察|设计)服务单位|受托[人方])[::是为]+$" \
|
|
"|((评审结果|名次|排名|中标结果)[::]*第?[一1]名?)[::是为]+$|成交供应商信息[,:]?(序号1)?:?|供应商名称$|竞争性选择申请人名称:$" \
|
|
"|((评审结果|名次|排名|中标结果)[::]*第?[一1]名?)[::是为]+$|成交供应商信息[,:]?(序号1)?:?|供应商名称$|竞争性选择申请人名称:$" \
|
|
"|单一来源(采购)?(供应商|供货商|服务商|方式向)$|((中标|成交)(结果|信息))[::是为]+$|(中标|成交)供应商、(中标|成交)(金额|价格),$" \
|
|
"|单一来源(采购)?(供应商|供货商|服务商|方式向)$|((中标|成交)(结果|信息))[::是为]+$|(中标|成交)供应商、(中标|成交)(金额|价格),$" \
|
|
- "|现(公布|宣布|公示)中标单位如下:$|现将中标单位(公布|公示)如下:$|现宣布以下(企业|单位|公司)中标:$|经讨论,决定采用$)" # 承办单位:不作为中标 83914772
|
|
|
|
|
|
+ "|现(公布|宣布|公示)中标单位如下:$|现将中标单位(公布|公示)如下:$|现宣布以下(企业|单位|公司)中标:$|经讨论,决定采用$)" # 承办单位:不作为中标 83914772 |施工 单位不作为中标人 例:386692187
|
|
self.pattern_winTenderer_left_60 = "(?P<winTenderer_left_60>" \
|
|
self.pattern_winTenderer_left_60 = "(?P<winTenderer_left_60>" \
|
|
"(,|。|:|^)((中标(投标)?|[拟预]中标|中选|中价|中签|成交)(人|单位|机构|中介(服务)?机构|供应商|客户|方|公司|企业|厂商|商家?|社会资本方?|银行)|(中标候选人)?第?[一1]名|第[一1](中标|中选|成交)?候选人|服务机构)" \
|
|
"(,|。|:|^)((中标(投标)?|[拟预]中标|中选|中价|中签|成交)(人|单位|机构|中介(服务)?机构|供应商|客户|方|公司|企业|厂商|商家?|社会资本方?|银行)|(中标候选人)?第?[一1]名|第[一1](中标|中选|成交)?候选人|服务机构)" \
|
|
"(:?单位名称|:?名称|盖章)?[,,]?([((]按综合排名排序[))]|:择优选取)?[::,,]$|选取(情况|说明):中选,中介机构名称:$|排名如下:1、$|第[一1]名,?投标(人|单位|银行|公司):$)" # 解决表头识别不到加逗号情况,需前面为,。空 20240621补充 中选 云南省投资审批中介超市 补充排名如下 南阳师范学院
|
|
"(:?单位名称|:?名称|盖章)?[,,]?([((]按综合排名排序[))]|:择优选取)?[::,,]$|选取(情况|说明):中选,中介机构名称:$|排名如下:1、$|第[一1]名,?投标(人|单位|银行|公司):$)" # 解决表头识别不到加逗号情况,需前面为,。空 20240621补充 中选 云南省投资审批中介超市 补充排名如下 南阳师范学院
|
|
@@ -1450,7 +1453,7 @@ class RoleRulePredictor():
|
|
self.pattern_thirdTenderer_left = "(?P<thirdTenderer_left>(第[三3]名?(名|((中标|中选|中价|成交|候选)(候选)?(人|单位|机构|供应商|公司|银行))))(名称)?[::是为]+$|((评审结果|名次|排名|排序)[::]第?[三3]名?,?(投标(供应)?商|供应商)(名称)?[::]+$))"
|
|
self.pattern_thirdTenderer_left = "(?P<thirdTenderer_left>(第[三3]名?(名|((中标|中选|中价|成交|候选)(候选)?(人|单位|机构|供应商|公司|银行))))(名称)?[::是为]+$|((评审结果|名次|排名|排序)[::]第?[三3]名?,?(投标(供应)?商|供应商)(名称)?[::]+$))"
|
|
self.pattern_thirdTenderer_right = "(?P<thirdTenderer_right>^[是为\(]第[三3](名|(中标|中选|中价|成交)(候选)?(人|单位|机构|供应商|公司|银行)))"
|
|
self.pattern_thirdTenderer_right = "(?P<thirdTenderer_right>^[是为\(]第[三3](名|(中标|中选|中价|成交)(候选)?(人|单位|机构|供应商|公司|银行)))"
|
|
|
|
|
|
- self.condadate_left = "(?P<candidate_left>(((中标|成交|入围|入选)候选|投标)(人|单位|机构|中介(服务)?机构|供应商|客户|方|公司|厂商|商家?|社会资本方?|银行)|服务单位)(:?单位名称|:?名称|全称|(?盖\w{,5}章)?|如下|:?牵头人)?[::是为]+$)"
|
|
|
|
|
|
+ self.condadate_left = "(?P<candidate_left>(((中[标选商]|成交|入围|入选)候选|投标)(人|单位|机构|中介(服务)?机构|供应商|客户|方|公司|厂商|商家?|社会资本方?|银行)|服务单位)(:?单位名称|:?名称|全称|(?盖\w{,5}章)?|如下|:?牵头人|[及与和](成交|中标)金额)?[::是为]+$)"
|
|
|
|
|
|
self.pattern_left = [
|
|
self.pattern_left = [
|
|
self.pattern_tenderee_left_60,
|
|
self.pattern_tenderee_left_60,
|
|
@@ -1479,10 +1482,12 @@ 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("代理费|服务费")
|
|
|
|
+ self.pattern_money_bank_tenderee = "存[款放](操作)?,?总?(金额|总额|规模|额度|资金)|招标的?资金总量|(项目|资金)总?(规模|额度)|现金管理的?(操作)?(额度|规模|总额)|定期存款|存款大?约|定期存储|竞争性存放|项目资金|日均存款|资金现状|存量金额|招标分配的资金量|资金总[量额]|总(规模|额度|金额)|投资金额" # 存款类招标金额
|
|
|
|
+ self.pattern_money_bank_tenderee_right = "^,?(提供定期存放服务|存[款放](期限|时间)|存期|结构性存款|期限|\w{,4}(定期存款|公款存放|资金存放))" # 存款类招标金额
|
|
self.pattern_pack = "(([^承](包|标[段号的包]|分?包|包组)编?号?|项目)[::]?[\((]?[0-9A-Za-z一二三四五六七八九十]{1,4})[^至]?|(第?[0-9A-Za-z一二三四五六七八九十]{1,4}(包号|标[段号的包]|分?包))|[0-9]个(包|标[段号的包]|分?包|包组)"
|
|
self.pattern_pack = "(([^承](包|标[段号的包]|分?包|包组)编?号?|项目)[::]?[\((]?[0-9A-Za-z一二三四五六七八九十]{1,4})[^至]?|(第?[0-9A-Za-z一二三四五六七八九十]{1,4}(包号|标[段号的包]|分?包))|[0-9]个(包|标[段号的包]|分?包|包组)"
|
|
# self.role_file = open('/data/python/lsm/role_rule_predict.txt', 'a', encoding='utf-8')
|
|
# self.role_file = open('/data/python/lsm/role_rule_predict.txt', 'a', encoding='utf-8')
|
|
|
|
|
|
@@ -1561,7 +1566,20 @@ class RoleRulePredictor():
|
|
return (_label, _prob, _flag, keyword)
|
|
return (_label, _prob, _flag, keyword)
|
|
|
|
|
|
|
|
|
|
- def predict(self, list_articles, list_sentences, list_entitys, list_codenames, channel_dic, on_value=0.5, all_winner=False):
|
|
|
|
|
|
+ def predict(self, list_articles, list_sentences, list_entitys, list_codenames, channel_dic, on_value=0.5, all_winner=False, req_scope=[], deposit_project=False):
|
|
|
|
+ '''
|
|
|
|
+
|
|
|
|
+ :param list_articles:
|
|
|
|
+ :param list_sentences:
|
|
|
|
+ :param list_entitys:
|
|
|
|
+ :param list_codenames:
|
|
|
|
+ :param channel_dic:
|
|
|
|
+ :param on_value: 最低阈值
|
|
|
|
+ :param all_winner: 是否存款、入围等公告,不分排名作为中标人
|
|
|
|
+ :param req_scope: 大纲采购内容开始结束位置[((开头句子index, 开头位置), (结束句子index, 结束句子位置)]
|
|
|
|
+ :param is_deposit_project: 是否为银行存款类项目
|
|
|
|
+ :return:
|
|
|
|
+ '''
|
|
|
|
|
|
for article, list_entity, list_sentence, list_codename in zip(list_articles, list_entitys, list_sentences,
|
|
for article, list_entity, list_sentence, list_codename in zip(list_articles, list_entitys, list_sentences,
|
|
list_codenames):
|
|
list_codenames):
|
|
@@ -1571,6 +1589,7 @@ class RoleRulePredictor():
|
|
name_entitys = [] # 2023/6/30 保存项目名称实体,直接通过位置判断角色是否在项目名称里面
|
|
name_entitys = [] # 2023/6/30 保存项目名称实体,直接通过位置判断角色是否在项目名称里面
|
|
candidates = [] # 保存不能确定为第几的候选人 2023/04/14
|
|
candidates = [] # 保存不能确定为第几的候选人 2023/04/14
|
|
notfound_tenderer = True # 未找到前三候选人
|
|
notfound_tenderer = True # 未找到前三候选人
|
|
|
|
+ deposit_moneys = [] # 保存存款类项目采购内容中大于百万的其他金额实体
|
|
for entity in list_entity:
|
|
for entity in list_entity:
|
|
if entity.entity_type == 'name':
|
|
if entity.entity_type == 'name':
|
|
list_name.append(entity.entity_text)
|
|
list_name.append(entity.entity_text)
|
|
@@ -1587,10 +1606,12 @@ class RoleRulePredictor():
|
|
find_flag = False
|
|
find_flag = False
|
|
for _sentence in list_sentence:
|
|
for _sentence in list_sentence:
|
|
if _sentence.sentence_index == p_entity.sentence_index:
|
|
if _sentence.sentence_index == p_entity.sentence_index:
|
|
- _span = spanWindow(tokens=_sentence.tokens, begin_index=p_entity.begin_index,
|
|
|
|
- end_index=p_entity.end_index, size=20, center_include=True,
|
|
|
|
- word_flag=True, use_text=True,
|
|
|
|
- text=re.sub(")", ")", re.sub("(", "(", p_entity.entity_text)))
|
|
|
|
|
|
+ # _span = spanWindow(tokens=_sentence.tokens, begin_index=p_entity.begin_index,
|
|
|
|
+ # end_index=p_entity.end_index, size=20, center_include=True,
|
|
|
|
+ # word_flag=True, use_text=True,
|
|
|
|
+ # text=re.sub(")", ")", re.sub("(", "(", p_entity.entity_text)))
|
|
|
|
+ _span = get_context(_sentence.sentence_text, p_entity.wordOffset_begin,
|
|
|
|
+ p_entity.wordOffset_end, size=20, center_include=True)
|
|
if re.search(self.pattern_tenderee_left_50, _span[0]) or re.search(self.pattern_tenderee_left_55, _span[0]): # 前面有关键词的实体不判断是否在项目名称中出现
|
|
if re.search(self.pattern_tenderee_left_50, _span[0]) or re.search(self.pattern_tenderee_left_55, _span[0]): # 前面有关键词的实体不判断是否在项目名称中出现
|
|
find_flag = True
|
|
find_flag = True
|
|
break
|
|
break
|
|
@@ -1636,9 +1657,11 @@ class RoleRulePredictor():
|
|
if str(_name).find(p_entity.entity_text) >= 0 and p_entity.sentence_index < 4:
|
|
if str(_name).find(p_entity.entity_text) >= 0 and p_entity.sentence_index < 4:
|
|
for _sentence in list_sentence:
|
|
for _sentence in list_sentence:
|
|
if _sentence.sentence_index == p_entity.sentence_index:
|
|
if _sentence.sentence_index == p_entity.sentence_index:
|
|
- _span = spanWindow(tokens=_sentence.tokens, begin_index=p_entity.begin_index,
|
|
|
|
- end_index=p_entity.end_index, size=20, center_include=True,
|
|
|
|
- word_flag=True, use_text=True, text=p_entity.entity_text)
|
|
|
|
|
|
+ # _span = spanWindow(tokens=_sentence.tokens, begin_index=p_entity.begin_index,
|
|
|
|
+ # end_index=p_entity.end_index, size=20, center_include=True,
|
|
|
|
+ # word_flag=True, use_text=True, text=p_entity.entity_text)
|
|
|
|
+ _span = get_context(_sentence.sentence_text, p_entity.wordOffset_begin,
|
|
|
|
+ p_entity.wordOffset_end, size=20, center_include=True)
|
|
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(
|
|
@@ -1798,37 +1821,74 @@ class RoleRulePredictor():
|
|
if str(p_entity.label) == "2":
|
|
if str(p_entity.label) == "2":
|
|
for _sentence in list_sentence:
|
|
for _sentence in list_sentence:
|
|
if _sentence.sentence_index == p_entity.sentence_index:
|
|
if _sentence.sentence_index == p_entity.sentence_index:
|
|
- _span = spanWindow(tokens=_sentence.tokens, begin_index=p_entity.begin_index,
|
|
|
|
- end_index=p_entity.end_index, size=10, center_include=True,
|
|
|
|
- word_flag=True, text=p_entity.entity_text)
|
|
|
|
|
|
+ # _span = spanWindow(tokens=_sentence.tokens, begin_index=p_entity.begin_index,
|
|
|
|
+ # end_index=p_entity.end_index, size=10, center_include=True,
|
|
|
|
+ # word_flag=True, text=p_entity.entity_text)
|
|
|
|
+ _span = get_context(_sentence.sentence_text, p_entity.wordOffset_begin, p_entity.wordOffset_end, size=20, center_include=True) # 20241101 修复spanWindow方法取词错误, ['金额(万元:', '27000,存', '期:3个月,四、投标人资格:1.在嘉兴']
|
|
if re.search('(含|在|包括)(\d+)?$', _span[0]):
|
|
if re.search('(含|在|包括)(\d+)?$', _span[0]):
|
|
continue
|
|
continue
|
|
- if re.search(',\w{2,}', _span[0]):
|
|
|
|
- _span[0] = _span[0].split(',')[-1] if len(_span[0].split(',')[-1])>4 else _span[0][-8:] #避免多个价格在一起造成误判
|
|
|
|
if re.search(self.pattern_money_tenderee, _span[0]) is not None and re.search(
|
|
if re.search(self.pattern_money_tenderee, _span[0]) is not None and re.search(
|
|
self.pattern_money_other, _span[0]) is None:
|
|
self.pattern_money_other, _span[0]) is None:
|
|
- p_entity.values[0] = 0.8 + p_entity.values[0] / 10
|
|
|
|
|
|
+ front_text = _span[0][re.search(self.pattern_money_tenderee, _span[0]).end():]
|
|
|
|
+ if re.search('\d[万亿]?元|元)?:?\d', front_text): # 当前金额与关键词中间有金额的过滤掉
|
|
|
|
+ break
|
|
|
|
+ p_entity.values[0] = 0.62 + p_entity.values[0] / 10
|
|
p_entity.label = 0
|
|
p_entity.label = 0
|
|
- # print('规则召回预算金额:', p_entity.entity_text, _span[0])
|
|
|
|
|
|
+ elif deposit_project:
|
|
|
|
+ if re.search(self.pattern_money_bank_tenderee,
|
|
|
|
+ _span[0]) is not None and re.search(
|
|
|
|
+ self.pattern_money_other, _span[0]) is None:
|
|
|
|
+ front_text = _span[0][re.search(self.pattern_money_bank_tenderee, _span[0]).end():]
|
|
|
|
+ if re.search('\d[万亿]?元|元)?:?\d', front_text): # 当前金额与关键词中间有金额的过滤掉
|
|
|
|
+ break
|
|
|
|
+ p_entity.values[0] = 0.6 + p_entity.values[0] / 10
|
|
|
|
+ p_entity.label = 0
|
|
|
|
+ elif re.search(self.pattern_money_bank_tenderee_right, _span[2]):
|
|
|
|
+ p_entity.values[0] = 0.55 + p_entity.values[0] / 10
|
|
|
|
+ p_entity.label = 0
|
|
|
|
+ elif (re.search('存款|总额度', _span[0]) or re.search('存[款放]|专项债资金', _span[2])):
|
|
|
|
+ front_text = _span[0][(re.search('存款|总额度', _span[0]) or re.search('存[款放]|专项债资金', _span[2])).end():]
|
|
|
|
+ if re.search('\d[万亿]?元|元)?:?\d', front_text): # 当前金额与关键词中间有金额的过滤掉
|
|
|
|
+ break
|
|
|
|
+ p_entity.values[0] = 0.55
|
|
|
|
+ p_entity.label = 0
|
|
|
|
+ # print('规则召回预算金额 4:', p_entity.entity_text, _span[0],p_entity.values[0])
|
|
if re.search(self.pattern_money_tenderer, _span[0]) is not None:
|
|
if re.search(self.pattern_money_tenderer, _span[0]) is not None:
|
|
|
|
+ front_text = _span[0][re.search(self.pattern_money_tenderer, _span[0]).end():]
|
|
|
|
+ if re.search('\d[万亿]?元|元)?:?\d', front_text): # 当前金额与关键词中间有金额的过滤掉
|
|
|
|
+ break
|
|
if re.search(self.pattern_money_other, _span[0]) is not None:
|
|
if re.search(self.pattern_money_other, _span[0]) is not None:
|
|
if re.search(self.pattern_money_tenderer, _span[0]).span()[1] > \
|
|
if re.search(self.pattern_money_tenderer, _span[0]).span()[1] > \
|
|
re.search(self.pattern_money_other, _span[0]).span()[1]:
|
|
re.search(self.pattern_money_other, _span[0]).span()[1]:
|
|
- p_entity.values[1] = 0.8 + p_entity.values[1] / 10
|
|
|
|
|
|
+ p_entity.values[1] = 0.6 + p_entity.values[1] / 10
|
|
p_entity.label = 1
|
|
p_entity.label = 1
|
|
else:
|
|
else:
|
|
- p_entity.values[1] = 0.8 + p_entity.values[1] / 10
|
|
|
|
|
|
+ p_entity.values[1] = 0.6 + p_entity.values[1] / 10
|
|
p_entity.label = 1
|
|
p_entity.label = 1
|
|
- if re.search(self.pattern_money_tenderer_whole,
|
|
|
|
- "".join(_span)) is not None and re.search(self.pattern_money_other,
|
|
|
|
- _span[0]) is None:
|
|
|
|
- p_entity.values[1] = 0.8 + p_entity.values[1] / 10
|
|
|
|
|
|
+ if re.search(self.pattern_money_tenderer_whole,"".join(_span)) and re.search(self.pattern_money_tenderer_whole, _span[0])==None \
|
|
|
|
+ and re.search(self.pattern_money_tenderer_whole, _span[2])==None and re.search(self.pattern_money_other,_span[0])==None:
|
|
|
|
+ p_entity.values[1] = 0.6 + p_entity.values[1] / 10
|
|
p_entity.label = 1
|
|
p_entity.label = 1
|
|
elif re.search('(预算金额|最高(投标)?上?限[价额]?格?|招标控制价))?:?([\d.,]+万?元[,(]其中)?(第?[一二三四五0-9](标[段|包]|[分子]包):?[\d.,]+万?元,)*第?[一二三四五0-9](标[段|包]|[分子]包):?$'
|
|
elif re.search('(预算金额|最高(投标)?上?限[价额]?格?|招标控制价))?:?([\d.,]+万?元[,(]其中)?(第?[一二三四五0-9](标[段|包]|[分子]包):?[\d.,]+万?元,)*第?[一二三四五0-9](标[段|包]|[分子]包):?$'
|
|
, _sentence.sentence_text[:p_entity.wordOffset_begin]): # 处理几个标段金额相邻情况 例子:191705231
|
|
, _sentence.sentence_text[:p_entity.wordOffset_begin]): # 处理几个标段金额相邻情况 例子:191705231
|
|
- p_entity.values[0] = 0.8 + p_entity.values[0] / 10
|
|
|
|
|
|
+ p_entity.values[0] = 0.6 + p_entity.values[0] / 10
|
|
p_entity.label = 0
|
|
p_entity.label = 0
|
|
- # print('规则召回预算金额2:', p_entity.entity_text, _sentence.sentence_text[:p_entity.wordOffset_begin])
|
|
|
|
|
|
+ if deposit_project and p_entity.label in [1,2]:
|
|
|
|
+ if req_scope and float(p_entity.entity_text)>1000000 and (p_entity.sentence_index>req_scope[0][0]\
|
|
|
|
+ or (p_entity.sentence_index==req_scope[0][0] and p_entity.wordOffset_begin>req_scope[0][1])) and (p_entity.sentence_index<req_scope[1][0]\
|
|
|
|
+ or (p_entity.sentence_index==req_scope[1][0] and p_entity.wordOffset_end<=req_scope[1][1])):
|
|
|
|
+ deposit_moneys.append(p_entity)
|
|
|
|
+
|
|
|
|
+ if deposit_moneys:
|
|
|
|
+ moneys = [float(p.entity_text) for p in deposit_moneys]
|
|
|
|
+ for p in deposit_moneys:
|
|
|
|
+ if float(p.entity_text)==max(moneys):
|
|
|
|
+ p.values[0] = 0.55
|
|
|
|
+ p.label = 0
|
|
|
|
+ else:
|
|
|
|
+ p.values[0] = 0.5
|
|
|
|
+ p.label = 0
|
|
|
|
+
|
|
if notfound_tenderer and len(set([ent.entity_text for ent in candidates])) == 1 and channel_dic['docchannel']['docchannel'] in ['中标信息', '候选人公示', '合同公告']:
|
|
if notfound_tenderer and len(set([ent.entity_text for ent in candidates])) == 1 and channel_dic['docchannel']['docchannel'] in ['中标信息', '候选人公示', '合同公告']:
|
|
for p_entity in candidates:
|
|
for p_entity in candidates:
|
|
# print('只有一个候选人的作为中标人', p_entity.entity_text)
|
|
# print('只有一个候选人的作为中标人', p_entity.entity_text)
|
|
@@ -1841,14 +1901,16 @@ class RoleRulePredictor():
|
|
for p_entity in list_entity:
|
|
for p_entity in list_entity:
|
|
for _sentence in list_sentence:
|
|
for _sentence in list_sentence:
|
|
if _sentence.sentence_index == p_entity.sentence_index:
|
|
if _sentence.sentence_index == p_entity.sentence_index:
|
|
- _span = spanWindow(tokens=_sentence.tokens, begin_index=p_entity.begin_index,
|
|
|
|
- end_index=p_entity.end_index, size=20, center_include=True, word_flag=True,
|
|
|
|
- text=p_entity.entity_text)
|
|
|
|
-
|
|
|
|
|
|
+ # _span = spanWindow(tokens=_sentence.tokens, begin_index=p_entity.begin_index,
|
|
|
|
+ # end_index=p_entity.end_index, size=20, center_include=True, word_flag=True,
|
|
|
|
+ # text=p_entity.entity_text)
|
|
|
|
+ _span = get_context(_sentence.sentence_text, p_entity.wordOffset_begin, p_entity.wordOffset_end,
|
|
|
|
+ size=30, center_include=True)
|
|
if state == 2:
|
|
if state == 2:
|
|
for _p in list_p[1:]:
|
|
for _p in list_p[1:]:
|
|
- _p.values[0] = 0.8 + _p.values[0] / 10
|
|
|
|
- _p.label = 0
|
|
|
|
|
|
+ if _p.label == 2:
|
|
|
|
+ _p.values[0] = 0.5 + _p.values[0] / 10
|
|
|
|
+ _p.label = 0
|
|
state = 0
|
|
state = 0
|
|
list_p = []
|
|
list_p = []
|
|
|
|
|
|
@@ -1873,8 +1935,9 @@ class RoleRulePredictor():
|
|
if len(list_p) > 1:
|
|
if len(list_p) > 1:
|
|
for _p in list_p[1:]:
|
|
for _p in list_p[1:]:
|
|
# print("==",_p.entity_text,_p.sentence_index,_p.label)
|
|
# print("==",_p.entity_text,_p.sentence_index,_p.label)
|
|
- _p.values[0] = 0.8 + _p.values[0] / 10
|
|
|
|
- _p.label = 0
|
|
|
|
|
|
+ if _p.label == 2:
|
|
|
|
+ _p.values[0] = 0.5 + _p.values[0] / 10
|
|
|
|
+ _p.label = 0
|
|
state = 0
|
|
state = 0
|
|
list_p = []
|
|
list_p = []
|
|
|
|
|
|
@@ -4010,7 +4073,7 @@ class DocChannel():
|
|
'土地矿产': '(土地|用地|宗地|荒地|山地|海域|矿)(出让|出租|招租|租赁|承包|流转|使用权|经营权|征收|划拨|中标|成交)|供地结果|矿业权|探矿权|采矿权|(土地|用地|宗地|地块)(使用权)?(终止|中止|网上)?(挂牌|出让|拍卖|招拍|划拨)|征收土地',
|
|
'土地矿产': '(土地|用地|宗地|荒地|山地|海域|矿)(出让|出租|招租|租赁|承包|流转|使用权|经营权|征收|划拨|中标|成交)|供地结果|矿业权|探矿权|采矿权|(土地|用地|宗地|地块)(使用权)?(终止|中止|网上)?(挂牌|出让|拍卖|招拍|划拨)|征收土地',
|
|
'拍卖出让': '(拍卖|变卖|流拍|竞拍)的?(公告|公示)|拍卖|变卖|流拍|竞拍',
|
|
'拍卖出让': '(拍卖|变卖|流拍|竞拍)的?(公告|公示)|拍卖|变卖|流拍|竞拍',
|
|
'产权交易': '经营权|承包权|使用权|租赁权|股权|债权|排污权|化学需氧量|储备量|竞价销售|销售结果|出租|招租|拍租|竞租|续租|挂牌|出让',
|
|
'产权交易': '经营权|承包权|使用权|租赁权|股权|债权|排污权|化学需氧量|储备量|竞价销售|销售结果|出租|招租|拍租|竞租|续租|挂牌|出让',
|
|
- '采招数据': '(采购|招标|询价|议价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|征询|调研)的?(公告|公示|中标|成交|结果|$)|工程招标|定点服务|竞价采购|(设备|服务)采购|网上超市采购|定点采购',
|
|
|
|
|
|
+ '采招数据': '(采购|招标|询价|议价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|征询|调研)的?(公告|公示|中标|成交|结果|$)|工程招标|定点服务|(设备|服务|\w{2})[直采]购|(建设|改造)项目|工程|拦标价|控制价',
|
|
# |竞价 采招/产权都有竞价方式 # 意向|需求|预公?告|报建|总承包|工程|施工|设计|勘察|代理|监理 |变更|答疑|澄清|中标|成交|合同|废标|流标
|
|
# |竞价 采招/产权都有竞价方式 # 意向|需求|预公?告|报建|总承包|工程|施工|设计|勘察|代理|监理 |变更|答疑|澄清|中标|成交|合同|废标|流标
|
|
'新闻资讯': '(考试|面试|笔试)成绩|成绩的?(公告|公示|公布)|公开招聘|招聘(公告|简章|启事|合同制)|疫情防控\s{,5}(通知|情况|提示)|行政审批结果'
|
|
'新闻资讯': '(考试|面试|笔试)成绩|成绩的?(公告|公示|公布)|公开招聘|招聘(公告|简章|启事|合同制)|疫情防控\s{,5}(通知|情况|提示)|行政审批结果'
|
|
}
|
|
}
|
|
@@ -4018,7 +4081,7 @@ class DocChannel():
|
|
'采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示',
|
|
'采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示',
|
|
'采购意向neg': '发布政府采购意向|采购意向公告已于',
|
|
'采购意向neg': '发布政府采购意向|采购意向公告已于',
|
|
'招标预告': '(预计|计划)(采购|招标)(时间|日期)|采购(计划编号|需求方案|预告|预案)|(预|需求)公示|需求(方案|信息|论证|公告|公示)',
|
|
'招标预告': '(预计|计划)(采购|招标)(时间|日期)|采购(计划编号|需求方案|预告|预案)|(预|需求)公示|需求(方案|信息|论证|公告|公示)',
|
|
- '招标公告': '(采购|招标|竞选|报名)条件|报名(时间|流程|方法|要求|\w{,5}材料)[:\s]|[^\w]成交规则|参加竞价采购交易资格|(申请人|投标人|供应商|报价人|参选人)的?资格要求|获取(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件的?(获取|领取)|评选方式:?\s*价格最低',
|
|
|
|
|
|
+ '招标公告': '(采购|招标|竞选|报名)条件|报名(时间|流程|方法|要求|\w{,5}材料)[:\s]|[^\w]成交规则|参加竞价采购交易资格|(申请人|投标人|供应商|报价人|参选人)的?资格(要求|条件)|获取(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答)文件的?(获取|领取)|评选方式:?\s*价格最低',
|
|
'资审结果': '资审及业绩公示|资审结果及业绩|资格后审情况报告|资格(后审|预审|审查)结果(公告|公示)|(预审|审查)工作已经?结束|未通过原因', #|资格
|
|
'资审结果': '资审及业绩公示|资审结果及业绩|资格后审情况报告|资格(后审|预审|审查)结果(公告|公示)|(预审|审查)工作已经?结束|未通过原因', #|资格
|
|
'招标答疑': '现澄清(为|如下)|答疑补遗|澄清内容如下|第[0-9一二三四五]次澄清|答疑澄清|(最高(投标)?限价|控制价|拦标价)公示', # |异议的回复
|
|
'招标答疑': '现澄清(为|如下)|答疑补遗|澄清内容如下|第[0-9一二三四五]次澄清|答疑澄清|(最高(投标)?限价|控制价|拦标价)公示', # |异议的回复
|
|
'公告变更': '第[\d一二]次变更|(更正|变更)(公告|公示|信息|内容|事项|原因|理由|日期|时间|如下)|原公告((主要)?(信息|内容)|发布时间)|(变更|更正)[前后]内容|现?在?(变更|更正|修改|更改)(内容)?为|(公告|如下|信息|内容|事项|结果|文件|发布|时间|日期)(更正|变更)',
|
|
'公告变更': '第[\d一二]次变更|(更正|变更)(公告|公示|信息|内容|事项|原因|理由|日期|时间|如下)|原公告((主要)?(信息|内容)|发布时间)|(变更|更正)[前后]内容|现?在?(变更|更正|修改|更改)(内容)?为|(公告|如下|信息|内容|事项|结果|文件|发布|时间|日期)(更正|变更)',
|
|
@@ -4032,8 +4095,8 @@ class DocChannel():
|
|
# |确定成交供应商[:,\s]
|
|
# |确定成交供应商[:,\s]
|
|
'合同公告': '合同(公告|公示|信息|内容)|合同(编号|名称|主体|基本情况|完成(日期|时间))|(供应商乙方|乙方供应商):|合同总?金额|履约信息',
|
|
'合同公告': '合同(公告|公示|信息|内容)|合同(编号|名称|主体|基本情况|完成(日期|时间))|(供应商乙方|乙方供应商):|合同总?金额|履约信息',
|
|
'废标公告': '(终止|中止|废标|流标|流采|失败|作废|异常|撤销)(结果)?(公告|公示|招标|采购|竞价)|(谈判结果为|结果类型):?废标|((本|该)(项目|标段|合同|合同包|采购包|次)\w{,5})((失败|终止|流标|废标)|予以废标|(按|做|作)?(流标|废标|废置)处理)|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答|项目)(终止|中止|废标|流标|失败|作废|异常|撤销)',
|
|
'废标公告': '(终止|中止|废标|流标|流采|失败|作废|异常|撤销)(结果)?(公告|公示|招标|采购|竞价)|(谈判结果为|结果类型):?废标|((本|该)(项目|标段|合同|合同包|采购包|次)\w{,5})((失败|终止|流标|废标)|予以废标|(按|做|作)?(流标|废标|废置)处理)|(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|竞谈|应答|项目)(终止|中止|废标|流标|失败|作废|异常|撤销)',
|
|
- '废标公告2': '(无效|中止|终止|废标|流标|失败|作废|异常|撤销)的?(原因|理由)|本项目因故取消|本(项目|次)(公开)?\w{2}失败|已终止\s*原因:|(人|人数|供应商|单位)(不足|未达\w{,3}数量)|已终止|不足[3三]家|无(废标)|成交情况:\s*[流废]标|现予以废置',
|
|
|
|
- '废标公告neg': '超过此报价将作为[废流]标处理|否则按[废流]标处理|终止规则:|成交规则:|视为流标|竞价失败的一切其他情形|是否废标:否|若不足三家公司参与|供应商数量:?\s*报名供应商不足三家|有效报价不足三家,\s*系统自动废标' # 503076535 供应商数量: 报名供应商不足三家。
|
|
|
|
|
|
+ '废标公告2': '(无效|中止|终止|废标|流标|失败|作废|异常|撤销)的?(原因|理由)|本项目因故取消|本(项目|次)(公开)?\w{2}失败|已终止\s*原因:|(人|人数|供应商|单位)(不足|未达\w{,3}数量)|已终止|不足[3三]家|无(废标)|成交情况:\s*[流废]标|现予以废置|报名未够三家',
|
|
|
|
+ '废标公告neg': '超过此报价将作为[废流]标处理|否则按[废流]标处理|终止规则:|成交规则:|视为流标|竞价失败的一切其他情形|是否废标:否|若不足三家公司参与|供应商数量:?\s*报名供应商不足三家|有效报价不足三家,\s*系统自动废标|如遇项目流[标采]' # 503076535 供应商数量: 报名供应商不足三家。
|
|
}
|
|
}
|
|
self.title_life_dic = {
|
|
self.title_life_dic = {
|
|
'采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示|意向公开',
|
|
'采购意向': '采购意向|招标意向|选取意向|意向公告|意向公示|意向公开',
|
|
@@ -4043,11 +4106,11 @@ class DocChannel():
|
|
'废标公告': '(终止|中止|废标|废除|废置|流标|失败|作废|异常|撤销|撤回|取消成?交?|流拍|停止)(结果|竞价|项目)?的?(公告|公示|$)|(终止|中止)(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|拍卖|招租|交易|出让)|关于废置',
|
|
'废标公告': '(终止|中止|废标|废除|废置|流标|失败|作废|异常|撤销|撤回|取消成?交?|流拍|停止)(结果|竞价|项目)?的?(公告|公示|$)|(终止|中止)(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|拍卖|招租|交易|出让)|关于废置',
|
|
'合同公告': '(合同(成交|变更)?)(公告|公示|信息|公式|公开|签订)|合同备案|合同书|合同$', # |(履约|验收)(结果)?
|
|
'合同公告': '(合同(成交|变更)?)(公告|公示|信息|公式|公开|签订)|合同备案|合同书|合同$', # |(履约|验收)(结果)?
|
|
'候选人公示': '候选人(变更)?公示|评标(结果)?(公[告示]|报告)|评审结果', #中标前公示|中标预公示|
|
|
'候选人公示': '候选人(变更)?公示|评标(结果)?(公[告示]|报告)|评审结果', #中标前公示|中标预公示|
|
|
- '中标信息': '(中标|中选|中价|中租|成交|入选|确认)(候选人|人|供应商|记录|结果|变更)?(公告|公示|结果)|未?入围(公示|公告)|(遴选|采购|招标|竞价|议价|比选|询比?价|评选|谈判|邀标|邀请|洽谈|约谈|评标|发包|遴选|交易)\w{,2}结果|单一来源(采购|招标)?的?(中标|成交|结果)|中标通知书|中标$|项目中标', # |开标(记录|信息|情况)
|
|
|
|
|
|
+ '中标信息': '(中标|中选|中价|中租|成交)?|入选|确认)(候选人|人|供应商|记录|结果|变更|情况)?的?(公告|公示|结果)|未?入围(公示|公告)|(遴选|采购|招标|竞价|议价|比选|询比?价|评选|谈判|邀标|邀请|洽谈|约谈|评标|发包|磋商|交易|出让|抽取|抽签)\w{,2}结果|单一来源(采购|招标)?的?(中标|成交|结果)|中标通知书|中标$|项目中标|(项目|工程|服务|定点)的?结果公[告示]|超市直购订单', # |开标(记录|信息|情况)
|
|
'资审结果': '((资格|资质)(审查|预审|后审|审核)|资审)结果(公告|公示)?|(资质|资格)(预审|后审)公示|资审及业绩公示',
|
|
'资审结果': '((资格|资质)(审查|预审|后审|审核)|资审)结果(公告|公示)?|(资质|资格)(预审|后审)公示|资审及业绩公示',
|
|
'招标公告': '(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|拍卖|招租|交易|出让)的?(公告|公示|$)|公开(采购|招标|招租|拍卖|挂牌|出让)|(资审|预审|后审)公告',
|
|
'招标公告': '(采购|招标|询价|议价|竞价|比价|比选|遴选|邀请|邀标|磋商|洽谈|约谈|谈判|拍卖|招租|交易|出让)的?(公告|公示|$)|公开(采购|招标|招租|拍卖|挂牌|出让)|(资审|预审|后审)公告',
|
|
'开标记录': '开标记录|截标信息|评委名单公示|开标安排|开标数据表|开标信息|开标情况|开标一览表|开标结果|开标会',
|
|
'开标记录': '开标记录|截标信息|评委名单公示|开标安排|开标数据表|开标信息|开标情况|开标一览表|开标结果|开标会',
|
|
- '验收合同': '(验收|履约)(公告|公示)|(验收|履约)(结果|报告|意见|单)(公告|公示)'
|
|
|
|
|
|
+ '验收合同': '(验收|履约)(公告|公示)|(验收|履约)(结果|报告|意见|单)(公告|公示)|预留项目执行情况'
|
|
}
|
|
}
|
|
|
|
|
|
def load_life(self,life_model,config):
|
|
def load_life(self,life_model,config):
|
|
@@ -4565,6 +4628,9 @@ class DocChannel():
|
|
|
|
|
|
text = html2text(html)
|
|
text = html2text(html)
|
|
|
|
|
|
|
|
+ self.title = title
|
|
|
|
+ self.text = text
|
|
|
|
+
|
|
result = {'docchannel': {'docchannel': '', 'doctype': ''}}
|
|
result = {'docchannel': {'docchannel': '', 'doctype': ''}}
|
|
|
|
|
|
doc_type, type_kw = get_type(title, text)
|
|
doc_type, type_kw = get_type(title, text)
|
|
@@ -4602,7 +4668,7 @@ class DocChannel():
|
|
# print('channel ', msc)
|
|
# print('channel ', msc)
|
|
return result, msc
|
|
return result, msc
|
|
|
|
|
|
- def final_change(self, result, prem, title, text, original_docchannel, msc):
|
|
|
|
|
|
+ def final_change(self, result, prem, original_docchannel, msc):
|
|
'''
|
|
'''
|
|
|
|
|
|
:param result: channel 结果字典
|
|
:param result: channel 结果字典
|
|
@@ -4635,6 +4701,8 @@ class DocChannel():
|
|
return False
|
|
return False
|
|
|
|
|
|
origin_dic = self.origin_dic
|
|
origin_dic = self.origin_dic
|
|
|
|
+ title = self.title
|
|
|
|
+ text = self.text
|
|
prem_json = json.dumps(prem, ensure_ascii=False)
|
|
prem_json = json.dumps(prem, ensure_ascii=False)
|
|
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(
|
|
original_docchannel, '') in ['招标公告', '采购意向', '招标预告', '公告变更'] and is_contain_winner(
|
|
@@ -4650,8 +4718,8 @@ class DocChannel():
|
|
original_docchannel, '') in ['招标公告', '采购意向', '招标预告']:
|
|
original_docchannel, '') in ['招标公告', '采购意向', '招标预告']:
|
|
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 origin_dic.get(
|
|
|
|
- original_docchannel, '') == '中标信息':
|
|
|
|
|
|
+ elif result['docchannel']['docchannel'] == '招标公告' and is_contain_winner(prem_json) and (origin_dic.get(
|
|
|
|
+ original_docchannel, '') == '中标信息' or re.search('直接采购', title)): # 20241025补充 标题包含直接采购且有中标人的为中标公告
|
|
result['docchannel']['docchannel'] = '中标信息'
|
|
result['docchannel']['docchannel'] = '中标信息'
|
|
msc += '最终规则修改:预测为招标公告却有中标人且原始为中标改为中标信息;'
|
|
msc += '最终规则修改:预测为招标公告却有中标人且原始为中标改为中标信息;'
|
|
elif result['docchannel']['docchannel'] in ['招标公告'] and origin_dic.get(
|
|
elif result['docchannel']['docchannel'] in ['招标公告'] and origin_dic.get(
|
|
@@ -6028,11 +6096,12 @@ class DistrictPredictor():
|
|
return province_l, city_l, district_l
|
|
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) # 544151395 赤壁市老城区燃气管道老化更新改造
|
|
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)
|
|
|
|
+ text = re.sub('横州市', '横县', text) # 例:547363890 修复广西南宁横州 不在地区表问题
|
|
ser = re.search('海南(昌江|白沙|乐东|陵水|保亭|琼中)(黎族)?', text)
|
|
ser = re.search('海南(昌江|白沙|乐东|陵水|保亭|琼中)(黎族)?', text)
|
|
if ser and '黎族' not in ser.group(0):
|
|
if ser and '黎族' not in ser.group(0):
|
|
text = text.replace(ser.group(0), ser.group(0)+'黎族')
|
|
text = text.replace(ser.group(0), ser.group(0)+'黎族')
|