MikeMai commited on
Commit
73fb567
·
verified ·
1 Parent(s): 57bac76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -677,7 +677,7 @@ def extract_price_list(price_list, save_json=False, json_name="price_list.json")
677
  # 名称 mappings
678
  "名称": ["名称 name", "名称name", "name", "名称name of materials", "名称name of materials and equipment", "名称 name of materials", "名称 name of materials and equipment", "名称", "产品名称 product name"],
679
  # 名称(英文) mappings
680
- "名称(英文)": ["名称 name", "名称name", "name", "名称name of materials", "名称name of materials and equipment", "名称 name of materials", "名称 name of materials and equipment", "单价(欧元) unit price(eur)", "名称", "产品名称 product name", "单价(元)unit price(cny)"],
681
  # 品牌 mappings
682
  "品牌": ["品牌 brand", "品牌brand", "brand", "品牌 brand", "品牌brand", "品牌"],
683
  # 规格型号 mappings
@@ -691,13 +691,13 @@ def extract_price_list(price_list, save_json=False, json_name="price_list.json")
691
  "单位": ["单位 unit", "单位unit", "unit", "单位"],
692
  # 单价 mappings
693
  "单价": ["单价 unit price (cny)", "单价unit price (cny)", "unit price (cny)", "单价unit price", "单价 unit price",
694
- "单价(元)", "单价(cny)", "单价 unit price (cny)", "单价(欧元) unit price(eur)", "单价", "单价(元) unit price(cny)", "单价(元)unit price(cny)"],
695
  # 总价 mappings
696
  "总价": ["总价 total amount (cny)", "总价total amount (cny)", "total amount (cny)", "总价total amount", "总价 total amount",
697
  "总价(元)", "总额(元)", "总价 total amount (cny)", "总价(欧元) amount(eur)", "总价", "总价(元)amount (cny)", "总价(元)amount(cny)"],
698
  # 几郎单价 mappings
699
  "几郎单价": ["几郎单价 unit price (gnf)", "几郎单价unit price (gnf)", "unit price (gnf)", "几郎单价unit price", "几郎单价 unit price",
700
- "几郎单价(元)", "单价(几郎)", "几郎单价 unit price (gnf)", "几郎单价", "单价 unit price(几郎)(gnf)", "单价(元)unit price(cny)"],
701
  # 几郎总价 mappings
702
  "几郎总价": ["几郎总价 total amount (gnf)", "几郎总价total amount (gnf)", "total amount (gnf)", "几郎总价total amount", "几郎总价 total amount",
703
  "几郎总价(元)", "总额(几郎)", "几郎总价 total amount (gnf)", "几郎总价", "总额 total amount(几郎)(gnf)", "总价(元)amount(cny)", "几郎总价 amount(gnf)"],
@@ -766,13 +766,8 @@ Return only a JSON mapping in this format WITHOUT any explanations:
766
  ...
767
  }}
768
  ```
769
-
770
- Important: Map "名称" AND "名称(英文)" to the SAME extracted header.
771
- For example, if the extracted header is "名称Name of Materials and Equipment", then:
772
- {{
773
- "名称": "名称Name of Materials and Equipment",
774
- "名称(英文)": "名称Name of Materials and Equipment"
775
- }}
776
  """
777
 
778
  messages = [{"role": "user", "content": base_prompt}]
@@ -1121,4 +1116,7 @@ interface = gr.Interface(
1121
  theme=Base()
1122
  )
1123
 
1124
- interface.launch(show_error=True)
 
 
 
 
677
  # 名称 mappings
678
  "名称": ["名称 name", "名称name", "name", "名称name of materials", "名称name of materials and equipment", "名称 name of materials", "名称 name of materials and equipment", "名称", "产品名称 product name"],
679
  # 名称(英文) mappings
680
+ "名称(英文)": ["名称 name", "名称name", "name", "名称name of materials", "名称name of materials and equipment", "名称 name of materials", "名称 name of materials and equipment", "名称", "产品名称 product name"],
681
  # 品牌 mappings
682
  "品牌": ["品牌 brand", "品牌brand", "brand", "品牌 brand", "品牌brand", "品牌"],
683
  # 规格型号 mappings
 
691
  "单位": ["单位 unit", "单位unit", "unit", "单位"],
692
  # 单价 mappings
693
  "单价": ["单价 unit price (cny)", "单价unit price (cny)", "unit price (cny)", "单价unit price", "单价 unit price",
694
+ "单价(元)", "单价(cny)", "单价 unit price (cny)", "单价(欧元) unit price(eur)", "单价", "单价(元) unit price(cny)", "单价(元)unit price(cny)", "单价(欧元) unit price(eur)"],
695
  # 总价 mappings
696
  "总价": ["总价 total amount (cny)", "总价total amount (cny)", "total amount (cny)", "总价total amount", "总价 total amount",
697
  "总价(元)", "总额(元)", "总价 total amount (cny)", "总价(欧元) amount(eur)", "总价", "总价(元)amount (cny)", "总价(元)amount(cny)"],
698
  # 几郎单价 mappings
699
  "几郎单价": ["几郎单价 unit price (gnf)", "几郎单价unit price (gnf)", "unit price (gnf)", "几郎单价unit price", "几郎单价 unit price",
700
+ "几郎单价(元)", "单价(几郎)", "几郎单价 unit price (gnf)", "几郎单价", "单价 unit price(几郎)(gnf)", "单价(元)unit price(cny)", "几郎单价 unit price(gnf)"],
701
  # 几郎总价 mappings
702
  "几郎总价": ["几郎总价 total amount (gnf)", "几郎总价total amount (gnf)", "total amount (gnf)", "几郎总价total amount", "几郎总价 total amount",
703
  "几郎总价(元)", "总额(几郎)", "几郎总价 total amount (gnf)", "几郎总价", "总额 total amount(几郎)(gnf)", "总价(元)amount(cny)", "几郎总价 amount(gnf)"],
 
766
  ...
767
  }}
768
  ```
769
+ Common mistakes to note:
770
+ Do not force map 名称(英文) to 单价
 
 
 
 
 
771
  """
772
 
773
  messages = [{"role": "user", "content": base_prompt}]
 
1116
  theme=Base()
1117
  )
1118
 
1119
+ interface.launch(show_error=True)
1120
+
1121
+
1122
+