Image-to-Text
Transformers
Safetensors
Turkish
lighton_ocr
image-text-to-text
ocr
document-understanding
turkish
enterprise
vision-language
werea
Instructions to use GoktugD/Werea-DocOCR-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GoktugD/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="GoktugD/Werea-DocOCR-1B")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("GoktugD/Werea-DocOCR-1B") model = AutoModelForMultimodalLM.from_pretrained("GoktugD/Werea-DocOCR-1B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| 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 | |
| > ℹ️ Bu, [Werea-co/Werea-DocOCR-1B](https://huggingface.co/Werea-co/Werea-DocOCR-1B) modelinin GoktugD profilindeki aynasıdır; asıl geliştirme Werea-co altında sürer. | |
| # 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> | |