Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(deepdoc): add English caption patterns to fix missing figure/table numbering (#15481)

euvrefb3bd3de029b
diff --git a/deepdoc/vision/table_structure_recognizer.py b/deepdoc/vision/table_structure_recognizer.py
index e0892c2d72..997bc84b62 100644
--- a/deepdoc/vision/table_structure_recognizer.py
+++ b/deepdoc/vision/table_structure_recognizer.py
@@ -112,7 +112,12 @@ class TableStructureRecognizer(Recognizer):
@staticmethod
def is_caption(bx):
- patt = [r"[图表]+[ 0-9::]{2,}"]
+ patt = [
+ r"[图表]+[ 0-9::]{2,}",
+ r"(?i)Fig\.?\s*\d+",
+ r"(?i)Figure\s+\d+",
+ r"(?i)Table\s+\d+",
+ ]
if any([re.match(p, bx["text"].strip()) for p in patt]) or bx.get("layout_type", "").find("caption") >= 0:
return True
return False