OCR table header repeated on every invoice page: deduping rows
Dedupes repeated OCR table headers on multi-page invoices. Use when page headers reappear as data rows in extraction output. Not for genuinely repeated line items.
TL;DR
When OCR runs per page, the table header row repeats on every page and naive extraction emits it as a data row, corrupting totals and line counts. Fix it in post-processing: detect header-like rows by matching the known header pattern (column names, non-numeric cells, position at page top) and drop them, keeping only the first occurrence. Better, make extraction page-aware: mark rows by page and suppress header patterns on pages after the first. Validate by reconciling the extracted line count against the invoice's stated line count or totals.
The query
OCR table header repeated on every invoice page: deduping rowsUse this when
- Multi-page invoice extraction with phantom header rows
- Line counts wrong on multi-page invoice OCR
- Repeated table headers in extraction output
Not for
- Genuinely duplicated line items (different problem)
- Headers that change mid-document (handle as separate tables)
Steps
- Extract with page numbers attached to every row.
Expected output: Rows are traceable to their page.
- Define the header pattern: the column-name row from page one.
Expected output: You have a template to match against.
- Drop rows matching the header pattern on pages after the first.
Expected output: Phantom rows are removed; real data stays.
- Reconcile: extracted line count and totals vs the invoice's own totals.
Expected output: The dedup is verified numerically.
- Push the rule into your extraction post-processor as a standard pass.
Expected output: Every multi-page invoice gets it automatically.
Variant phrasings
OCR table header repeated every page dedupe
multi-page invoice header row extraction
remove repeated headers invoice OCR
Root cause
The header repeats because OCR sees pages, not documents: each page is an independent image with its own header row. Deduping is a document-level operation, which is why it belongs in post-processing after page-level extraction, not in the OCR engine.
Edge cases
- Some invoices genuinely repeat a line item that looks like a header; reconcile totals before dropping
- Footers with page totals need similar treatment; do not confuse them with data rows
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_QJcb5xPCbTlZDxnAxt7Spw
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.