1
0

3 Commits db2f73aa2e ... 10dad08fb0

Autor SHA1 Nachricht Datum
  zhch158_admin 10dad08fb0 fix(ocr_validator_utils): 更新 MinerU 版本显示名称 vor 6 Tagen
  zhch158_admin 6d0491be49 fix(glmocr_vl_adapter): 更新模型参数以提高识别性能,调整最大令牌数、温度、top_p 和 top_k 值 vor 6 Tagen
  zhch158_admin 4715244ada fix(compare_ocr_results): 更新测试文件路径和输出目录以反映新的数据结构 vor 6 Tagen

+ 3 - 3
ocr_comparator/compare_ocr_results.py

@@ -90,9 +90,9 @@ if __name__ == "__main__":
         # 测试流水表格对比
         import time
         result = compare_ocr_results(
-            file1_path='/Users/zhch158/workspace/data/流水分析/B用户_扫描流水/dotsocr_vllm_results_cell_bbox/B用户_扫描流水_page_008.md',
-            file2_path='/Users/zhch158/workspace/data/流水分析/B用户_扫描流水/mineru_vllm_results/B用户_扫描流水_page_008.md',
-            output_file=f'/Users/zhch158/workspace/repository.git/ocr_verify/output/flow_list_comparison_{time.strftime("%Y%m%d_%H%M%S")}',
+            file1_path='/Users/zhch158/workspace/data/流水分析/B用户_扫描流水/bank_statement_yusys_v4/B用户_扫描流水_page_001.md',
+            file2_path='/Users/zhch158/workspace/data/流水分析/B用户_扫描流水/bank_statement_yusys_v3/B用户_扫描流水_page_001.md',
+            output_file=f'/Users/zhch158/workspace/data/流水分析/B用户_扫描流水/logs/flow_list_comparison_{time.strftime("%Y%m%d_%H%M%S")}',
             output_format='both',
             ignore_images=True,
             table_mode='flow_list',  # 使用流水表格模式

+ 3 - 3
ocr_comparator/content_extractor.py

@@ -61,14 +61,14 @@ class ContentExtractor:
                 ]
             }
         """
-        # 查找所有表格的位置
-        table_pattern = r'<table>.*?</table>'
+        # 匹配一个可能带任意属性的 <table ...> 到对应的 </table> 区间
+        table_pattern = r'<table\b[^>]*>.*?</table>'
         tables = []
         paragraph_blocks = []
         
         last_pos = 0
         
-        for match in re.finditer(table_pattern, content, re.DOTALL):
+        for match in re.finditer(table_pattern, content, re.DOTALL | re.IGNORECASE):
             start_pos = match.start()
             end_pos = match.end()
             

+ 4 - 4
ocr_tools/universal_doc_parser/config/bank_statement_glm_vl.yaml

@@ -70,10 +70,10 @@ vl_recognition:
     retry_backoff_max_seconds: 8.0
     retry_jitter_ratio: 0.2
     retry_status_codes: [429, 500, 502, 503, 504]
-    max_tokens: 4096
-    temperature: 0.8
-    top_p: 0.9
-    top_k: 50
+    max_tokens: 16384
+    temperature: 0.1
+    top_p: 0.0001
+    top_k: 1
     repetition_penalty: 1.1
   
   # 场景特定配置

+ 4 - 4
ocr_tools/universal_doc_parser/config/bank_statement_yusys_v4.yaml

@@ -170,10 +170,10 @@ vl_recognition:
     retry_backoff_max_seconds: 8.0
     retry_jitter_ratio: 0.2
     retry_status_codes: [429, 500, 502, 503, 504]
-    max_tokens: 4096
-    temperature: 0.8
-    top_p: 0.9
-    top_k: 50
+    max_tokens: 16384
+    temperature: 0.1
+    top_p: 0.0001
+    top_k: 1
     repetition_penalty: 1.1
   
   # 场景特定配置

+ 4 - 4
ocr_tools/universal_doc_parser/models/adapters/glmocr_vl_adapter.py

@@ -83,10 +83,10 @@ class GLMOCRVLRecognizer(BaseVLRecognizer):
         self.retry_max_attempts = model_params.get('retry_max_attempts', 2)
         
         # 生成参数
-        self.max_tokens = model_params.get('max_tokens', 4096)
-        self.temperature = model_params.get('temperature', 0.8)
-        self.top_p = model_params.get('top_p', 0.9)
-        self.top_k = model_params.get('top_k', 50)
+        self.max_tokens = model_params.get('max_tokens', 16384)
+        self.temperature = model_params.get('temperature', 0.1)
+        self.top_p = model_params.get('top_p', 0.00001)
+        self.top_k = model_params.get('top_k', 1)
         self.repetition_penalty = model_params.get('repetition_penalty', 1.1)
         
         logger.info(f"GLM-OCR VL Recognizer configured with max_image_size={self.max_image_size}")

+ 1 - 1
ocr_validator/ocr_validator_utils.py

@@ -732,7 +732,7 @@ def get_data_source_display_name(source_config: Dict) -> str:
         'dots_ocr': 'Dots OCR',
         'ppstructv3': 'PPStructV3',
         'table_recognition_v2': 'Table Recognition V2',
-        'mineru': 'MinerU VLM-2.5.3'
+        'mineru': 'MinerU VLM'
     }
     
     tool_display = tool_name_map.get(tool, tool)