How OCR and AI extraction read documents, and where they fail
The two steps: reading text, then giving it meaning
Document extraction has two jobs. The first is optical character recognition, which finds the lines and characters on a page and turns them into text. The second is extraction, which decides that a particular string is the buyer's name, the invoice total or the due date. A failure in either step produces a wrong record, so test the two steps separately.
Traditional OCR engines handle clean printed text well, and open-source engines such as Tesseract are a common starting point. Cloud OCR services add stronger handling of photographs and skewed pages. Vision-capable language models read the page as an image and can answer questions about it directly. They help with unusual layouts, but exact numbers still need checking against the source.
Layout, tables and reading order
Layout is where many pipelines quietly go wrong. A system can read every character correctly and still produce a useless record if it reads the wrong cell or the wrong column.
- Multi-column pages: the engine must read each column in order, or sentences from two columns merge into one.
- Tables: a total means something only with its row and column headers. Extract tables as rows with the headers attached, not as loose text.
- Key-value pairs: forms place the label and the value in different positions. Map fields by their label, not by where they sit on the page.
- Vertical text: many Chinese and Japanese documents are printed top to bottom and right to left. Confirm that the engine handles this direction before you rely on it.
Handwriting, stamps and seals
Asian business paperwork often carries handwritten entries, rubber stamps and company seals. A seal can overlap the very digits you need, and handwriting varies a lot from writer to writer. These are the weakest parts of most pipelines, so measure them separately rather than trusting the overall score.
Seals need image cleaning before reading, and a handwritten name or a mix of Chinese characters and numbers can defeat a model that reads print well. If a field depends on handwriting or a seal, plan a review step for it from the start, not as a later fix.
Checks that catch wrong output
A confident reading can still be wrong. Automatic checks catch many of these errors before they reach your records.
Any document that fails one of these checks should go to a review queue with the source image beside the extracted value. The reviewer then sees what the page says, not only what the machine guessed.
- Arithmetic: line items should sum to the subtotal, and the subtotal plus tax should equal the total.
- Format: dates, currency codes, tax identifiers and phone numbers should match the pattern their country uses. Some identifiers include a check digit you can verify.
- Cross-reference: compare the extracted supplier name or order reference with your existing records before you accept the document.
- Confidence: use the engine's confidence score for each field to route weak fields to a person, but do not treat the score as proof of accuracy.
Measure accuracy on your own documents
Published benchmarks use documents that may look nothing like yours. Build a test set from real scans of your own suppliers, customers and forms, including the poor ones. Label the correct value for each field by hand, and score each field separately, because a wrong total costs more than a misread address.
Repeat the test whenever the engine, the model or the mix of documents changes. A result that was good last quarter can drift when a new supplier starts sending a new layout.
When to keep a person in the loop
Keep a person on any field that moves money, creates a legal obligation or feeds a tax filing, and on any document type you have not tested yet. Automation can handle clean, repeated documents and free your staff for the unusual ones.
Record who approved each change, so the audit trail shows the source image, the extracted value and the decision. That record is what lets you explain an error later, and it is what shows your process is working.
How Hundred Seas helps
Hundred Seas is a product studio in Taipei that builds AI agents and custom software. For document work we choose, step by step, between dedicated OCR and a vision-capable model, based on the accuracy we measure on your documents, cost, speed and where the files must be processed. We are a registered partner in Anthropic's Claude Partner Network and an OpenAI partner.
We begin with a scope step of about one week at a fixed price, ending in a written plan and a firm quote. The build then arrives in weekly releases of working software, and a monthly run plan keeps the pipeline running as your document mix changes.
Questions
- Is OCR the same as AI document extraction?
- No. OCR converts an image of text into characters. Extraction decides what those characters mean, such as which number is the invoice total. Many systems use both: OCR first, then a model or rules that map the text to fields. Some newer models skip the separate OCR step and read the page directly, but you still need to check their output.
- What accuracy should I expect from scanned invoices?
- There is no single answer, because it depends on scan quality, the layouts you receive and the fields you need. Test a sample of your own invoices, score each field separately and review the errors. Ask any vendor for results on documents like yours, not only on their own benchmark set.
- Can AI read handwriting on forms?
- Sometimes. Clear block capitals on a clean form are usually easier than cursive writing or a mix of Chinese characters and numbers. Results vary by writer, so measure handwriting on your own forms. For any handwritten field that matters, send the value to a person for confirmation.
- Do documents have to go to a cloud provider?
- Not always, but many of the strongest engines run in the cloud. Check where each provider processes and stores files, what its retention terms are, and whether your contracts and local data rules allow that transfer. Read the provider's current data terms rather than relying on a summary.
- How do I stop a bad extraction reaching my system?
- Put validation between extraction and your records. Check totals, formats and existing customer or supplier records, and hold any document that fails until a person has reviewed it. Write to your system only after the checks pass, and keep the source image linked to every record.