Osegi
AI·2 min read

Tesseract 5 Fine-Tuned to Read Mansi, Cutting OCR Errors 20-Fold

Russian researchers fine-tuned the open-source Tesseract 5 engine for Mansi print, cutting character errors from 18.5% to 0.85%. The model is free on Hugging Face.

Printed page of Mansi text with macron vowels being scanned and converted to digital text by OCR software.
Image: Хабр

Researchers at the Ugra Research Institute of Information Technologies (YuNIIIT) have fine-tuned the open-source Tesseract 5 OCR engine to read printed Mansi. The character error rate fell from 18.5% to 0.85%, roughly a twentyfold improvement. The model is published on Hugging Face and can be used now.

The work is part of the Mansi Language Corpus project. In the first stage, the team built 300,000 parallel sentences from scratch and trained a neural network to translate between Russian and Mansi. OCR is the next step: most Mansi texts, including books, textbooks, folklore collections and newspaper files, exist only on paper. Retyping them by hand is slow and expensive, and the few native speakers are better used for translation and expert review.

Why standard OCR fails

Mansi uses Cyrillic with extra characters: long vowels marked with a macron, such as а̄, о̄, ӯ, э̄ and ы̄, and the letter ӈ for the sound «ng». Vowel length changes meaning, so losing a macron can turn one word into another. The standard Russian Tesseract model does not know these characters. It drops the macron or turns the letter into garbage, and it misreads about 18 of every 100 characters. A second problem is that Unicode can store the same accented letter in several ways, which look identical to people but differ for a model.

Synthetic training data

Because almost no scanned Mansi books exist, the team generated its own data. Python scripts took real Mansi text from printed and electronic publications, normalized it to Unicode NFC so each letter has a single representation, and rendered it in several dozen typefaces, including FreeSerif, DejaVu Sans, Arial, Calibri and Times New Roman. Lines were drawn at several sizes and in regular, bold and italic styles.

The team also labeled each character with a bounding box. Automatic font metrics often miscalculate boxes for accented letters, so the researchers added pixel-level corrections per character, point size and typeface. The scripts produced 1.3 million pairs of line images (.tif) and ground-truth text files (.gt.txt).

The base was the official Russian model rus.traineddata from the tessdata_best repository. Since the Mansi alphabet largely overlaps with Russian, the network mainly had to learn the new macron letters and ӈ.

Apps worth a look

SUMO: the number puzzle

Tap the right tiles, add them up, hit the target. Easy to learn, hard to master. Free, for all ages.

Tags:tesseractocrmansi languagehugging facelow-resource languagesyuniiit

More from this day

See all →

More in: AI

See all →