Skip to content

Commit

Permalink
refactor: revert renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
christinestraub committed Mar 22, 2024
1 parent cadc5b2 commit 9f33f90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unstructured_inference/inference/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def extract_text(


def aggregate_by_block(
target_region: TextRegion,
text_region: TextRegion,
pdf_objects: Collection[TextRegion],
) -> str:
"""Extracts the text aggregated from the elements of the given layout that lie within the given
Expand All @@ -252,7 +252,7 @@ def aggregate_by_block(
filtered_blocks = [
obj
for obj in pdf_objects
if obj.bbox.is_almost_subregion_of(target_region.bbox, subregion_threshold)
if obj.bbox.is_almost_subregion_of(text_region.bbox, subregion_threshold)
]
text = " ".join([x.text for x in filtered_blocks if x.text])
return text
Expand Down

0 comments on commit 9f33f90

Please sign in to comment.