Skip to content

Commit

Permalink
fix: added error margin to clean_pdfminer_inner_elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Torres committed Oct 26, 2023
1 parent 2afc2e5 commit 4ddb200
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion unstructured_inference/inference/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 4ddb200

Please sign in to comment.