Feedback on an invoice-to-Excel pipeline that flags uncertain values instead of guessing

I’m building an OCR pipeline for invoices, delivery notes and receipts (native PDFs, scans, photos) that exports one Excel sheet per page: header fields, the item table as a real table, and totals. Every value carries a status: reliable, to verify or absent. The goal is that it never presents a guess as a certain value.

Two things I’d like your opinion on:

  1. How do you evaluate table reconstruction on scanned registers (40+ rows, 4 columns)? Mine sometimes keeps only a partial block, so I added a warning when the accepted table covers only a small share of the words of a larger candidate. Is there a better-established way to detect truncated tables?
  2. For field choice (total, date) I use small gradient-boosted models over OCR candidates with an abstention rule. They beat my rule-based version on receipts but lose on formal European invoices. Has anyone found a good way to route between the two by document type?

There is a short description of the project (early test, slow, access on request) here: DataStructa — de vos factures à un tableau lisible

Thanks for any pointers.

That flag-instead-of-guessing design is exactly right — and both questions get a cleaner answer from a signal outside the method being checked. For a truncated table, count OCR text lines in the table’s page region and flag the result when accepted rows fall well short of that count or text lines continue below the last accepted row: word share of a larger candidate can stay reassuringly high when both candidates miss the same bottom rows. For field choice, route on page regularity rather than the receipt/invoice label — tightly clustered column and candidate positions mean your rules are encoding a real template and should win, widely spread positions mean the learned model should — and test that router leave-one-supplier-out, so it has to pick correctly for a supplier it never saw in training rather than memorising layouts.