Qwen2.5-VL 7B Arabic Invoice Extractor
Model Description
This is a fine-tuned version of Qwen2.5-VL-7B-Instruct specifically trained for extracting structured data from Arabic invoices. The model uses LoRA (Low-Rank Adaptation) to efficiently fine-tune the base model for this specialized task.
Training Details
- Base Model: Qwen/Qwen2.5-VL-7B-Instruct
- Training Method: LoRA fine-tuning with Unsloth
- Dataset: Arabic invoice images
- Target Fields:
date
: Invoice date in YYYY-MM-DD formatclient
: Client/buyer name (preferring Arabic names)referenceNumber
: Invoice numbertotalAmount
: Amount before VAT (float)
Usage
from transformers import AutoModelForVision2Seq, AutoProcessor
from peft import PeftModel
import torch
from PIL import Image
# Load base model
base_model = AutoModelForVision2Seq.from_pretrained(
"Qwen/Qwen2.5-VL-7B-Instruct",
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "pxoooArt/qwen2.5-vl-7b-arabic-invoice-extractor-v2")
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct", trust_remote_code=True)
# Process image
image = Image.open("invoice.jpg")
# ... (see handler.py for complete inference code)
Expected Output Format
{
"date": "2024-03-15",
"client": "عبايات النور",
"referenceNumber": "INV-2024-001",
"totalAmount": 1250.50
}
Performance
- Optimized for Arabic business documents
- Handles various invoice formats common in Saudi Arabia
- Accurate date parsing with middle-number-as-month logic
- Reliable extraction of Arabic client names
Handler Code
The model includes a complete handler for deployment. See the repository files for handler.py
.
License
This model inherits the license from the base Qwen2.5-VL model.
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
Model tree for pxoooArt/qwen2.5-vl-7b-arabic-invoice-extractor-v2
Base model
Qwen/Qwen2.5-VL-7B-Instruct