997842115 1 週間 前
コミット
c98f48012f
4 ファイル変更15 行追加8 行削除
  1. 0 0
      az_basic_rule
  2. 0 0
      basic_rule
  3. 0 2
      service.py
  4. 15 6
      tasks.py

ファイルの差分が大きいため隠しています
+ 0 - 0
az_basic_rule


ファイルの差分が大きいため隠しています
+ 0 - 0
basic_rule


+ 0 - 2
service.py

@@ -2271,7 +2271,6 @@ def getSingleDeXilie_yl(debh):
 
 
 def getSingleDeXilie_az(debh):
-    print(debh)
     id = None
     bz_selected = []
     bz_selected2 = []
@@ -2476,7 +2475,6 @@ def getSingleDeXilie_az(debh):
         clde.append(clde_)
         
     filtered = filtered.drop(['BH1', 'BH2', "GCLCLF", "GCLCLF1", "GCLGG", "GCLGLF", "GCLJJ", "GCLJXF", "GCLLR", "GCLRGF", "GCLRGR", "GCLSJDJ", "GCPBHJ",  "GLFFL", "LRFL", "PBBH", "PBBHM", "PBDJ", "PBSL", "THMC", "THSL", "dejb", "is_lock",  "mcxz", "qfbz",  "sptfl"], axis=1)
-    print(filtered)
     return filtered.to_json(force_ascii=False), id, rgde, jxde, clde, bz_selected.to_json(force_ascii=False) if len(bz_selected) > 0 else None, bz_selected2.to_json(force_ascii=False) if len(bz_selected2) > 0 else None
 
 

+ 15 - 6
tasks.py

@@ -30,7 +30,7 @@ azmodel = FlagModel('/mnt/d/Develop/az/az_encoder_only_base_bge-large-zh-v1.5')
 model = None # FlagModel('/mnt/d/Develop/az/az_encoder_only_base_bge-large-zh-v1.5')
 cuoshi_model = None  #FlagModel('cuoshi_encoder_only_base_bge-large-zh-v1.5/cuoshi_encoder_only_base_bge-large-zh-v1.5')
 from sentence_transformers import CrossEncoder
-azce = CrossEncoder('/mnt/d/Develop/az/models/reranker-chinese-macbert-large-gooaq-bce/final')
+azce = CrossEncoder('/mnt/d/Develop/az/models/reranker-chinese-macbert-large-gooaq-bce-3/final')
 ce = None #CrossEncoder('/mnt/d/Develop/az/models/reranker-chinese-macbert-large-gooaq-bce/final')
 cuoshi_ce = None #CrossEncoder('cuoshi_reranker/final')
 with open("hunningtu_rule", "r") as f:
@@ -398,8 +398,8 @@ def transform(answer, input, entry):
     answer2 = answer2.replace("\"", "")
     return answer2
 
-def zuhe(input, content):
-    if input in incremental and input != '17-176' and input != '17-177' and input != '17-179' and input != '17-180' and input != '17-181' and input != '15-33' and input != '1534' and input != '15-35' and input != '15-36' and input != '15-37' and input != '15-38' and input != '15-39' and input != '15-40' and input != '15-41':
+def zuhe(input, content, bianma):
+    if bianma.startswith('01') and input in incremental and input != '17-176' and input != '17-177' and input != '17-179' and input != '17-180' and input != '17-181' and input != '15-33' and input != '1534' and input != '15-35' and input != '15-36' and input != '15-37' and input != '15-38' and input != '15-39' and input != '15-40' and input != '15-41':
         option = incremental[input]
         for entry in option:
             answer = callzai(name_label[input], name_label[entry], content)
@@ -488,6 +488,13 @@ def huansuan(input, dw, label):
         return 0.1
     if dw1 == 'kg' and dw2 == '100kg':
         return 0.01
+    if dw1 == '个' and dw2 == '套':
+        return 1
+    if dw1 == '个' and dw2 == '10套':
+        return 0.1
+    if dw1 == 'm' and dw2 == '100m单线':
+        return 0.01
+
     else:
         answer = callzaidw(dw1,dw2)
         answers = answer.split("\n")
@@ -510,8 +517,10 @@ def huansuan(input, dw, label):
         answer2=answer2.replace("*", "")
         answer2=answer2.replace("x", "")
         answer2=answer2.replace("×", "")
-        print(answer2)
-        return float(answer2)
+        try:
+            return float(answer2)
+        except:
+            return 1
 
 def clarify(data):
     data['tz'] = data['tz'].replace('DTG', '')
@@ -842,7 +851,7 @@ def process_data(data:dict)-> dict:
     result = [(label_name[x], huansuan_highlevel(data['bianma'], x, data['dw'], label_name[x], data['mc']+data['tz'])) for x in selected]  
     print("after haunsuan")
     print(result)
-    result = [(zuhe(x[0], label).replace(',',''), x[1]) for x in result]  
+    result = [(zuhe(x[0], label, data['bianma']).replace(',',''), x[1]) for x in result]  
     print("after zuhe")
     print(result)
     if data['bianma'].startswith('01'):

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません