Amazon Textract

On this page 7

Amazon Textract is a managed machine learning service from Amazon Web Services that reads scanned documents, photographs and PDFs and returns their text, form fields, tables and layout as structured data. In AI automation, it serves as the document understanding layer that turns paper-like inputs into records a workflow can validate, route and post to business systems without manual keying.

Unlike classic optical character recognition, which outputs a flat stream of characters, Textract preserves relationships between elements: which value belongs to which label, which cell sits in which row, and how confident the model is about each reading. That structure is what makes it usable inside intelligent document processing pipelines rather than only as a text scanner.

How Amazon Textract analyzes a document

Amazon Textract analyzes a document by running detection and analysis models over each page and returning a hierarchy of Block objects in JSON. A page contains lines, a line contains words, and analysis features add higher-level blocks such as tables, cells, key-value sets, selection elements and query results.

Every block carries a confidence score from 0 to 100, a bounding box and polygon geometry, and relationship identifiers that link it to child or associated blocks. Downstream code walks these relationships to rebuild a form field, for example by joining a KEY block to its VALUE block and then collecting the WORD children of each.

The service exposes synchronous and asynchronous operations. Synchronous calls suit single images and single-page files in interactive scenarios, while asynchronous jobs read multipage PDF or TIFF files from Amazon S3 and publish a completion notification through Amazon SNS, which an orchestrator then uses to fetch paginated results.

The following table summarizes the main block types that an automation pipeline consumes.

Block typeWhat it representsTypical automation use
PAGE, LINE, WORDRaw text hierarchy with geometryFull-text search, keyword routing, archiving
KEY_VALUE_SETLabel and its filled valueMapping form fields to record attributes
TABLE, CELLGrid structure with row and column indexesLine items, schedules, statements
SELECTION_ELEMENTCheckbox or radio button stateConsent flags, option choices
QUERY, QUERY_RESULTAnswer to a natural-language questionTargeted extraction without templates
LAYOUT blocksTitles, headers, paragraphs, listsReading order for chunking and summarization
Core Textract block types and their role in automation

Textract APIs and feature types

Amazon Textract is organized into purpose-specific APIs so that teams pay only for the analysis they need. The general DetectDocumentText operation returns text only, while AnalyzeDocument accepts feature flags such as TABLES, FORMS, QUERIES, SIGNATURES and LAYOUT that can be combined in one request.

Specialized operations return normalized fields for common document classes. AnalyzeExpense targets invoices and receipts and labels fields such as vendor name, total and line items, and AnalyzeID reads identity documents such as driver licenses and passports. The AnalyzeLending workflow classifies and extracts mortgage packages that mix many document types.

Operation or featureBest suited forOutput character
DetectDocumentTextPlain text capture, search indexingLines and words only
AnalyzeDocument with FORMSApplications, claims, onboarding formsKey-value pairs and checkboxes
AnalyzeDocument with TABLESStatements, price lists, reportsCells with row and column spans
AnalyzeDocument with QUERIESSpecific fields on variable layoutsAnswers to posed questions
AnalyzeExpenseInvoices and receiptsNormalized summary and line-item fields
AnalyzeIDIdentity documentsStandard identity fields
Choosing a Textract operation

Custom queries through adapters let a team fine-tune query behavior on its own sample documents. An adapter is trained on annotated pages and then referenced at inference time, which improves accuracy on unusual layouts without building a model from scratch.

Amazon Textract sits between traditional OCR engines and full intelligent document processing platforms. It performs extraction well but leaves classification, validation, business rules and exception handling to the surrounding workflow, which is why it is usually combined with orchestration services and review steps.

ApproachStrengthMain limitation
Classic OCR engineCheap, local, fast text captureNo structure, no field semantics
Amazon TextractStructured extraction as a managed APIRequires AWS and custom post-processing
Azure AI Document IntelligenceComparable prebuilt and custom modelsTied to the Azure ecosystem
Template-based capturePrecise on fixed layoutsBreaks when layouts change
Multimodal language modelFlexible reasoning over contentLess predictable output and geometry
Textract versus neighboring technologies

A common modern pattern uses Textract for reliable text and geometry and then passes the layout-ordered text to a language model for structured output generation. This hybrid keeps the auditability of coordinates while gaining semantic flexibility for fields that no prebuilt API covers.

Building Textract into an automated workflow

A production pipeline around Amazon Textract follows a capture, extract, validate, route sequence. Documents arrive in an S3 bucket, an event triggers an AWS Lambda function or AWS Step Functions state machine, Textract runs asynchronously, and the results are parsed into a canonical schema before they reach an ERP, CRM or case management system.

  • Classify first when one inbox receives mixed document types, so that each type receives the right feature set.
  • Apply confidence thresholds per field rather than per page, because one weak value should not block a strong record.
  • Validate against business data, such as matching an invoice total to a purchase order or a tax identifier to a vendor master.
  • Route exceptions to people through Amazon Augmented AI or an equivalent human approval gate.
  • Store raw JSON responses alongside the final record to support audit, reprocessing and model comparison.

The decision table below shows how a typical pipeline treats extracted values by confidence.

Field confidenceValidation resultWorkflow action
Above 95Passes business rulesStraight-through posting
Above 95Fails business rulesException queue for review
80 to 95Passes business rulesSampled human verification
Below 80Any resultMandatory human review
Example confidence routing policy

These thresholds are illustrative starting points. Teams calibrate them on a labeled sample, because confidence scores are not calibrated probabilities and their meaning varies by document class and field.

Limitations, costs and common mistakes

Amazon Textract performs best on clean, well-lit, upright scans at adequate resolution. Handwriting support is narrower than printed text support, language coverage is limited compared with general OCR engines, and dense multi-column layouts or nested tables still require careful post-processing.

Pricing is charged per page and per feature, so enabling every feature on every page multiplies cost quickly. Asynchronous jobs also have service quotas on transactions per second and concurrent jobs, which matter when a backlog of millions of pages is processed in a short window.

SymptomLikely causeRemedy
Fields mapped to wrong labelsNaive parsing of key-value blocksFollow relationship identifiers precisely
Unexpected billsAll features enabled by defaultSelect features per document class
Throttling errorsQuota exceeded during bulk loadsQueue requests with backoff and retries
Low accuracy on faxesLow resolution and skewImprove capture quality before extraction
Silent bad dataNo validation after extractionAdd business rule checks and review
Frequent problems and their remedies

Data residency and privacy also deserve attention. Documents leave the originating system for an AWS Region, so regulated organizations confirm the Region, encryption settings and data-usage opt-outs before sending personal or financial records.

A plain-language summary

Amazon Textract is like a very fast clerk who reads paperwork and types it into a spreadsheet. It does not only copy the words. It also notices which answer belongs to which question on a form and keeps the rows and columns of a table in order.

The clerk also says how sure it is about each answer. When it is unsure, a person checks that item, so the work stays both quick and accurate.

An example from practice

A mid-sized insurance company receives about 8,000 claim forms per week by email and post. Scanned files land in an S3 bucket, a Step Functions workflow calls AnalyzeDocument with the FORMS, TABLES and QUERIES features, and a parser maps fields such as policy number, incident date and claimed amount into the claims system.

Each field is checked against the policy database. Records with all fields above the threshold and valid policy numbers post automatically, while the rest go to a review queue where staff correct only the highlighted values. After calibration, the team reports that most forms pass without manual keying, and reviewers spend their time on genuinely ambiguous claims instead of retyping clean ones.