The Modern State of Document Intelligence
Traditional OCR engines rely on rigid bounding boxes and heuristic zone templates that break the moment a supplier changes a margin or font weight.
Why Multimodal Models Change Everything
With models like Gemini 3.6 and 3.7 Flash, extraction pipelines no longer just "read pixels", they understand semantic context:
- Table Integrity: Nested line items, tax breakdowns, and discounts are extracted cleanly into arrays.
- Key-Value Normalization: Dates, currency codes, and VAT IDs are standardized automatically.
- Resilience: Skewed scans, mobile camera photos, and multi-page tables are parsed effortlessly.
{
"invoiceNumber": "INV-2025-089",
"totalAmount": 1420.50,
"currency": "USD",
"lineItems": [
{ "description": "Cloud Processing Tier", "quantity": 1, "unitPrice": 1200.00 },
{ "description": "SSL Certificate Provisioning", "quantity": 1, "unitPrice": 220.50 }
]
}
Handling Multi-Currency and Tax Variations
A single accounts-payable inbox rarely sees invoices in one currency or one tax regime. A US contractor's invoice quotes a flat total in USD; a German supplier's includes 19% VAT broken out as its own line; a UK vendor references a VAT number instead of a US-style tax ID. Treating these as one universal schema loses information, treating each vendor as a bespoke integration doesn't scale. The practical middle ground:
- Canonical currency field, original preserved: Every extracted amount carries both the original currency code (`EUR`, `GBP`, `USD`) and, where a conversion is needed for reporting, a separately tracked converted value with the rate and date used, never silently overwriting the source figure.
- Tax as a structured sub-object, not a flat number: `{ "taxType": "VAT", "rate": 0.19, "amount": 220.50, "taxId": "DE123456789" }` survives a downstream audit far better than a single `tax: 220.50` field with no context.
- Regional field mapping: A vendor's "Rechnungsnummer" and another's "Invoice No." both map to the same canonical `invoiceNumber` field, so a finance team's downstream queries never need to know which language the source document was in.
Validation Rules That Catch Errors Before They Reach Your Books
Extraction accuracy matters less than extraction accuracy combined with knowing when to distrust a result. A production pipeline pairs the AI extraction with deterministic sanity checks that run before anything reaches accounting software:
- Arithmetic reconciliation: Line items plus tax should equal the stated total, within rounding tolerance. A mismatch flags the document for review instead of posting a silently wrong figure.
- Duplicate detection: The same invoice number from the same vendor arriving twice, a common source of double payment, is caught by hashing on `(vendorId, invoiceNumber, totalAmount)` before insertion.
- Plausibility bounds: A recurring monthly SaaS invoice that suddenly extracts as $142,000 instead of $1,420 (a decimal-shift OCR error classic ports have suffered from for decades) is caught by comparing against that vendor's historical range, not accepted at face value.
- Required-field completeness: An invoice missing a due date or vendor tax ID is routed to manual review rather than inserted with a null that breaks a downstream report.
These checks turn "the AI extracted it" into "the AI extracted it and a human only sees the 2% that actually need attention", which is the difference between a demo and something an accounts-payable team will actually trust.
Routing Extracted Fields to the Right System
Once a field is extracted and validated, it rarely stays in one place. The total and due date typically flow to an accounts-payable queue for approval; the vendor tax ID feeds a compliance record; line items feed cost-center reporting. Designing the extraction output as flat, well-typed JSON, rather than a single blob of text, is what makes that fan-out trivial: each downstream system reads only the fields it needs, and a schema change in one consumer never requires re-parsing the original document.
From Manual Entry to Automated Invoice Data Extraction
Before any of this, most accounts-payable teams still handle invoices by hand: someone opens each PDF, reads the invoice number, vendor, and total off the page, and retypes them into the accounting system instead of using software that can extract data from invoices directly. That manual entry step is slow, and every retyped invoice number is another chance for a transposed digit. Machine learning changes what that first step looks like, not the destination: the same information from invoices, vendor, invoice number, line items, tax, still ends up in the same accounting software, just extracted directly instead of typed in by hand. Automating the extraction removes the manual entry; the validation rules above still catch the genuine edge cases a human needs to see.
Getting Started with DataFromFile
DataFromFile is a web app and API that turns PDFs, images, and spreadsheets into structured data you can export as Excel, CSV, or JSON.