A training pipeline and a distributable Tesseract LSTM model for Church Slavonic printed liturgical texts — the accented, titlo-bearing, superscript-lettered orthography that general Cyrillic OCR models cannot read.
The model is trained on synthetic line images rendered from a large Church Slavonic text corpus in several historically-grounded typefaces, then adapted to real scans with a small hand-corrected fine-tuning set.
| Path | Contents |
|---|---|
scripts/ |
the Python tooling (data generation, extraction, evaluation, monitoring, review) |
corpus/ |
the source text corpus — git submodule of slavonic/cu-md-sandbox |
fonts/ |
the rendering typefaces — git submodules (Ponomar, Triodion, Pochaevsk, Acathist, Monomakh) |
data/cu-ground-truth/ |
the synthetic training pairs — generated, not committed (regenerate with make dataset) |
data/real-lines/ |
hand-corrected scan lines — committed; eval/ (held out) and finetune/ |
model/ |
the model card and evaluation reports (the cu.traineddata binary itself ships via Releases, not in the repo) |
training/ |
tesstrain working state (checkpoints, unicharset) — not committed |
docs/ |
the manual, reference pages, and troubleshooting |
No clone needed — download cu.traineddata from the Releases
page, then:
tesseract your_line.png stdout --psm 13 -l cu --tessdata-dir /path/to/download-dir
# (or copy it into your tessdata/ dir to use -l cu directly — see model/README.md)Start with the manual. It walks through every step, from making the practice data to publishing a release, with the exact commands and what you should see after each one.
In short:
git clone --recurse-submodules https://github.com/slavonic/church-slavonic-ocr.git
cd church-slavonic-ocr
python3 -m venv .venv && source .venv/bin/activate
make setup # fonts, corpus, python packages (also needs Tesseract + tesstrain: manual, Step 1)
make dataset # Step 2: synthetic training lines
make train-seeded # Step 3: base model
make review-staging # Step 4: correct real lines (after extract_lines.py)
make eval # Step 5: score on held-out real linesDownload the trained model from the Releases page. See the
model card for current metrics and
model/eval/ for the per-line report. Character error rate is
reported two ways — full, and with combining marks stripped — so letterform
accuracy is separable from diacritic placement (see
evaluation).
Start here: docs/manual.md, the step-by-step guide from
nothing to a published model.
Reference, for when you need the details:
docs/data-generation.md—cu_make_training_data.py: fonts, charset, hyphenation, degradationdocs/training.md— seeded vs from-scratch training, the fine-tune rules, resetting the charsetdocs/evaluation.md— everyextract_lines.pyoption, and how to readcu_eval.py's outputdocs/troubleshooting.md— the failure modes we actually hit, grouped by stepdata/README.md— what's indata/, and ground-truth typing conventions
This repository combines works under different licenses; please respect each:
- Code (
scripts/) — seeLICENSE(MIT License). - Corpus (
corpus/, submodule) — retains the license ofslavonic/cu-md-sandbox(MIT License). - Fonts (
fonts/, submodules) — each retains its own license (SIL Open Font License). - Model (
model/cu.traineddata) — a derivative work of the corpus and fonts; its provenance and intended use are documented in the model card.