# How does intelligent document processing extract data from contracts?

> Intelligent document processing turns contracts into structured data in five stages. Relationships between parties are the hard part, not entities.

URL: https://preview2.snowfox-ai.com/blog/intelligent-document-processing-contracts
Last updated: 2026-11-17

Published: 2026-11-17

By the Snowfox AI team

## Key takeaways

- IDP produces a structured record of who holds which power, while plain OCR only produces text.
- Relationship extraction is harder than entity extraction because of distance, defined terms, direction and conditions.
- Agree on the unit, matching rule and test set before anyone quotes an accuracy number.
- LLMs suit varied documents and long-range reasoning; supervised models still win on stable, high-volume document families.

Intelligent document processing (IDP) turns contracts and other unstructured documents into structured data that a system can use. It works in stages: read the page, understand its layout, extract the entities (parties, dates, amounts), extract the relationships between them (who grants which power to whom), then validate the result and send doubtful cases to a person. Entities are the easier part. Relationships are where most contract projects succeed or fail.

## What is intelligent document processing?

IDP combines optical character recognition (OCR, which converts an image of text into machine-readable text), layout analysis, natural language processing (NLP) and business rules to convert documents into fields in a database. It differs from plain OCR in its output. OCR gives you text. IDP gives you a record: this person, in this role, with this power, valid until this date.

That matters for contracts because the value is rarely in a single field. A power of attorney or a company's articles of association is useful to an onboarding team only once someone has worked out who can sign for whom, and within what limits.

## What are the stages of an IDP pipeline?

A contract pipeline has five stages. Each one fails in its own way, and errors carry forward, so measure them separately.

| Stage | What it does | What typically goes wrong |
|---|---|---|
| 1. Ingestion and OCR | Receives the PDF, checks whether it has a text layer or is a scan, and produces text | Poor scans, stamps over text, OCR run on files that already had text |
| 2. Layout analysis | Identifies reading order, clauses, headers, tables and signature blocks | Two columns read as one, tables flattened, clause numbering lost |
| 3. Entity extraction | Finds and labels parties, representatives, ID numbers, dates, amounts and powers | One person written three ways, roles confused, boilerplate taken for content |
| 4. Relationship extraction | Links entities: who represents which company, who grants which power to whom | Links across distant clauses missed, conditions and exceptions ignored |
| 5. Validation and human review | Applies business rules and routes low-confidence cases to a reviewer | A review queue too large to be useful, or too small to catch errors |

Do not skip layout analysis. A model that receives clauses out of order makes mistakes that look like language errors but are layout errors.

## Why are relationships harder to extract than entities?

An entity is a local decision. The name that follows "represented by" is a person, "12 March 2025" is a date, and a model can usually tell from the sentence around it. A relationship is a decision about two or more entities and the text that connects them. In contracts, that text has three awkward properties.

1. **Distance and defined terms.** The grantor is named in the preamble and the powers are listed several clauses later. In between, the grantee becomes "the Attorney" or "the aforementioned". The model has to resolve those mentions back to an actual party, a task called coreference resolution.
2. **Direction.** "A grants B" and "B grants A" contain the same entities. Getting the direction wrong produces a record that looks complete and is wrong.
3. **Conditions.** Powers come with limits: jointly with another signatory, up to an amount, for a period. A relationship extracted without its condition is often worse than none, because it overstates what someone can do.

Errors also propagate. If an entity is missed, every relationship that involves it is lost.

## How should accuracy be measured?

"Accuracy" is a loose word in extraction work, so define it before anyone quotes a number. The useful measures are precision (of what the system extracted, how much is correct), recall (of what was in the document, how much the system found) and F1, which combines the two.

Put these decisions in writing:

- **Unit.** Per entity, per relationship or per document. The document-level measure is the strictest, and usually the one the operations team cares about.
- **Matching rule.** Exact and partial matches of a party name give different numbers.
- **Denominator for relationships.** Scored given correct entities, or end to end from the raw PDF. The second number is lower and closer to production.
- **Test set.** Documents the model has never seen, drawn from real intake, bad scans included. Fix it and keep it.

Then add the operational measures that decide whether the project pays for itself: the share of documents processed without human touch, the error rate among those, and reviewer time per document.

What not to do: report one blended number, evaluate only on the cleanest documents, or compare a vendor's figure with your own without checking that the unit and matching rule are the same.

## Where do LLMs fit, and where do supervised models still win?

Large language models (LLMs) have changed the economics of this work, but they have not retired supervised models. A supervised model is one trained on examples that people have labelled with the correct answer.

| Situation | Better fit | Why |
|---|---|---|
| Few labelled examples, many document types | LLM | Works from instructions and a handful of examples |
| Long-range references, defined terms, conditions | LLM, with checks | Handles coreference and paraphrase well |
| High volume of a stable document family | Supervised model | Lower cost per page, predictable latency, consistent output |
| Calibrated confidence to decide what goes to review | Supervised model | Scores can be thresholded; an LLM's stated confidence is not reliable |

In practice the answer is usually a hybrid. An LLM proposes, a supervised model or rule set verifies, and every extracted value points to the page and span it came from so a reviewer can check it in seconds. Insist on that pointer. An extraction with no source span cannot be audited, and the pointer is the main defence against a generative model producing a plausible value that is not in the document.

Do not send every contract to the largest model available and call it a pipeline. Without a fixed test set, you will not know when a prompt change or a model version change made results worse.

## What does this look like in a real project?

Snowfox's published financial-sector case is a direct example. A financial services company needed faster customer onboarding, which depended on reading complex PDF contracts and identifying the parties and the powers granted. The approach was an IDP pipeline that combined document recognition with supervised extraction of entities and relationships from natural-language text.

The published case reports 93% accuracy for entity extraction and 95% for detecting relationships between entities. Read these as two separate measurements, not a ranking of difficulty. They score different tasks over different denominators, and the published case does not detail the evaluation protocol. What a buyer should take from it is that the two stages were measured separately, which is what lets a team decide where review effort should go.

## Where to start

Start with the process, not the model. Pick one document family, write down the fields and relationships the downstream team actually uses, and label a small test set before choosing any technology.

- The worked example: [Automated PDF extraction using IDP](/cases/pdf-extraction-idp)
- Text extraction and classification: [Natural language processing](/solutions/nlp)
- Scans and layout: [Computer vision](/solutions/computer-vision)
- Where LLMs come in: [Generative AI](/solutions/generative-ai)
- Are the data and process ready? [AI Readiness Assessment](/ai-readiness)
- A specific problem: [Contact Snowfox](/contact)

## Common questions

### What is the difference between OCR and intelligent document processing?

OCR converts an image of a page into text. Intelligent document processing adds layout analysis, entity and relationship extraction and validation, so the output is a structured record a system can use.

### Why is relationship extraction harder than entity extraction in contracts?

An entity can usually be identified from the sentence around it. A relationship links entities that may be pages apart, referred to by defined terms, with a direction and conditions that all have to be right.

### Should contract extraction use an LLM or a supervised model?

Usually both. LLMs handle varied documents and long-range references with few examples, while supervised models give lower cost per page, consistent output and confidence scores for stable, high-volume document families.
