Multilingual Document Processing Pipeline with Human-in-the-Loop Validation
a2i · Tech · 2024 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: Multilingual document processing
Multinational companies need to extract structured data from invoices, contracts, and documents in languages traditional extraction tools do not support, while preserving validation for sensitive business data.
Constraints:
- Documents may be in Arabic, Chinese, Russian, Hindi, or other languages unsupported by legacy extraction software.
- Business rules and schema compliance are required before cataloging results.
- Sensitive documents need human validation.
- Claude V3 accepts image formats natively, requiring PDF/TIF conversion.
Architecture
The AWS reference architecture uses Step Functions to orchestrate S3 ingestion, DynamoDB state, Claude extraction through Bedrock and Rhubarb, custom business rules, A2I reshaping, human review in a React UI, and cataloging to Excel workbooks.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR s3-acquisition["S3 Acquisition"] step-functions-orchestrator["Step Functions Orchestrator"] dynamodb-state-store["DynamoDB State Store"] bedrock-claude-extraction["Bedrock Claude Extraction"] business-rules["Business Rules"] a2i-human-review["A2I Human Review"] cataloging-stage["Cataloging Stage"] s3-acquisition --> step-functions-orchestrator step-functions-orchestrator --> dynamodb-state-store step-functions-orchestrator --> bedrock-claude-extraction step-functions-orchestrator --> business-rules dynamodb-state-store --> step-functions-orchestrator bedrock-claude-extraction --> step-functions-orchestrator bedrock-claude-extraction --> business-rules business-rules --> bedrock-claude-extraction business-rules --> a2i-human-review a2i-human-review --> business-rules a2i-human-review --> cataloging-stage cataloging-stage --> a2i-human-review
Components
| Component | Role | Interacts with |
|---|---|---|
S3 Acquisition |
Ingests documents and triggers processing events. | Step Functions Orchestrator |
Step Functions Orchestrator |
Coordinates acquisition, extraction, rules, reshaping, review, and cataloging stages. | DynamoDB State Store, Bedrock Claude Extraction, Business Rules |
DynamoDB State Store |
Tracks document metadata and processing status. | Step Functions Orchestrator |
Bedrock Claude Extraction |
Extracts structured JSON from multilingual documents using Claude models and Rhubarb. | Step Functions Orchestrator, Business Rules |
Business Rules |
Apply domain-specific checks such as table and column validation. | Bedrock Claude Extraction, A2I Human Review |
A2I Human Review |
Routes extracted content to human annotators through a custom UI. | Business Rules, Cataloging Stage |
Cataloging Stage |
Produces final Excel workbooks for business users. | A2I Human Review |
Data flow
S3 upload triggers Step Functions. Metadata is stored in DynamoDB, documents are converted and sent to Claude with a JSON schema, extracted JSON lands in S3, custom rules validate it, A2I reviewers correct it, and cataloging outputs Excel workbooks.
Why this architecture
The pipeline combines multimodal LLM extraction with deterministic rules and human review because multilingual document understanding is hard to fully automate safely, and business outputs require validated structured data.
Models used: Anthropic Claude 3 · Amazon Bedrock · Rhubarb
Scale
- The cited IDP market grows from 1,285 million in 2022 to 7,874 million by 2028.“growing from 1,285 million in 2022 to a projected 7,874 million by 2028”summary, stated
- The pipeline has six stages.“The solution implements a six-stage document processing pipeline orchestrated by AWS Step Functions”summary, stated
- A2I setup uses two worker teams.“creating a private workforce with two worker teams ("primary" and "quality")”summary, stated
Alternatives considered (roads not taken)
Traditional document extraction software
Rejected because: It often lacks support for many languages used by multinational companies.
LLM extraction without human validation
Rejected because: Sensitive business documents require review and correction before cataloging.
Patterns
human-in-the-loop-gate (governance)
Amazon A2I routes extracted document data to human reviewers for validation and correction.
tool-use-orchestration (architecture)
Step Functions orchestrates S3, DynamoDB, Bedrock, business rules, A2I, and Excel cataloging.
safety-policy-enforcement (governance)
Business rules validate table formats, columns, and product-code values before review and cataloging.
Tradeoffs
Use LLM extraction plus human review
Chose Claude extraction routed through A2I validation over Fully automated extraction.
Rationale: Human validation protects sensitive business-document workflows.
Use schema-controlled JSON extraction
Chose Prompts with JSON schema definitions over Free-form extraction output.
Rationale: Structured JSON supports business rules and downstream cataloging.
Gotchas (what bit them)
Enterprise documents need format conversion before multimodal LLM extraction.
Root cause: Claude V3 models natively support image formats, not all document formats.
Resolution: Use Rhubarb to convert PDF and TIF documents to compatible image formats.
LLM extraction can fail schema or business-rule requirements.
Root cause: The model may produce incomplete or invalid structured data.
Resolution: Use JSON schema prompts, automatic re-prompting, business rules, and human review.
Evaluation
The reference architecture evaluates through business rules, human validation, status tracking, and quality worker teams.
Metrics: schema validity · business-rule validity · human corrections · processing status
Outcomes
- The architecture processes multilingual documents into structured JSON.
- Human reviewers validate results before cataloging.
- The final output is an Excel workbook for business teams.
The case is a reference architecture and cites market demand rather than production throughput.