Browse Source

表格预算提取修复

znj 11 months ago
parent
commit
ccfbe2a1a1
1 changed files with 6 additions and 4 deletions
  1. 6 4
      BiddingKG/dl/interface/predictor.py

+ 6 - 4
BiddingKG/dl/interface/predictor.py

@@ -3157,7 +3157,9 @@ class ProductAttributesPredictor():
                                 _budget = re_price[0]
                                 if '万元' in col0_l[i] and '万' not in _budget:
                                     _budget += '万元'
-                                budget = str(getUnifyMoney(_budget))
+                                budget = str(getUnifyMoney(_budget)).rstrip('0').rstrip('.')
+                                if float(budget)>= 500*100000000:
+                                    budget = ""
                         elif re.search('预算单位|(采购|招标|购买)(单位|人|方|主体)|项目业主|采购商|申购单位|需求单位|业主单位', col0_l[i]):
                             header_list2.append(col0_l[i])
                             tenderee = re.sub("\s","",col1_l[i])
@@ -3180,7 +3182,7 @@ class ProductAttributesPredictor():
                         if order_begin_year>=2050 or order_end_year>=2050:
                             order_begin = order_end = ""
                     # print(product,demand,budget,order_begin)
-                    if product!= "" and demand != "" and budget!="" and order_begin != "" and len(budget)<15: # 限制金额小于15位数的才要
+                    if product!= "" and demand != "" and budget!="" and order_begin != "":
                         link = {'project_name': product, 'product': [], 'demand': demand, 'budget': budget,
                                 'order_begin': order_begin, 'order_end': order_end ,'tenderee':tenderee, 'notes':notes, 'issue_date':issue_date}
                         if link not in demand_link:
@@ -3702,7 +3704,7 @@ class ProductAttributesPredictor():
                                             unitPrice = getUnifyMoney(_unitPrice)
                                             if unitPrice>=10000*10000:
                                                 unitPrice = ""
-                                            unitPrice = str(unitPrice)
+                                            unitPrice = str(unitPrice).rstrip('0').rstrip('.')
                                 if id4 != "":
                                     if re.search('\w', deal_list[id4]):
                                         brand = deal_list[id4]
@@ -3730,7 +3732,7 @@ class ProductAttributesPredictor():
                                             _budget = re_price[0]
                                             if '万元' in header_list2[2] and '万' not in _budget:
                                                 _budget += '万元'
-                                            budget = str(getUnifyMoney(_budget))
+                                            budget = str(getUnifyMoney(_budget)).rstrip('0').rstrip('.')
                                             if float(budget)>= 100000*10000:
                                                 budget = ""
                                 if id8 != "":