MoganOCR-TR

TurkishOCR-Bench Buy Me a Coffee

MoganOCR-TR

MoganOCR-TR is a 2B-parameter OCR model for Turkish documents. It takes one page image and writes the whole page in reading order as Markdown, with tables as HTML and formulas as LaTeX. It is a full fine-tune of Qwen3.5-2B, vision encoder included, on 357,763 pages of which 77% are Turkish.

On TurkishOCR-Bench it scores 89.9, fourth of 18 models and first among OCR-specific models, ahead of general models hundreds of times its size. On Turkish text alone it is second, behind only GPT-6.1 Sol.

Output format

Content Format
Text, headings, lists Markdown. One paragraph per line; words hyphenated at line ends are joined.
Tables HTML <table>, merged cells as rowspan / colspan
Formulas LaTeX, inline $...$ and block $$...$$
Running header / footer <header>...</header> and <footer>...</footer>

Everything visible on the page is transcribed as it appears, including page numbers, footnotes and watermarks. Handwriting is transcribed as written; the writer's spelling mistakes are not corrected.

Usage

The prompt is always Sayfayı markdown olarak yaz. ("Write the page as markdown."). Keep thinking off (the chat template default), decode greedily and allow up to 8,000 new tokens.

vLLM

vllm serve moganai/MoganOCR-TR --max-model-len 32768 --limit-mm-per-prompt '{"image": 1, "video": 0}'
import base64, requests

img = base64.b64encode(open("page.png", "rb").read()).decode()
r = requests.post("http://localhost:8000/v1/chat/completions", json={
    "model": "moganai/MoganOCR-TR",
    "temperature": 0,
    "max_tokens": 8000,
    "chat_template_kwargs": {"enable_thinking": False},
    "messages": [{"role": "user", "content": [
        {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img}"}},
        {"type": "text", "text": "Sayfayı markdown olarak yaz."},
    ]}],
})
print(r.json()["choices"][0]["message"]["content"])

MTP: The repository includes an MTP head trained for this model (mtp.safetensors). Enable it in vLLM with --speculative-config '{"method": "mtp", "num_speculative_tokens": 3}'. Decoding is 1.73× faster for single requests and 1.22× faster with 64 concurrent requests (RTX PRO 6000).

Transformers

from PIL import Image
from transformers import AutoModelForImageTextToText, AutoProcessor

model_id = "moganai/MoganOCR-TR"
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
processor = AutoProcessor.from_pretrained(model_id)

messages = [{"role": "user", "content": [
    {"type": "image", "image": Image.open("page.png")},
    {"type": "text", "text": "Sayfayı markdown olarak yaz."},
]}]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=True,
                                       return_dict=True, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=8000, do_sample=False)
print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))

The processor accepts images up to 4,194,304 pixels by default, so an A4 page at 200 dpi goes in unscaled (about 3,800 visual tokens).

Repetition: on some pages the model can get stuck repeating the same text until it reaches the token limit. If this happens, try repetition_penalty=1.15. The results below were obtained without it.

Examples

Model outputs on TurkishOCR-Bench pages, rendered. The model has not seen these pages in training.

Academic page with a table Academic page with block formulas Scanned Official Gazette page from 2001

Results

TurkishOCR-Bench has 488 hard pages from 368 documents in 10 categories (academic, table, formula, scanned, old and new Official Gazette, book, receipt/invoice/form, slide, handwriting), with human-verified ground truth and 115,116 unit tests. The main score is TOB = (Text_TR + Table + Formula) / 3: tables by TEDS, block formulas by CDM, and Text_TR as the geometric mean of unit-test accuracy and page usability on Turkish text.

TOB score of 18 models

The pages were chosen because models struggle on them, so these scores compare models; they are not the accuracy to expect on an average document. MoganOCR-TR was built by the team that built the benchmark. The training set was checked for overlap with it, every model is scored by the same deterministic rules, and the raw outputs of all 18 models are released with the benchmark.

License

Apache 2.0

Citation

@article{tasdemir2026moganocr,
  title   = {MoganOCR-TR and TurkishOCR-Bench: A Vision-Language OCR Model and Page-Level Evaluation Set for Turkish Document Parsing},
  author  = {Aleyna Tasdemir and Furkan Yilmaz and Muhammed Faruk Gozay},
  year    = {2026}
}


MoganOCR-TR (Türkçe)

MoganOCR-TR, Türkçe belgeler için 2B parametreli bir OCR modelidir. Tek bir sayfa görüntüsü alır ve bütün sayfayı okuma sırasıyla Markdown olarak yazar; tablolar HTML, formüller LaTeX olur. Qwen3.5-2B üzerine, görsel kodlayıcı dahil tam ince ayardır; %77'si Türkçe olan 357.763 sayfayla eğitildi.

TurkishOCR-Bench'te 89,9 alır: 18 model içinde dördüncü, OCR'a özel modeller içinde birinci; kendisinden yüzlerce kat büyük genel modellerin önündedir. Yalnız Türkçe metinde, GPT-6.1 Sol'un ardından ikincidir.

Çıktı biçimi

İçerik Biçim
Metin, başlık, liste Markdown. Her paragraf tek satırdır; satır sonunda bölünen kelimeler birleştirilir.
Tablo HTML <table>, birleşik hücreler rowspan / colspan ile
Formül LaTeX, satır içi $...$ ve blok $$...$$
Sayfa üst / alt bilgisi <header>...</header> ve <footer>...</footer>

Sayfada görünen her şey göründüğü gibi yazılır: sayfa numarası, dipnot ve filigran dahil. El yazısı yazıldığı gibi aktarılır; yazarın yazım hataları düzeltilmez.

Kullanım

İstem her zaman Sayfayı markdown olarak yaz. olmalıdır. Düşünme kapalı kalır (sohbet şablonunun varsayılanı), çözme açgözlüdür ve en çok 8.000 yeni token üretilir.

vLLM

vllm serve moganai/MoganOCR-TR --max-model-len 32768 --limit-mm-per-prompt '{"image": 1, "video": 0}'
import base64, requests

img = base64.b64encode(open("sayfa.png", "rb").read()).decode()
r = requests.post("http://localhost:8000/v1/chat/completions", json={
    "model": "moganai/MoganOCR-TR",
    "temperature": 0,
    "max_tokens": 8000,
    "chat_template_kwargs": {"enable_thinking": False},
    "messages": [{"role": "user", "content": [
        {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img}"}},
        {"type": "text", "text": "Sayfayı markdown olarak yaz."},
    ]}],
})
print(r.json()["choices"][0]["message"]["content"])

MTP: Depoda bu model için eğitilmiş bir MTP kafası (mtp.safetensors) bulunur. vLLM'de --speculative-config '{"method": "mtp", "num_speculative_tokens": 3}' ile açılır. Çözme tek istekte 1,73×, 64 eşzamanlı istekte 1,22× hızlanır (RTX PRO 6000).

Transformers

from PIL import Image
from transformers import AutoModelForImageTextToText, AutoProcessor

model_id = "moganai/MoganOCR-TR"
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
processor = AutoProcessor.from_pretrained(model_id)

messages = [{"role": "user", "content": [
    {"type": "image", "image": Image.open("sayfa.png")},
    {"type": "text", "text": "Sayfayı markdown olarak yaz."},
]}]
girdi = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=True,
                                      return_dict=True, return_tensors="pt").to(model.device)
cikti = model.generate(**girdi, max_new_tokens=8000, do_sample=False)
print(processor.decode(cikti[0, girdi["input_ids"].shape[1]:], skip_special_tokens=True))

İşlemci varsayılan olarak 4.194.304 piksele kadar görüntü kabul eder; 200 dpi'lik bir A4 sayfa küçültülmeden girer (yaklaşık 3.800 görsel token).

Tekrar sorunu: Model bazı sayfalarda aynı metni token sınırına kadar tekrarlayabilir. Bu durumda repetition_penalty=1.15 deneyin. Aşağıdaki sonuçlar bu ayar olmadan alınmıştır.

Örnekler

TurkishOCR-Bench sayfalarında model çıktıları, işlenmiş hâlde. Model bu sayfaları eğitimde görmedi.

Tablolu akademik sayfa Blok formüllü akademik sayfa 2001 tarihli taranmış Resmî Gazete sayfası

Sonuçlar

TurkishOCR-Bench, 10 kategorideki (akademik, tablo, formül, taranmış, eski ve yeni Resmî Gazete, kitap, fiş/fatura/form, slayt, el yazısı) 368 belgeden 488 zor sayfa, insan onaylı doğru metin ve 115.116 birim testten oluşur. Ana skor TOB = (Metin_TR + Tablo + Formül) / 3'tür: tablolar TEDS, blok formüller CDM ile ölçülür; Metin_TR ise Türkçe metinde birim test doğruluğu ile sayfa kullanılabilirliğinin geometrik ortalamasıdır.

18 modelin TOB-Skoru

Sayfalar modellerin zorlandığı sayfalardan seçildi; bu skorlar modelleri karşılaştırır, ortalama bir belgede beklenecek doğruluğu göstermez. MoganOCR-TR, benchmarkı hazırlayan ekip tarafından geliştirildi. Eğitim kümesi benchmarkla örtüşme açısından denetlendi, bütün modeller aynı deterministik kurallarla puanlandı ve 18 modelin ham çıktıları benchmarkla birlikte yayımlandı.

Lisans

Apache 2.0

Atıf

@article{tasdemir2026moganocr,
  title   = {MoganOCR-TR and TurkishOCR-Bench: A Vision-Language OCR Model and Page-Level Evaluation Set for Turkish Document Parsing},
  author  = {Aleyna Tasdemir and Furkan Yilmaz and Muhammed Faruk Gozay},
  year    = {2026}
}
Downloads last month
287
Safetensors
Model size
2B params
Tensor type
BF16
·
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for moganai/MoganOCR-TR

Finetuned
Qwen/Qwen3.5-2B
Finetuned
(702)
this model
Finetunes
1 model
Quantizations
6 models

Space using moganai/MoganOCR-TR 1

Collection including moganai/MoganOCR-TR