|
@@ -950,7 +950,7 @@ class PREMPredict():
|
|
|
elif re.search('^为\w{,10}第二(成交|中标)单位', behind): # 中标预测错误,例:601143888 河南省创慧新材料科技有限公司为铸咀采购项目第二成交单位
|
|
|
label = 3
|
|
|
values[3] = 0.5
|
|
|
- elif re.search('中标单位,$|被确定为$|成交电商:$|如果?我方成功中选$', front): # 632523961 现通知:贵司被确定为广州地铁传媒有限公司贵阳地铁广告媒体服务项目(2025年)的执行单位。 # 609280615 万银政采平台 罗山县政采平台等成交电商都不是中标人 632380222 如我方成功中选 中国人民保险 采购项目,
|
|
|
+ elif re.search('中标单位,$|被确定为$|如果?我方成功中选$', front): # 632523961 现通知:贵司被确定为广州地铁传媒有限公司贵阳地铁广告媒体服务项目(2025年)的执行单位。 632380222 如我方成功中选 中国人民保险 采购项目,
|
|
|
label = 5
|
|
|
elif re.search('^为预备中标单位', behind):
|
|
|
label = 3
|
|
@@ -2504,6 +2504,8 @@ class RoleGrade():
|
|
|
_prob -= 0.05
|
|
|
if _label == 0 and is_agency(entity.entity_text): # 20250116 修复 584333688 同时有招标单位 : 安徽省招标集团股份有限公司,.采购人信息 名 称:安徽开放大学
|
|
|
_prob -= 0.1
|
|
|
+ if re.search('成交电商:$', text[:b]): # 609280615 万银政采平台 罗山县政采平台等成交电商都不是中标人
|
|
|
+ _prob = 0.55
|
|
|
entity.values[_label] = _prob + entity.values[_label] / 20
|
|
|
not_found = 0
|
|
|
# print('规则修改角色概率后:', entity.entity_text, entity.label, entity.values)
|
|
@@ -2607,7 +2609,7 @@ class MoneyGrade():
|
|
|
_prob = max(0.5, _prob - 0.2)
|
|
|
entity.values[_label] = _prob + entity.values[_label] / 20
|
|
|
not_found = 0
|
|
|
- if _label == 0 and float(entity.entity_text)<10000 and entity.values[_label] > 0.6: # 20250624 小金额预算概率降低 634252534 包合计才是真正的预算
|
|
|
+ if _label == 0 and float(entity.entity_text)<100 and entity.values[_label] > 0.6: # 20250624 小金额预算概率降低 634252534 包合计才是真正的预算
|
|
|
entity.values[_label] = 0.6
|
|
|
# print('规则修改金额概率后:', entity.entity_text, entity.label, entity.values)
|
|
|
break
|
|
@@ -3486,7 +3488,7 @@ class ProductAttributesPredictor():
|
|
|
while i < (len(inner_table)):
|
|
|
tds = inner_table[i]
|
|
|
not_empty = [it for it in tds if re.sub('\s', '', it) != ""]
|
|
|
- if len(set(not_empty))<2 or len(set(tds))<2 or (len(set(tds))==2 and re.search('总计|合计|汇总', tds[0])): # 非空列或者不重复内容小于两列的 继续
|
|
|
+ if len(set(not_empty))<2 or len(set(tds))<2 or (len(set(tds))==2 and re.search('总计|合计|汇总|总价', tds[0])): # 非空列或者不重复内容小于两列的 继续 281415580 合同总价
|
|
|
i += 1
|
|
|
# print('表格产品提取:非空列或者不重复内容小于两列的 继续', i, tds)
|
|
|
continue
|
|
@@ -3566,15 +3568,14 @@ class ProductAttributesPredictor():
|
|
|
|
|
|
if id1!="" and re.search('[a-zA-Z\u4e00-\u9fa5]', tds[id1]) and tds[id1] not in self.header_set and \
|
|
|
re.search('备注|汇总|合计|总价|价格|金额|^详见|无$|xxx', tds[id1]) == None:
|
|
|
- product = tds[id1]
|
|
|
+ product = re.sub('\s+', '', tds[id1]) # 去掉空格,避免格式问题无法去重 例 267610200
|
|
|
|
|
|
if id0!="" and re.search('[a-zA-Z\u4e00-\u9fa5]', tds[id0]) and tds[id0] not in self.header_set and \
|
|
|
re.search('备注|汇总|合计|总价|价格|金额|^详见|无$|xxx', tds[id0]) == None:
|
|
|
- category = tds[id0]
|
|
|
+ category = re.sub('\s', '', tds[id0])
|
|
|
product = "%s_%s"%(category, product) if product!="" and product!=category else category
|
|
|
|
|
|
if product != "" and product not in ['工程类', '服务类', '货物类', '工程', '服务', '货物']:
|
|
|
- # print('匹配产品内容: ', product)
|
|
|
if id2 != "":
|
|
|
if re.search('\d+|[壹贰叁肆伍陆柒捌玖拾一二三四五六七八九十]', tds[id2]):
|
|
|
# if re.search('(^\d{,3}(,?\d{3}){2,}(\.\d{2,7},?)$)|万?元', tds[id2]): # 254816100 这篇数量很大,貌似正常
|
|
@@ -3683,8 +3684,6 @@ class ProductAttributesPredictor():
|
|
|
unitPrice = str(unitPrice) if unitPrice != 0 and unitPrice<100000000 else ""
|
|
|
if budget != "":
|
|
|
budget, _money_unit = money_process(budget, header_list2[2])
|
|
|
- if budget > 0:
|
|
|
- budget_list.append(budget)
|
|
|
budget = str(budget) if budget != 0 and budget<50000000000 else ''
|
|
|
if total_price != "":
|
|
|
total_price, _money_unit = money_process(total_price, header_list[6])
|
|
@@ -3708,6 +3707,8 @@ class ProductAttributesPredictor():
|
|
|
if (product, specs, unitPrice, quantity) not in product_set:
|
|
|
product_set.add((product, specs, unitPrice, quantity))
|
|
|
product_link.append(link)
|
|
|
+ if budget != '' and float(budget) > 0:
|
|
|
+ budget_list.append(float(budget))
|
|
|
if link['unitPrice'] != "" and link['quantity'] != '':
|
|
|
try:
|
|
|
total_product_money += float(link['unitPrice']) * float(
|
|
@@ -3729,8 +3730,6 @@ class ProductAttributesPredictor():
|
|
|
unitPrice = str(unitPrice) if unitPrice != 0 and unitPrice<100000000 else ""
|
|
|
if budget != "":
|
|
|
budget, _money_unit = money_process(budget, header_list2[2])
|
|
|
- if budget > 0:
|
|
|
- budget_list.append(budget)
|
|
|
budget = str(budget) if budget != 0 and budget<50000000000 else ''
|
|
|
if total_price != "":
|
|
|
total_price, _money_unit = money_process(total_price, header_list[6])
|
|
@@ -3754,6 +3753,8 @@ class ProductAttributesPredictor():
|
|
|
if (product, unitPrice,) not in product_set: # 2023/09/22 改为只判断产品/单价,只要两个一样就不作为新产品 避免多个表格重复表达有些没数量造成重复提取 353858683
|
|
|
product_set.add((product, unitPrice))
|
|
|
product_link.append(link)
|
|
|
+ if budget != '' and float(budget) > 0:
|
|
|
+ budget_list.append(float(budget))
|
|
|
if link['unitPrice']:
|
|
|
unit_price_list.append(link['unitPrice'])
|
|
|
if link['unitPrice'] != "" and link['quantity'] != '':
|