Building a Crimean Tatar Corpus: 79% of Pages Needed No OCR, but Turkish Crept In
To train a neural network on Crimean Tatar, the author built a corpus from old books and broadcasts. He found that 79% of Crimean Tatar pages already contain a text layer under the image, so OCR (scan recognition) is needed for only a fifth of them. But periodicals turned out to contain Turkish substitutions: in the new model, the share of Turkish forms in answers rose from 0.27% to 2.02%. The takeaway: first count what is in your archive, and run metrics per source.
AI-processed from Habr AI; edited by Hamidun News
When a language has not a single decent dataset, the question is no longer "which model should I pick" but "what do I even train on". The author of a series of Habr articles on the Crimean Tatar language described how he built a corpus for speech recognition, voice synthesis and a language model. The headline number: for 79% of Crimean Tatar pages in old books, the text already sat under the page image, so expensive scan recognition (OCR) was needed for only the remaining fifth.
The second number is less pleasant: in the new version of the language model, the share of Turkish forms in answers rose from 0.27% to 2.02%, because texts written in a Turkish manner had leaked into the data.
If you are building a corpus for a rare language or from a company's internal archives, this write-up can save you months.
First, Count What Is in the Archive
The author had books and periodicals from different years, broadcast recordings, audiobooks, dictionaries and recordings of teachers. Almost nothing was a ready-made dataset on its own: a book stays a PDF, a broadcast is hours of audio without text, and an audiobook's sound and text live separately. The plan looked obvious: old books exist mostly as scans, so OCR is needed. But OCR makes mistakes in this language, especially on letters that do not exist in Russian, and it is slow and expensive.
Before launching it, the author counted the share of pages by category. Russian books took 32.2%, Turkish ones 13.9%, Crimean Tatar Cyrillic with a text layer 28.2%, and Latin script with a text layer 3.9%. Among the Crimean Tatar pages alone, 79% already carried real text that can be extracted without recognition. The expensive branch turned out to be the smaller half of the haul.
But "there is text" does not mean "the text is good": the layer was once created by someone else's software. Three defects turned up. The first is a soft sign instead of a hard sign ("къаплангьан" instead of "къаплангъан"): the combinations "кь" and "гь" do not exist in Crimean Tatar Cyrillic, so the replacement is mechanical.
Before applying it, the author ran it on known-healthy text, where not a single character should change. There were zero changes, and only then did he fix tens of thousands of pages. The second is a wrong encoding: the Turkish "ı" turned into "ý" and "ş" into "þ", which is also reversible.
The third is duplicates: filename matching found almost no copies, but matching by content (comparing fragments of eight words) found 7.0% repeats. Without this step, the model would have seen some texts twice, and during evaluation it would have "recognized" what it should be seeing for the first time.
Decisions were made per page, not per book: within one volume, clean Cyrillic can sit next to corrupted Latin script. Quality was scored by the share of words that begin with a dictionary root. Exact matching would not work: the language is agglutinative, chains of endings attach to the root, and such a measurement could not tell a good book (3% hits) from a broken one (2%). As a control, six random Russian books were rejected on 100% of their pages, and six Turkish ones on 74%, but two of the six passed. The result: there is roughly ten times more usable text than in the corpus's previous core.
Turkish Posing as Crimean Tatar
One day the model answered "Ayt, men dinlemeye hazırım", where the correct form is "Ayt, men diñlemege azırım": the roots are the same, but the form is Turkish. On 524 test prompts, the share of Latin tokens with a Turkish form was 2.02% for the new version versus 0.27% for the previous one, which is 7.5 times more. The detector is calibrated from both sides: on clean Crimean Tatar prose it gives 0.03%, on genuine Turkish 11.75%.
With the same instrument, the author examined the corpus. In the slice the previous version was trained on, Turkish forms were 0.41%; in the next one, 0.93%, which is 2.3 times more. The contamination sat in a few places: three sources gave 46% of all flagged tokens, and fourteen gave 76%. This turned out to be periodicals published outside Crimea, where Crimean Tatar text is often written in the Turkish manner. Broad web crawls, which the author suspected first, turned out to be the cleanest of the large sources.
An ordinary language identifier is blind here: it answers "our language or not?", and related languages share too many roots. Of the more than ten thousand extra chunks it found, only 40 had Turkish features.
So the detectors were built in reverse: they look for forms that do not occur in Crimean Tatar, for example the verbal noun in the dative case ending in "-meye" instead of "-mege". Each detector was tested in both directions, and decisions were made on the whole line: the ending "-yor" appeared in hundreds of lines, and not one of them turned out to be Turkish. Another detector found several dozen chunks in Kazakh, Tatar and Uzbek.
Several thousand fragments went into quarantine, tagged with their origin and the rule that fired. Nothing was deleted.
Why the Automatic Replacement Was Rolled Back
The temptation was to normalize Turkish spelling: k → q, n → ñ. The rule allowed a replacement if the original form was not in the dictionary and the resulting one was. The author applied several hundred such replacements to a draft slice, reviewed the diff and rolled them back. A dictionary checks that the result is a Crimean Tatar word, but not whether it is the word that was meant. "Balaların" ("children") turned into "balalarıñ" ("your children"), and "atın" into "atıñ" ("your horse" instead of "the horse's"). A normalizer that produces plausible errors is worse than one that does nothing. The replacements remain in a separate file as a suggestion.
Dialectal forms, such as the southern-coast "ben" instead of the literary "men", were not scrubbed from the corpus, although the Turkish detectors flag them: in the model's answers they are counted as a separate category.
The practical takeaway: count the archive's composition before expensive processing, test fixes on known-healthy data, run quality metrics for each source, and do not let automation "fix" what it does not understand. The method's limitation is also stated honestly: Turkish partly leaks through the dictionary of a related language, and there is no hundred-percent protection.
- Jul 26, 2026SIFT: A Self-Improving Document Classifier That Retrains Without a Human
- Oct 9, 2026Wieszcz-XIX: A 3.1-Billion-Word Polish Corpus From Before 1918 Trains Models From Scratch
- May 2, 2026NVIDIA unveils Nemotron OCR v2: a multilingual OCR model trained on 12.2 million synthetic documents
- Nov 12, 2026Claude Fable 5.2 Designed Three Electronic Devices From Scratch Using a Short Prompt
Key Questions Answered
What are the key details on First, Count What Is in the Archive?
The author had books and periodicals from different years, broadcast recordings, audiobooks, dictionaries and recordings of teachers. Almost nothing was a ready-made dataset on its own: a book stays a PDF, a broadcast is hours of audio without text, and an audiobook's sound and text live separately. The plan looked obvious: old books exist mostly as scans, so OCR is needed. But OCR makes mistakes in this language, especially on letters that do not exist in Russian, and it is slow and expensive.
What are the key details on Turkish Posing as Crimean Tatar?
One day the model answered "Ayt, men dinlemeye hazırım", where the correct form is "Ayt, men diñlemege azırım": the roots are the same, but the form is Turkish. On 524 test prompts, the share of Latin tokens with a Turkish form was 2.02% for the new version versus 0.27% for the previous one, which is 7.5 times more. The detector is calibrated from both sides: on clean Crimean Tatar prose it gives 0.03%, on genuine Turkish 11.75%. With the same instrument, the author examined the corpus.
Why the Automatic Replacement Was Rolled Back?
The temptation was to normalize Turkish spelling: k → q, n → ñ. The rule allowed a replacement if the original form was not in the dictionary and the resulting one was. The author applied several hundred such replacements to a draft slice, reviewed the diff and rolled them back. A dictionary checks that the result is a Crimean Tatar word, but not whether it is the word that was meant. "Balaların" ("children") turned into "balalarıñ" ("your children"), and "atın" into "atıñ" ("your horse" instead of "the horse's").
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.