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:

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
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

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.

“The solution implements a six-stage document processing pipeline orchestrated by AWS Step Functions”summary, stated
“The Cataloging stage converts validated content into Excel workbooks for business team consumption, completing the end-to-end workflow.”summary, stated

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.

“The architecture combines Amazon Bedrock (specifically Anthropic's Claude 3 models) for multi-modal document understanding with Amazon Augmented AI (Amazon A2I) for human-in-the-loop validation”summary, stated
“This stage acknowledges that LLM extraction alone may not be sufficient for business compliance requirements.”summary, stated

Models used: Anthropic Claude 3 · Amazon Bedrock · Rhubarb

Scale

Alternatives considered (roads not taken)

Traditional document extraction software

Rejected because: It often lacks support for many languages used by multinational companies.

“documents from regions worldwide in languages such as Arabic, Chinese, Russian, or Hindi that traditional document extraction software cannot handle effectively.”summary, stated

LLM extraction without human validation

Rejected because: Sensitive business documents require review and correction before cataloging.

“routes results to human reviewers for validation before final cataloging.”summary, stated

Patterns

human-in-the-loop-gate (governance)

Amazon A2I routes extracted document data to human reviewers for validation and correction.

“Human reviewers use a custom ReactJS UI to efficiently review and validate extracted information against the original document.”summary, stated

tool-use-orchestration (architecture)

Step Functions orchestrates S3, DynamoDB, Bedrock, business rules, A2I, and Excel cataloging.

“serverless components including Step Functions for orchestration, Lambda functions for business logic, and DynamoDB for state tracking”summary, stated

safety-policy-enforcement (governance)

Business rules validate table formats, columns, and product-code values before review and cataloging.

“Examples include table format detection (such as identifying invoice transaction tables) or column validation (verifying that product codes contain valid values).”summary, stated

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.

“balances automation with accuracy requirements for sensitive business documents.”summary, stated

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.

“This structured approach enables reliable downstream processing and integration with business systems.”summary, stated

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.

“Since Claude V3 models only natively support image formats (JPEG, PNG, GIF), the framework internally handles conversion of PDF and TIF documents”summary, stated

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.

“automatic re-prompting logic to rephrase user prompts when initial extraction attempts fail”summary, stated

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

“The setup requires creating a private workforce with two worker teams ("primary" and "quality"), suggesting a tiered review process for quality assurance.”summary, stated

Outcomes

The case is a reference architecture and cites market demand rather than production throughput.

“providing a resilient end-to-end document processing workflow.”summary, stated