Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

docextract

Python 3.11 License: MIT Code style: ruff Type Checked: mypy

A verified invoice and receipt extraction pipeline that combines PDF/OCR layout parsing, bounding-box-grounded LLM extraction, deterministic arithmetic/tax/checksum validation rules, field-level confidence scoring, and a human-in-the-loop review queue.


Architecture

flowchart LR
    IN["PDF / PNG / JPG upload"] --> ING["Ingest<br/>MIME sniff, page split, SHA-256 dedupe"]
    ING --> PRE["Preprocess<br/>deskew, denoise, 300 DPI"]
    PRE --> LAY["Layout + OCR<br/>PDF text layer or OCR fallback<br/>words + bounding boxes"]
    LAY --> EXT["Extraction<br/>VLM/LLM to Pydantic schema<br/>with bbox grounding"]
    EXT --> VAL["Validation engine<br/>math, dates, tax, checksums"]
    VAL --> CONF["Confidence scoring<br/>OCR x LLM x rule agreement"]
    CONF -->|"all checks pass"| DB[("SQLite / Postgres<br/>verified records")]
    CONF -->|"fails or low confidence"| RQ["Human review queue<br/>side-by-side UI"]
    RQ -->|"corrections"| DB
    DB --> OUT["REST API, CSV/JSON export,<br/>HMAC webhooks"]
Loading

Quickstart

python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e .[dev]

pytest -q
ruff check .
mypy

License

MIT © 2026 Paul Andrei Datinguinoo

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages