Przeglądaj źródła

fix all_num bug

yan chuanli 2 lat temu
rodzic
commit
b1a070a1d2
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      YQ_OCR/to_md/convert_MD.py

+ 3 - 2
YQ_OCR/to_md/convert_MD.py

@@ -88,9 +88,10 @@ def evaluate_one(xlsx_dict, res_dict):
             table_result.extend(['无key值', key_no_xlsx, sort_NoKey[0][1], '❌'])
 
     # 算正确率
-    rate = true_num / (len(table_result) / 4)
+    all_num = len(table_result) // 4 - 1
+    rate = true_num / all_num
     all_rate.append(rate)
-    statistics = f'共{len(table_result) // 4}个字段,正确{true_num}个,错误{len(table_result) // 4 - true_num}个'
+    statistics = f'共{all_num}个字段,正确{true_num}个,错误{all_num - true_num}个'
     return "{:.2f}%".format(rate * 100), statistics