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
| """Pydantic schemas for REST API.""" | |
| from __future__ import annotations | |
| from datetime import datetime | |
| from typing import Any | |
| from pydantic import BaseModel, Field | |
| class ExtractResponse(BaseModel): | |
| invoice: dict[str, Any] | |
| validation: dict[str, Any] | None | |
| review_id: str | None = None | |
| class ReviewSummary(BaseModel): | |
| id: str | |
| vendor_name: str | None | |
| invoice_number: str | None | |
| total_amount: float | None | |
| currency: str | |
| confidence: float | |
| status: str | |
| created_at: datetime | |
| reviewer: str | None = None | |
| class ReviewDetail(ReviewSummary): | |
| invoice_data: dict[str, Any] | |
| validation_data: dict[str, Any] | None | |
| review_notes: str | None = None | |
| reviewed_at: datetime | None = None | |
| class ReviewAction(BaseModel): | |
| reviewer: str = Field(..., min_length=1, max_length=100) | |
| notes: str | None = None | |
| class HealthResponse(BaseModel): | |
| status: str = "ok" | |
| version: str = "1.0.0" | |
| database: str = "connected" | |