msbayindir

Research · Turkish OCR

TR-OCR-Markdown

A LoRA adapter that turns Turkish document images into Markdown with the original heading, list, and table structure.

Research
  • Python
  • LoRA
  • DeepSeek-OCR-2
0.4% CER
Born-digital legislation · 55 pages
25.4% CER
Scanned Official Gazette · 50 pages
v0.4
LoRA adapter for DeepSeek-OCR-2

Data flow

  1. InputSingle page image
  2. ModelDeepSeek-OCR-2 + LoRA
  3. OutputHeadings, lists, and tables
  4. DownstreamSearch and document processing

Technical walkthrough

Problem

Plain-text OCR can lose the relationship between headings and paragraphs or between a table cell and its row. In Turkish legislation and institutional documents, those relationships matter for downstream search and analysis.

Model and data

The adapter fine-tunes DeepSeek-OCR-2 with LoRA to generate Markdown from page images. Training relied on fictional Turkish documents as well as examples from born-digital PDFs, scans, receipts, and invoices.

Evaluation

The model card reports character error rate (CER) by document type on held-out test sets. The two results here illustrate the performance gap between born-digital pages and more challenging historical scans.

Limitations

The model was released for research and prototyping. The model card lists handwriting, complex equations, merged table cells, and rotated pages as out of scope.

Document to Markdown example

Open the fictional example to see how a heading and table are represented in Markdown.

Show sample document and output

Sample document

Stok sayımı
ÜrünAdet
Defter24
Kalem36

Illustrative Markdown output

# Stok sayımı

| Ürün | Adet |
| --- | ---: |
| Defter | 24 |
| Kalem | 36 |
Download Markdown example

How I preserve table structure in Turkish document OCR