Modern models read documents well, including messy scans. Reliability comes from what surrounds the model: classification, validation and review.
- Document arrives
- Classify type
- Extract fields
- Validate with rules
- Confidence check
- Post or send to review
Measure accuracy properly
Collect a test set of real documents covering every layout and supplier type. Measure accuracy per field, not per document: a correct total with a wrong date is still an error.
Validate, don't trust
- 1
Totals add up
Lines, VAT and total agree
- 2
Known supplier
VAT ID and bank details match records
- 3
Order match
Quantities and prices within tolerance
- 4
No duplicate
Same number and amount not seen before
Confidence thresholds
Documents that fail a rule or fall below a confidence threshold go to a review queue with the questionable field highlighted. Over time, tune thresholds so people review only what needs it.
Pitfalls
- New layouts from a new supplier
- Multi-page documents with totals on the last page
- Handwritten notes on scans
- Instructions hidden in documents that try to manipulate the model
Log every extraction so errors can be traced and fixed.