Skip to content

fix: keep overlap category names from element 100 on - #4529

Open
jipeng6036-del wants to merge 1 commit into
Unstructured-IO:mainfrom
jipeng6036-del:fix/4512-overlap-label-index
Open

jipeng6036-del wants to merge 1 commit into
Unstructured-IO:mainfrom
jipeng6036-del:fix/4512-overlap-label-index

Conversation

@jipeng6036-del

@jipeng6036-del jipeng6036-del commented Oct 6, 2026 •

Copy link
Copy Markdown

Summary

catch_overlapping_and_nested_bboxes() labels each element as "{ix}. {category}". identify_overlapping_or_nesting_case() then dropped a fixed 3 characters to recover the category, which only matches a one-digit index.

From element 100 on, leftover digits leaked into overlapping_elements and overlapping_case (. Table, then 0. Table). Partitioned document content was unchanged.

The category is now taken from the text after the first ". ". Label construction in catch_overlapping_and_nested_bboxes() is unchanged.

Tests

  • python -m pytest test_unstructured/test_utils.py -k overlapping -q — 11 passed (existing overlap cases plus fillers of 0 / 100 / 1000 elements)
  • python -m ruff check unstructured/utils.py test_unstructured/test_utils.py
  • python -m ruff format --check unstructured/utils.py test_unstructured/test_utils.py CHANGELOG.md
  • git diff --check

AI assistance was used to locate the slice and prepare the patch. The overlap cases were run locally.

Fixes #4512

Review in cubic

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

catch_overlapping_and_nested_bboxes keeps part of the element index in the category from element 100 on

1 participant