Skip to content

Fix repeated-header splitting and nested ruled-table output - #5294

Closed
minsukim-epapyrus wants to merge 2 commits into
pymupdf:mainfrom
veget-able:table-experiements/repeated-header-nested-table-main-20261119
Closed

minsukim-epapyrus wants to merge 2 commits into
pymupdf:mainfrom
veget-able:table-experiements/repeated-header-nested-table-main-20261119

Conversation

@minsukim-epapyrus

Copy link
Copy Markdown

This change addresses two table extraction issues:

  • Require at least two distinct column labels before splitting on repeated headers. Keep proven centered section titles with their corresponding blocks and preserve their full-width colspan.
  • Keep ruled tables nested inside a retained parent cell as cell text, avoiding duplicate table output.

Validation against main 75ea522, with OCR disabled:

  • 71 table tests passed.
  • PB503: bbox F1 82.0542% → 82.5635%; GTRM 75.3114% → 75.3466%.
  • DP200: output and scores unchanged.
  • Local998: bbox F1 unchanged; aggregate GTRM decreased by 0.001211 percentage points. One page, pubtables-608dbe1bd8c8867e, regressed by 1.2013 percentage points.

Require at least two distinct normalized nonempty labels in a repeated
header signature, so a common omission marker cannot split body records.

When repeated blocks each have a single bold, centered section title,
move the split to that title after checking actual cached word ownership,
physical vertical partitions, rowspans and complete logical slots.
Recheck the final placements before expanding a proven title to the
whole-table colspan; retain its source attributes and all body cells.

Implement the policy in _table_sections and connect it to the existing
main refine pipeline. Include the module in wheel packaging and add
focused tests for labels, geometry, source ownership and preservation.
Reuse cached words, characters and drawings without additional PDF
extraction or model inference. Keep the default unrefined path unchanged.
Treat an admitted ruled grid wholly inside one actual cell of a selected
ruled parent as existing parent-cell text instead of another output table.
Protect approved grid-reference parents before replacement selection,
then remove nested candidates only under parents retained in the result.

Preserve independent panels, children of rejected or unselected parents,
equal boxes, partial overlaps, gaps and grids crossing multiple cells.
Reuse actual candidate grids and consumed indexes; retain the existing
span gates, parent geometry and text without new extraction or inference.
Keep the default non-union path unchanged.

Add focused tests for nested hierarchies, actual cell containment,
rejected containers, approved grid references and independent panels.
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@minsukim-epapyrus
minsukim-epapyrus force-pushed the table-experiements/repeated-header-nested-table-main-20261119 branch from fbed66c to d05be3c Compare November 19, 2026 06:16
@minsukim-epapyrus

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant