Why a single accuracy figure tells you little
Ask what a reported accuracy figure counts and which documents the test includes. A score based on characters in clean PDFs leaves a finance team with a practical question. How often does the system get the tax amount right on a photographed receipt? Ask for results by field and document type on a sample that resembles your own.
Consider an accounts payable team that receives 3,000 supplier invoices a month. If the system reads the supplier name and invoice date correctly almost every time but misreads the tax amount on one invoice in twenty, the headline accuracy can still look excellent. The team, however, now has around 150 invoices a month with a wrong tax figure, and nobody knows which ones unless something checks them.
For each required field, measure how often the result is correct. Check how often the system flags its own errors before posting. We build this kind of workflow under our document extraction and review service, with a human review screen and accuracy measured for each field.
Templates, document AI models and language models
Compare the extraction methods on the same documents and field definitions.
Template OCR reads text from fixed positions on a known layout. It can be economical for a small set of stable layouts. Detect layout changes before accepting values read from the same positions.
Document AI models, often sold as intelligent document processing, are trained to recognize invoice fields across many layouts. Amazon Textract's expense analysis, for example, maps different labels such as "bill number" and "invoice number" to one standard field, INVOICE_RECEIPT_ID, and returns the label text, the value text, its position on the page and a confidence score for each piece of data. Microsoft's Document Intelligence returns confidence values for fields from its prebuilt invoice model and supports custom models trained on your own labeled documents.
Large language models read the document, or the OCR text of it, and fill a structured schema you define. They handle unusual layouts and free-text instructions well. Their weakness is that they can produce a value that looks right but is not on the page, and a confidence score it produces still needs to be checked against labeled results for that field.
Three extraction approaches compared
| Approach | Works best for | Main risk |
|---|---|---|
| Template OCR | Few suppliers with fixed layouts | Breaks silently when a layout changes |
| Document AI model | Many suppliers, standard invoice fields | Weaker on unusual fields and poor scans |
| Language model | Varied layouts and non-standard fields | Plausible values that are not on the page |
Use the same field specification, test documents, validation rules, and review process when comparing the three methods.
Write the field specification first
Before anyone compares vendors, write down exactly what you need from each document type. Record each field’s name, format, destination in the ERP and validation rule. Specify when the field is required. The sample rules below should be adapted to the documents, tax treatment and purchasing policies you actually use.
| Field | Format | Validation rule |
|---|---|---|
| Supplier | Match to supplier records | Match one active supplier by verified identifier and review any ambiguous name match |
| Supplier tax identifier | Text in the applicable format | When required, match the identifier held for that supplier and tax scheme |
| Invoice number | Text, as printed | Flag duplicates using the agreed key for this document type |
| Invoice date | ISO date | Check against posting and purchasing rules and route exceptions for review |
| Net, tax and total | Decimal, invoice currency | Reconcile the amounts using the applicable rules for discounts, charges and rounding |
| Tax amount | Decimal | Recalculate from the taxable base and applicable rates, allowing for exemptions and rounding |
| Purchase order | Text | When required, match an open order for that supplier |
Check the supplier against the master record and recalculate the totals. These checks can catch a misread digit or mismatched supplier even when the extraction score is high. Store tax identifiers as text so leading zeros or required letters survive. The Peppol supplier tax identifier specification provides one example of a format that can require letters.
Decide also what the system does not need. Many projects try to extract every line item from every invoice when the ERP posts only header totals for most suppliers. Measure line-item accuracy separately from header accuracy. Extract them only where they are used, for example for three-way matching against purchase orders and goods receipts.
Build a ground-truth set from your own documents
Use documents you are authorized to process and label the correct field values. Have people verify those labels before using the set to compare vendors or evaluate a later version.
Choose the documents by volume and by difficulty. Include your largest suppliers, a spread of smaller ones, digital PDFs and scans, multi-page invoices, credit notes, Arabic and bilingual invoices, and the documents your team already finds awkward. If your inbox includes documents in Arabic, read our guide to extracting data from Arabic and bilingual documents, because those need their own test cases.
Have two people label a portion of the set independently and compare their answers. Resolve disagreements and document whether they arise from an unclear field definition, an unreadable document, or a labeling mistake. Then keep part of the set aside as a test set that is never used to tune prompts, rules or models. Results on documents the system has already been tuned on will look better than they really are.
Measure accuracy field by field
Score each field separately: correct, wrong, or missing. Treat "missing" differently from "wrong". A blank field sends the document to review, which costs time. A wrong value that passes all checks can post to the ledger, which costs money.
Report the results per field and per document group, such as top suppliers, scanned documents and Arabic invoices. Ask vendors for the same breakdown on your test set, not on their own benchmark. If a vendor publishes an accuracy figure, treat it as the vendor's claim about its own test data, and test it on yours.
Report the straight-through rate, the share of documents posted without manual intervention. Separately, check a labeled sample of those documents and report how often all required fields were correct. The posting rate alone cannot show whether errors reached the ledger.
Set confidence thresholds and route exceptions
Document AI services can return a confidence score alongside a value. Microsoft describes field confidence as an estimated probability from 0 to 1. Under that interpretation, a score of 0.95 corresponds to 19 correct predictions out of 20. Some fields return no score. Where both are available, check the score for reading the text and the score for identifying the field. Amazon Textract uses a scale from 0 to 100. Verify each product’s scores on your labeled documents before comparing them or using them to accept a value.
Choose thresholds on labeled calibration documents. For each field, calculate how often values above different scores were correct. Select a threshold that meets the field’s error tolerance, then evaluate it on the held-out test set. A wrong tax amount is expensive, so its threshold should be strict. An address used only for reference can have a different threshold from an address used to release a delivery.
An invoice extraction pipeline with a human review loop
- ReceiveEmail, upload or scan, with the original file stored and given an ID
- ExtractOCR or a document AI model reads the fields and confidence scores
- ValidateVendor master, duplicate check, totals and tax rules
- RouteDocuments that pass every rule and threshold post. The rest go to a review queue
- ReviewA person corrects the marked fields, and each correction is logged
- Post and reconcileWrite to the ERP once, then compare counts and totals daily
Highlight the fields that need manual review while keeping the surrounding document visible. This lets the reviewer resolve the exception without having to recheck the entire invoice. Keep a separate queue for documents that fail rules, such as unknown suppliers or duplicates, because those need someone with authority to decide, not just a careful typist.
Design the review screen for speed and evidence
Let reviewers compare each field with the original without switching screens. Show the document image on one side and the extracted fields on the other. When the reviewer selects a field, highlight where it was read on the page. Both Textract and Document Intelligence return the position of each value, which makes this possible.
Order the fields by what needs attention: failed rules first, then low-confidence fields, then the rest, collapsed. Let the reviewer accept a whole document with one key press when everything is correct, and correct a field by clicking the right text on the image rather than retyping it. Record who changed what and when, with the original extracted value, so auditors and your own team can see the history.
Review repeated corrections by supplier. Check whether the template, vendor master record, or validation rule is causing them.
Write back to the ERP and reconcile
Posting to the ERP is an integration like any other, and it fails in the same ways: duplicates after a timeout, mismatched codes, and records that exist in one system but not the other. Define the duplicate key for each document type. It may include the receiving entity, supplier and invoice number. Keep the source document ID in the ERP record. Each day, compare documents received, documents posted and documents still waiting. Our guide to connecting a website to an ERP describes retries and reconciliation in detail, and the same methods apply here.
Agree who owns each exception. Finance usually owns tax and amount differences, procurement owns purchase order mismatches, and the system owner owns technical failures.
Watch for drift after go-live
Keep measuring field errors after launch, especially when document layouts, scanners, or models change. Suppliers change their invoice designs, new suppliers arrive, scanners are replaced and model versions are updated by the vendor. Each change can lower accuracy on a group of documents without any error message.
Track three numbers every week: the straight-through rate, the share of fields corrected in review, and the number of errors found after posting. Break them down by supplier. If corrections increase for one supplier, check for a layout change, a change in scan quality, or a new issue in the supplier record. Re-run the held-out test set whenever the vendor changes the model version or you change prompts or rules, and keep the results so you can compare versions.
Use structured invoices when they are available
Check which suppliers can send invoices in a structured format. OASIS Universal Business Language is one example of a standard with invoice and credit-note documents. When the recipient supports the format and exchange route, it can validate the data directly. If a readable PDF accompanies the invoice, retain it where required and check how to link it to the structured record.
Keep a document workflow for suppliers that send scanned files and for receipts, expense claims, delivery notes, statements, contracts, and older records. Identify which source is authoritative for each document type. A structured file and a later emailed copy should not make two payables. Our guide to e-invoicing and ERP integration covers mapping and accounting reconciliation.
Questions buyers ask
What accuracy should we expect from invoice OCR?
Measure accuracy by field on invoices that resemble the ones you receive. Results vary with the layout and scan quality. A system can read invoice numbers reliably while making frequent mistakes on line items or tax.
Can a large language model replace OCR for invoices?
It can help return structured data from varied layouts. It may also invent a plausible value and may lack calibrated confidence by field. Use validation, human review, and separate evaluation data to measure how it performs.
Do structured invoices make document extraction unnecessary?
If the source supplies a supported structured invoice, use that data directly and validate it. Receipts, scans, expense claims, delivery notes, statements, and historical records may still require extraction.
How many documents do we need to test a system?
Cover the layouts, suppliers, languages and image types that account for your volume, including difficult cases. A finance team may need hundreds of labeled documents. Keep a separate evaluation set that is never used for tuning.