Project index

Document AI / financial extraction

Financial Document AI with source evidence

The system extracts financial facts from Arabic and English audited statements. Each value keeps its source reference.

Evidence
CLIENT SYSTEMPRODUCTIONPUBLISHED EVALUATION
Stack
PythonFastAPIPostgreSQLOptical character recognitionVision models
01

Context

Problem

Audited financial statements arrived as Arabic and English PDFs. The system needed structured facts, accounting consistency, and a traceable source for every accepted value.

Constraints

  • Document layouts and labels varied across filings.
  • A model answer was not sufficient evidence for a financial fact.
  • Uncertain or inconsistent values still required review.
02

System

Architecture

  1. 01

    PDF and page images

  2. 02

    Optical character recognition (OCR) and layout extraction

  3. 03

    Independent extraction passes

  4. 04

    Normalization

  5. 05

    Accounting and cross-year checks

  6. 06

    Source-grounded facts

  7. 07

    Review state when uncertain

My role

Led the technical work and owned the OCR and extraction service, evaluation path, validation rules, and source-evidence contract.

Decisions

  • Kept the model as one component inside a larger validation path.
  • Stored raw values and source references before normalization.
  • Sent failed checks to review instead of accepting them silently.
03

Validation

What failed

  • The first extraction path produced 34% accuracy on the audited-statement evaluation.
  • Adding more model output without independent checks did not establish correctness.

Tests and checks

  • Compared independent extraction passes.
  • Checked accounting identities, section totals, and cross-year consistency.
  • Retained source evidence for accepted values.
04

Outcome

Result

Accuracy improved from 34% to 94% on the audited-statement evaluation. A 22-page filing processed in 97 seconds at roughly USD 0.30 to USD 0.42.

Limits

The 34% to 94% result applies to the audited-statement evaluation. It is not a general accuracy rate for every financial document.

What I would change today

Record the dataset size, field denominator, language mix, and review treatment with each evaluation result.