You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
assign_and_map_hash_ids() reuses the same id for two elements of a page that is not contiguous #4620
unstructured/documents/elements.py derives the "sequence number on page" with itertools.groupby(page_numbers), so the number is the index inside each contiguous run of equal page numbers and it restarts when a page number appears again later in the list. The comment above the code ("generate sequence number for each element on a page") and Element.id_to_hash() ("sequence number on page") both describe a per-page counter, and the sibling _assign_hash_ids() in unstructured/partition/common/metadata.py implements exactly that.
The visible effect: two distinct elements that share their text on a page that is not contiguous in the list get the same id, so old_to_new_mapping silently points both parent_ids at one element.
Activity