Home / Insights / QA and Software Testing
QA and Software Testing
Measuring Document Processing Accuracy: Building a Test Set Before Go-Live
A single accuracy number tells you very little about a document processing system. This guide shows how to build a test set from your own files, measure each field separately and turn the results into review thresholds and a go-live decision.
TopicsQA and Software TestingAI and Machine LearningBusiness Operations and Integration
Key takeaways
- Build the test set from real, recent documents sampled by supplier, layout, channel and quality, not from the cleanest examples.
- Measure accuracy per field and per document type; a headline average hides the fields that cause financial errors.
- Separate the questions: was the value found, was it correct, and did validation catch it when it was wrong?
- Use confidence scores and business rules together to decide which documents go straight through and which go to a reviewer.
- Agree go-live criteria in writing before testing starts, and keep the test set as a regression suite after launch.
On this page
Most document processing projects are judged on one question from the business: “How accurate is it?” The honest answer is that accuracy depends on which field, which document type, which supplier and which scan quality you are talking about. An invoice total that is right on clean e-invoices can be wrong on photographed paper copies, and a date field can look perfect while the reference number that drives matching fails quietly.
This article sets out how we approach measurement before a pipeline goes live: building a representative test set, writing ground truth, choosing metrics, setting review thresholds and agreeing exit criteria. It assumes you already know why you want to automate; if you are still at that stage, start with our overview of AI document processing use cases, costs and human review.
Why a single accuracy figure misleads
Vendors and internal teams often quote a document-level or character-level accuracy figure. Both are easy to compute and both hide the errors that matter to operations.
- Character accuracy rewards reading text correctly, but a total of 1,250.00 read as 1,25.00 is one character wrong and completely wrong for accounting.
- Document-level averages blend easy fields (supplier name) with hard ones (line-item tax codes). A high average can coexist with a field that is wrong often enough to break reconciliation.
- Averages across suppliers let your ten largest, cleanest suppliers mask a long tail of unusual layouts that consume most reviewer time.
The useful unit is the field, per document type, per segment. That is also how PoliteTech measures extraction on client samples: per field, on your own documents, with uncertain values routed to review rather than guessed.
Building a representative test set
The test set should look like next month’s inbox, not like a demo folder. Sample deliberately across the dimensions that change extraction difficulty.
| Dimension | What to include | Why it matters |
|---|---|---|
| Document type | Each type in scope, such as invoices, delivery notes, claim forms | Each type has its own fields and rules |
| Sender or layout | Top senders by volume plus a sample of the long tail | Long-tail layouts drive exceptions |
| Channel | Email PDFs, scans, mobile photos, e-documents | Photos and faxes behave very differently from native PDFs |
| Quality | Skewed, low-resolution, stamped, handwritten annotations | Shows where capture guidance or rescanning is needed |
| Edge cases | Multi-page, credit notes, multiple currencies, missing fields | These cause the expensive errors |
| Time | Recent months, plus any seasonal formats | Layouts and suppliers change over time |
How many documents?
There is no universal number. A practical rule is to have enough examples per segment that a single error does not swing the result wildly, and to grow the set where results are borderline. Start with a stratified sample across the table above, then add documents wherever the first run shows uncertainty. Keep a separate held-out set that nobody uses for prompt tuning, template creation or model training, so the final measurement is not flattered by overfitting.
Handle sensitive data from day one
Test documents usually contain personal or commercial data. Agree where they are stored, who can access them, whether redaction is needed and how long they are retained before anyone uploads a file. If documents must stay in your environment, plan for processing in your own cloud account from the start.
Writing ground truth people agree on
Ground truth is the correct value for each field on each test document. It sounds simple until two people label the same invoice differently.
- Write a field dictionary. For each field, define the format (ISO date, decimal with two places), what to do when it is missing, and which value wins when several appear (for example, “total including tax, not the subtotal”).
- Label a sample twice. Have two people label the same documents independently and compare. Disagreements reveal ambiguous definitions; fix the dictionary, not just the label.
- Normalise before comparing. Decide whether “ACME Pty Ltd” and “Acme Pty. Ltd.” count as a match. Normalisation rules belong in the evaluation script, written once and versioned.
- Record the source location. Where possible, note the page and region of each value. It speeds up error analysis and reviewer screen design.
Labelling is often the most underestimated cost in a pilot. Budget time from someone who knows the business rules, not only from a junior labeller.
Metrics that map to operational outcomes
For each field, track a small set of numbers that answer different questions.
| Metric | Question it answers |
|---|---|
| Extraction rate | Did the system return a value when one exists? |
| Field correctness | When it returned a value, was it right after normalisation? |
| False presence | Did it invent a value where the document has none? |
| Validation catch rate | When a value was wrong, did a business rule or low confidence flag it? |
| Silent error rate | How often was a wrong value passed through with no flag? |
| Straight-through rate | What share of documents needed no human touch? |
The most important number for risk is the silent error rate: wrong values that went through without review. A system with lower raw correctness but strong validation can be safer than one that is usually right and occasionally wrong without warning.
Line items need their own treatment
Tables are harder than header fields. Measure row detection (did it find every line?), column assignment (quantity versus unit price) and row-level arithmetic (quantity times price equals line total). Report line items separately so they do not drag down, or hide behind, header-field results.
Turning results into review thresholds
Confidence scores from OCR and document AI services are useful, but they are not probabilities you can trust out of the box. Calibrate them against your test set.
- Plot correctness against confidence for each important field. Find the point above which errors become rare enough for your risk appetite.
- Combine confidence with business rules: totals that add up, dates in a plausible range, purchase order numbers that exist in the ERP, supplier tax IDs that match master data.
- Route by consequence. A low-confidence free-text note might pass with a flag; a low-confidence bank account number should always stop for review.
- Start conservative. Send more to review in the first weeks, then relax thresholds as production data confirms the test results.
For example, a team might decide that invoices go straight through only when the total reconciles with line items, the purchase order matches, and every financial field is above its calibrated threshold. Everything else lands in a side-by-side review screen with the uncertain fields highlighted.
Agreeing go-live criteria and keeping the test set alive
Write exit criteria before the first full test run, so results are not interpreted after the fact. A useful set covers:
- Minimum correctness per critical field, per document type
- Maximum silent error rate for financial and identity fields
- Expected reviewer workload at normal and peak daily volumes
- Processing time per document within the operational window
- Integration checks: exported records accepted by the ERP, accounting or document management system without manual fixes
After launch, the test set becomes a regression suite. Re-run it whenever you change a model version, prompt, OCR engine or validation rule, and add production documents that reviewers corrected. Reviewer corrections are the cheapest source of new ground truth you will ever have. For the broader quality process around releases, see our guides to continuous testing and user acceptance testing.
If you are planning a pilot, our intelligent document processing work starts with representative files and agreed fields before formats are expanded.
Frequently asked questions
Can we use a vendor’s published accuracy figure instead of our own test?
Published figures are measured on someone else’s documents. They are a starting signal, but your layouts, scan quality and fields will differ. Always measure on a sample of your own documents before committing.
Who should label the ground truth?
Someone who understands the business rules for each field, supported by a clear field dictionary. Double-label a sample to find ambiguous definitions early.
What if handwriting is involved?
Measure handwritten fields as a separate segment. Results depend heavily on legibility, so plan for a higher review share and consider redesigning forms or capture where possible.
How often should we re-run the test set after launch?
Whenever any part of the pipeline changes, such as a model version, prompt, OCR engine or validation rule, and periodically to catch drift from new suppliers or layouts.
Related reading
Continue your research
Want to know how accurate extraction will be on your own documents?
We can agree fields, rules and a representative sample, then measure extraction per field before you commit to a wider build.
