From 2ae8f2cf00aed9e6794cc32dbb2bb190ea5ff645 Mon Sep 17 00:00:00 2001 From: Yongteng Lei Date: Thu, 24 Jul 2025 17:06:56 +0800 Subject: [PATCH] Fix: exception layout_type in is_caption (#9028) ### What problem does this PR solve? Exception layout_type in is_caption. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- deepdoc/vision/table_structure_recognizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepdoc/vision/table_structure_recognizer.py b/deepdoc/vision/table_structure_recognizer.py index 470abc3b6..26b182e10 100644 --- a/deepdoc/vision/table_structure_recognizer.py +++ b/deepdoc/vision/table_structure_recognizer.py @@ -97,7 +97,7 @@ class TableStructureRecognizer(Recognizer): r"[图表]+[ 0-9::]{2,}" ] if any([re.match(p, bx["text"].strip()) for p in patt]) \ - or bx["layout_type"].find("caption") >= 0: + or bx.get("layout_type", "").find("caption") >= 0: return True return False