Image-to-Text
Transformers
Joblib
Persian
English
document-ai
ocr
invoice
persian
enterprise
aria-ai
Instructions to use alirezaaminzadeh/docflow-invoice-parser-fa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alirezaaminzadeh/docflow-invoice-parser-fa with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="alirezaaminzadeh/docflow-invoice-parser-fa")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("alirezaaminzadeh/docflow-invoice-parser-fa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
DocFlow Invoice Parser FA
Enterprise-grade Persian invoice field extraction model configuration by Aria AI.
Model Description
DocFlow AI combines vision OCR with NLP heuristics and business-rule validation to extract structured data from Persian and bilingual financial documents. This repository hosts the production pipeline configuration and serves as the model card for the DocFlow product line.
| Component | Technology |
|---|---|
| OCR | EasyOCR (fa/en) + image preprocessing |
| Field extraction | ParsBERT NER + regex + line-based KV parsing |
| Validation | Pydantic business rules engine |
| Review workflow | Accountant approve/reject queue |
| Export | JSON, Excel (openpyxl) |
| API | FastAPI + PostgreSQL |
Intended Uses
- Accounts payable automation
- Invoice digitization for ERP integration (SAP, Rahkaran, Sepidar)
- Pilot deployments with accountant-in-the-loop review
Out-of-Scope Uses
- Legal contract analysis (see ContractGuard)
- Processing real PII in public Spaces without on-prem deployment
- Fully autonomous posting without human review
Training Data
Synthetic and anonymized invoices from docflow-invoice-samples-fa.
Evaluation Metrics (Internal Pilot)
| Field | Precision | Recall | F1 |
|---|---|---|---|
| vendor_name | 0.94 | 0.91 | 0.92 |
| invoice_number | 0.96 | 0.93 | 0.94 |
| total_amount | 0.97 | 0.95 | 0.96 |
| invoice_date | 0.89 | 0.87 | 0.88 |
| Macro avg | 0.94 | 0.92 | 0.93 |
Limitations
- Heuristic demo pipeline; accuracy varies on handwritten or low-quality scans
- Jalali date parsing does not validate calendar correctness
- Line-item table detection requires structured tabular layout
Bias & Fairness
Trained primarily on standard printed Persian invoices from manufacturing and distribution sectors. Performance may be lower on handwritten or non-standard layouts.
Demo
Interactive Space: docflow-invoice-parser-fa
Citation
@misc{docflow_invoice_parser_fa_2025,
title={DocFlow AI: Intelligent Persian Invoice Parser},
author={Aria AI Engineering Team},
year={2025},
url={https://huggingface.co/alirezaaminzadeh/docflow-invoice-parser-fa}
}
License
Apache 2.0
- Downloads last month
- 55