From 4ddb20092b6f0f6d4fdeb396d83e5eeda645d4ab Mon Sep 17 00:00:00 2001 From: Benjamin Torres Date: Thu, 26 Oct 2023 15:20:21 -0600 Subject: [PATCH] fix: added error margin to clean_pdfminer_inner_elements --- unstructured_inference/inference/layout.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unstructured_inference/inference/layout.py b/unstructured_inference/inference/layout.py index afb53abd..2388afc5 100644 --- a/unstructured_inference/inference/layout.py +++ b/unstructured_inference/inference/layout.py @@ -160,7 +160,9 @@ def clean_pdfminer_inner_elements(self): tables = [e for e in page.elements if e.type == "Table"] for i, element in enumerate(page.elements): if element.source == Source.PDFMINER: - element_inside_table = [element.bbox.is_in(t.bbox) for t in tables] + element_inside_table = [ + element.bbox.is_in(t.bbox, error_margin=15) for t in tables + ] if sum(element_inside_table) == 1: parent_table_index = element_inside_table.index(True) parent_table = tables[parent_table_index]