Image-to-Text
Transformers
Safetensors
Turkish
lighton_ocr
image-text-to-text
ocr
document-understanding
turkish
enterprise
vision-language
werea
Instructions to use Werea-co/Werea-DocOCR-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Werea-co/Werea-DocOCR-1B 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="Werea-co/Werea-DocOCR-1B")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Werea-co/Werea-DocOCR-1B") model = AutoModelForMultimodalLM.from_pretrained("Werea-co/Werea-DocOCR-1B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 3,204 Bytes
77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 77c3bf5 a582860 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | ---
language:
- tr
license: apache-2.0
pipeline_tag: image-to-text
base_model: lightonai/LightOnOCR-2-1B-base
library_name: transformers
tags:
- ocr
- document-understanding
- turkish
- enterprise
- vision-language
- werea
datasets:
- Werea-co/werea-tr-doc-ocr-enterprise-v2
---
# Werea-DocOCR-1B v2 — Türkçe Kurumsal Belge OCR (Enterprise) 📄🇹🇷
[LightOnOCR-2-1B-base](https://huggingface.co/lightonai/LightOnOCR-2-1B-base)
tabanının **12 Türkçe kurumsal belge türü × 3 çekim koşulu** ile fine-tune'u.
Sayfa görüntüsünü okuma sırasına uygun, tablolar dahil **markdown** olarak çıkarır.
v1 sürümü `revision="v1"` altında korunur.
## Belge türleri (12)
Genel vekaletname · DASK poliçesi · e-Arşiv fatura · Konut kira sözleşmesi ·
Banka dekontu · Tapu senedi · Maaş bordrosu · Kasko poliçesi · Araç tescil
bilgi formu · Resmî kurum yazısı · Ticaret sicil ilanı · SGK hizmet dökümü
## Çekim koşulları (3)
`clean` (dijital) · `scan` (tarayıcı: eğim, gürültü, toner bandı) ·
`photo` (telefon: perspektif, gölge, düşük DPI)
## Sonuçlar
72 ayrılmış test sayfasında (12 tür × 3 koşul × 2), greedy üretim:
| Model | CER (ort.) | CER (medyan) |
|---|---:|---:|
| LightOnOCR-2 taban | 64,2% | 61,6% |
| Werea-DocOCR-1B **v1** | ~8,1% | 0,16% |
| **Werea-DocOCR-1B v2** | **0,15%** | **0,15%** |
v2, v1'in zorlandığı **fotoğraf ve tarama koşullarındaki** yoğun tabloları
(SGK dökümü, bordro) çözerek ortalama CER'i %8,1'den **%0,15'e** düşürdü;
kolay koşullardaki kusursuz performansı korudu.
> ⚠️ Test sayfaları eğitimle aynı sentetik dağıtımdandır (şablon-içi ölçüm).
> Gerçek tarama/fotoğraf belgelerde doğrulama önerilir; kritik kullanımda insan kontrolü.
## Eğitim
- **Veri:** [werea-tr-doc-ocr-enterprise-v2](https://huggingface.co/datasets/Werea-co/werea-tr-doc-ocr-enterprise-v2)
— 12.960 tamamı sentetik sayfa (geçersiz-checksum TC/IBAN/plaka, kurgusal kimlikler)
- **Yöntem:** tam-parametre SFT, 1 epoch (810 adım), lr 8e-6, bf16,
gradient checkpointing + 8-bit AdamW, tek RTX 3090
## Kullanım
```python
import torch
from transformers import LightOnOcrForConditionalGeneration, LightOnOcrProcessor
model = LightOnOcrForConditionalGeneration.from_pretrained(
"Werea-co/Werea-DocOCR-1B", torch_dtype=torch.bfloat16).to("cuda")
processor = LightOnOcrProcessor.from_pretrained("Werea-co/Werea-DocOCR-1B")
conv = [{"role": "user", "content": [{"type": "image", "path": "belge.jpg"}]}]
inputs = processor.apply_chat_template(conv, add_generation_prompt=True,
tokenize=True, return_dict=True, return_tensors="pt")
inputs = {k: v.to("cuda", dtype=torch.bfloat16) if v.is_floating_point() else v.to("cuda")
for k, v in inputs.items()}
out = model.generate(**inputs, max_new_tokens=2048)
print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```
## Lisans
Apache-2.0. Taban: **lightonai/LightOnOCR-2-1B-base** (LightOn). [Werea](https://werea.co).
<div align="center"><sub>💜 <a href="https://werea.co">werea.co</a> — Fikirden üretime.</sub></div>
|