Engineering

How intelligent document processing works, step by step

How intelligent document processing works: capture, OCR, classification, field extraction, validation and human review, with how accuracy is measured.

Intelligent document processing (IDP) turns documents such as invoices, claim forms, contracts and IDs into checked, structured data in six steps: capture the file, read the text and layout (OCR), classify the document type, extract the fields you need, validate them against rules and your own records, and send uncertain fields to a person before the data reaches your systems.

Key takeaways

  • IDP is a pipeline, not one model. Most errors come from capture, layout and validation, not from the extraction model.
  • Accuracy should be measured per field, not per document.
  • Large language models made extraction from varied layouts easier; validation and human review are still what make the output trustworthy.
  • Start with one document type at real volume, then add others.

Step 1: Capture

Documents arrive as PDFs, scans, phone photos and email attachments. Capture gets them into one queue with their context: who sent them, which case or order they belong to, when they arrived. Pre-processing fixes what it can: rotating pages, removing blank ones, splitting files that hold several documents, and improving poor photos.

Step 2: Read the text and layout

Optical character recognition (OCR) turns the image into text. Modern document services go further and return the layout: lines, tables, key-value pairs and checkboxes, each with its position on the page and a confidence score. Cloud services such as Amazon Textract and Google Document AI do this through an API; open-source tools can run on your own servers when documents can’t leave your network.

Step 3: Classify

The system decides what each document is: invoice, credit note, delivery note, ID card, medical report. Classification matters because each type has different fields and rules. It can use the text, the layout or both, and it should have an "unknown" class that goes to a person instead of a forced guess.

Step 4: Extract the fields

Extraction finds the values you need: supplier name, invoice number, date, line items, totals, tax IDs, policy number. There are three common approaches, often combined:

  • Templates for fixed layouts that never change. Fast and accurate, but they break when the layout does.
  • Trained extraction models that learn your document types from labeled examples. Good at high volume with a known set of layouts.
  • Large language models that read the OCR text and layout and return the fields in a structured format. Good with many different layouts and with fields that need interpretation, such as "the payment terms in this contract".

Step 5: Validate

Validation catches the mistakes extraction makes:

  • Format checks: dates are dates, tax IDs match their pattern, amounts are numbers.
  • Arithmetic: line items add up to the subtotal; subtotal plus tax equals the total.
  • Cross-checks with your data: the supplier exists in your ERP, the purchase order number is open, the policy is active.
  • Business rules: amounts above a limit, a new bank account on a known supplier, a claim filed after the policy end date.

Step 6: Human review and export

Fields that fail validation or have low confidence go to a review screen that shows the value next to the place on the page it came from, so a person can confirm or fix it in seconds. Everything else flows straight to your ERP, CRM or case system. Every correction is logged, and the corrections become training and test data for the next improvement.

How accuracy is measured

Measure on a held-out set of real documents that people have keyed in carefully:

MeasureWhat it tells you
Field accuracyShare of fields extracted exactly right, per field type
Straight-through rateShare of documents that needed no human touch
Review timeSeconds a person spends on a document that needs review
Error escape rateWrong values that passed validation and reached your systems

The last one matters most. A system that sends more fields to review but lets fewer errors through is usually the better system.

A worked example

Example, for illustration. A distributor processes supplier invoices from many suppliers, each with a different layout.

  1. Invoices arrive by email; capture splits multi-invoice PDFs and links each to the supplier’s mailbox.
  2. A document service returns text and tables; an LLM extracts supplier, invoice number, dates, line items, tax and totals into a fixed schema.
  3. Validation checks the arithmetic, matches the supplier and purchase order in the ERP, and flags price differences above a tolerance.
  4. Matched invoices are posted for approval; mismatches and low-confidence fields go to the accounts team’s review screen.
  5. Each month, the team reviews field accuracy and the main reasons for review, and fixes the largest one.

Common mistakes

  • Judging by a demo on clean PDFs. Test on the phone photos and faded scans you really receive.
  • Measuring per document. "95 percent of documents correct" can hide a field that is wrong half the time.
  • No validation layer. Extraction alone will pass plausible but wrong values.
  • No review screen. If checking a field takes longer than typing it, people stop using the system.

How KaliIO approaches it

We start with a survey of your real documents and the fields that matter, build a labeled test set, and measure field accuracy and error escapes before anything goes live. Our intelligent document processing services cover the whole pipeline; for document-heavy sectors, see how it applies to insurance claims and logistics paperwork. When documents are photos rather than files, computer vision does the capture and clean-up. Weighing a ready-made IDP product instead? See build vs buy AI.

Frequently asked questions

Is IDP the same as OCR?

No. OCR turns an image into text. IDP adds classification, field extraction, validation and review, so the output is checked data, not just text.

Can IDP read handwriting?

Modern OCR services read handwriting, with lower confidence than print. Handwritten fields usually go to review more often; test them on your own samples before relying on them.

Do we need thousands of labeled documents?

Not always. LLM-based extraction can work from a clear field definition and a small set of examples, and a few hundred carefully keyed documents are often enough to measure accuracy. Trained models for a single high-volume layout need more.

Can documents stay in our own environment?

Yes. The pipeline can run in your cloud account or on your servers, with OCR and models that don’t send data to outside services, if your rules require it.

Sources

Building something like this?

Tell us about the problem and the data behind it. The first call is about whether AI fits.