OCR-chg-fa-bf16
historical manuscript OCR for Chagatai and Persian
2 min readupdated
This model is a merged BF16 version (low-precision data format) of a LoRA checkpoint (a small add-on layer for a base model) fine-tuned to extract text from historical documents using the Arabic script. Built on top of OCRia-1 (which relies on the Qwen3.5-4B architecture), it outputs results strictly in JSON format containing text, language, and script fields. The model targets researchers, historians, and specialists working with rare Eastern manuscripts in Chagatai and Persian.
Key features
- Specialization: Full-page OCR for historical texts in Chagatai (`chg`) and Persian (`fa`).
- Architecture: Powered by Qwen3.5 (Qwen3_5ForConditionalGeneration architecture) with roughly 5.17 billion parameters.
- Ready-to-use build: Weights are fully merged with the adapter, so running the LoRA separately is unnecessary.
- Output format: Returns a structured JSON object containing the recognized text, language, and script type.
What you can do
- Archive digitization: Automatically convert scans of historical manuscripts and books into structured text.
- Historical research: Analyze and compile text corpora in Chagatai and Persian for linguistic tasks.
- Pipeline integration: Use the project's command-line tool for batch processing of page images.
Example
Running inference using the project CLI:
ocria-ocr-sft infer \
--model shbaydadaev/ocr-chg-fa-bf16 \
--image /path/to/page.jpg \
--system-prompt-file prompts/t2_recognition_system.txt \
--max-new-tokens 6144 \
--image-max-pixels 4194304 \
--prettyRead more
DetailsMetrics (first 100 test pages): CER 13.78%, WER 36.34%, valid JSON in 99% of cases.
Requirements: Training was performed on an NVIDIA RTX PRO 6000 with 96GB VRAM; inference uses `device_map="auto"`.
Limitations: Evaluation was conducted on a subset of 100 pages; the model may produce repetitions or incomplete JSON on complex pages.
Dataset: 3,423 training pages, 583 validation pages, and 328 test pages (roughly 40% Chagatai and 60% Persian).










Comments