Explorar el Código

feat: enhance bank statement configuration by adding layout post-processing options and adjusting OCR parameters for improved text detection accuracy

zhch158_admin hace 5 días
padre
commit
7c121fdadd

+ 13 - 2
zhch/universal_doc_parser/config/bank_statement_mineru_v2.yaml

@@ -36,6 +36,16 @@ layout_detection:
   # iou: 0.45
 
 # ============================================================
+# Layout后处理配置
+# ============================================================
+layout:
+  # 将大面积文本块转换为表格(后处理)
+  convert_large_text_to_table: true  # 是否启用
+  min_text_area_ratio: 0.25         # 最小面积占比(25%)
+  min_text_width_ratio: 0.4         # 最小宽度占比(40%)
+  min_text_height_ratio: 0.3        # 最小高度占比(30%)
+
+# ============================================================
 # VL识别配置(表格、公式)
 # ============================================================
 vl_recognition:
@@ -68,8 +78,9 @@ vl_recognition:
 ocr_recognition:
   module: "mineru"
   language: "ch"  # 语言: ch, ch_lite, en, japan 等
-  det_threshold: 0.3  # 检测阈值
-  unclip_ratio: 1.8   # 文本框扩展比例
+  det_threshold: 0.6  # 检测阈值
+  unclip_ratio: 1.5   # 文本框扩展比例
+  enable_merge_det_boxes: false  # 不合并框
   batch_size: 8
   device: "cpu"
 

+ 13 - 2
zhch/universal_doc_parser/config/bank_statement_yusys_v2.yaml

@@ -35,6 +35,16 @@ layout_detection:
   num_threads: 4
 
 # ============================================================
+# Layout后处理配置
+# ============================================================
+layout:
+  # 将大面积文本块转换为表格(后处理)
+  convert_large_text_to_table: true  # 是否启用
+  min_text_area_ratio: 0.25         # 最小面积占比(25%)
+  min_text_width_ratio: 0.4         # 最小宽度占比(40%)
+  min_text_height_ratio: 0.3        # 最小高度占比(30%)
+
+# ============================================================
 # VL识别配置(表格、公式)
 # ============================================================
 vl_recognition:
@@ -67,8 +77,9 @@ vl_recognition:
 ocr_recognition:
   module: "mineru"
   language: "ch"  # 语言: ch, ch_lite, en, japan 等
-  det_threshold: 0.3  # 检测阈值
-  unclip_ratio: 1.8   # 文本框扩展比例
+  det_threshold: 0.6  # 检测阈值
+  unclip_ratio: 1.5   # 文本框扩展比例
+  enable_merge_det_boxes: false  # 不合并框
   batch_size: 8
   device: "cpu"