Tesseract Russian OCR: which model reads your scans
98%
letters right with rus, empty pages retried
Without -l rus, nothing
Tesseract reads English unless you name the language:
0.0% letters right with the default eng
89.4% with -l rus
eng has no Cyrillic letters, so not one came out right.
Modern spelling: the model barely matters
Proofread scans from 12 books, printed 1919 to 1992. Letters right, of 89,453:
| Model | Size | Right |
|---|---|---|
| rus, legacy engine | 19.9 MB | 86.6% |
| rus+eng | 8.0 MB | 88.7% |
| script/Cyrillic, best | 36.7 MB | 89.3% |
| rus, fast | 3.9 MB | 89.4% |
| rus, best | 15.3 MB | 89.6% |
Every model lost the same book: its 4 pages came back empty.
How I tested it
- Pages: ru.wikisource scans whose text was proofread (level 3) or also checked by a second person (level 4). Books picked by a seeded shuffle, not by me, one file per work.
- Each page is a real scan: a DjVu file, or a PDF page that holds a full-page image. Pages were drawn at the scan's own width, up to 1920 px.
-
One plain
tesseractrun per page and model, default settings, Tesseract 5.5.4. - A letter counts when it is found in order. Only Cyrillic letters count, in lower case, with ё as е.
Empty page? Retry it with Sauvola
The empty book is a grey 1922 scan with dark edges:
0.0% with the default settings
99.0% with
-c thresholding_method=2
That is Sauvola, a local black and white step. Use it only on empty pages:
| Sauvola on | rus | best |
|---|---|---|
| No page | 89.4% | 89.6% |
| Every page | 95.4% | 95.6% |
| Empty pages only | 98.1% | 98.3% |
On every page, it took a 1944 scan from 89.4% to 40.2%. Empty means fewer than 100 Cyrillic letters.
Old spelling: no model reads ѣ
One printed line from an 1886 journal:
| Model | Read |
|---|---|
| Proofread |
сказалъ: „коли вамъ негдѣ пріютиться, вотъ за канавой
трактиръ
|
| rus, best |
валъ: „коли вамъ негд® прютиться, вотъ за канавой
трактиръ
|
| rus, fast |
залъ: „коли вамъ негдз приютиться, вотъ за канавой
трактиръ
|
| script/Cyrillic, best |
валъ: „коли вамъ негдЪ пріютиться, вотъ за канавой
трактиръ
|
The first word starts mid-word in print. ѣ is not in any model, and only script/Cyrillic has і.
12 books, 1862 to 1913. Letters right, of 73,608, with ѣ counted as its own letter:
| Model | Has і | Right |
|---|---|---|
| rus, fast | No | 93.2% |
| rus, best | No | 94.5% |
| script/Cyrillic, best | Yes | 95.5% |
What comes out instead of ѣ?
- ѣ is in the proofread text 1,353 times, і 633 times.
- The fast rus printed ѣ as ф 464 times and as ъ 255 times.
- script/Cyrillic best printed і right 617 times.
- To get ѣ back, you need to train a model: train Tesseract.
Install the model and run it
apt (tesseract-ocr-rus) and Homebrew (tesseract-lang) install the fast file. To use best, put it in a folder:
mkdir -p ~/tessdata
curl -L -o ~/tessdata/rus.traineddata \
https://raw.githubusercontent.com/tesseract-ocr/tessdata_best/4.1.0/rus.traineddata
tesseract page.png page --tessdata-dir ~/tessdata -l rus
In Python, with the retry for empty pages:
import os
import re
import pytesseract
TESSDATA = os.path.expanduser("~/tessdata")
config = f"--tessdata-dir {TESSDATA}"
text = pytesseract.image_to_string("page.png", lang="rus", config=config)
if len(re.findall("[а-яё]", text.lower())) < 100:
text = pytesseract.image_to_string(
"page.png", lang="rus", config=config + " -c thresholding_method=2"
)
For old spelling, use script/Cyrillic.traineddata from
the same folder of tessdata_best, with -l Cyrillic.
What I did not test
- Windows and Linux. One Mac, Tesseract 5.5.4.
- Handwriting, Church Slavonic and pages with tables or notes.
- Phone photos and screenshots.
- Ukrainian, Belarusian and other Cyrillic languages.
- Other OCR engines.
Sources
Our Actor has the same fast rus
Our Apify Actor got 87.0% of the modern letters and 86.9% of the old. It came back empty on the grey 1922 book too.
Two ways to skip the work
Run it yourself. Our Apify Actor turns scanned PDFs into Markdown, tables included.
Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. First page free.
Questions people ask
Which Tesseract model is best for Russian?
On 44 modern scans, rus got 89.4% of the letters right and rus best 89.6%. Retrying empty pages with Sauvola took them to 98.1% and 98.3%.
Can Tesseract read pre-1918 Russian spelling?
Mostly. No official model has ѣ, so it comes out as another letter. script/Cyrillic best keeps і and got 95.5% of the letters right on 46 old scans.
How do I add Russian to Tesseract?
Install tesseract-ocr-rus with apt, or tesseract-lang with Homebrew. Then pass -l rus. Without it, Tesseract reads English and gets no Russian letter right.