How it works
Render the OCR text, look at the scan and the render together, and score every letter.
(one token per 4 px of width)
p(letter wrong) for every letter
The idea
An OCR engine gives text. Sindhi-Jev draws that text (the render) and asks: does the scan look like this drawing, letter by letter? A dot error changes only a few pixels, so the model gets both pictures plus the letter sequence, and each letter's query is tied to the part of the render where that letter is drawn.
Training data
All training data is synthetic, generated from Sindhi Wikipedia text:
- Scans: the true text drawn in 9 open-licence Naskh-style fonts, then degraded: skew, paper texture, ink spread, blur, noise, JPEG, slivers of neighbouring lines, bleed-through, uneven lighting and binarisation.
- Candidates: half are correct; the rest have dot swaps from a confusion set reviewed by a native speaker (for example ن ↔ ڻ, ب ↔ ٻ), substitutions, deletions or insertions.
- Real-word swaps: dot swaps that turn one dictionary word into another. A spell checker cannot catch these, so they force the model to use the image.
Fonts are split three ways: 9 for training, Mirza for model selection, and Harmattan and Noto Kufi Arabic only for the final synthetic test.
Training
Binary cross-entropy on the whole-text label and on each letter's label, 60,000 steps of batch 128, mixed precision on one Kaggle T4 (9.7 GPU hours for the reported model). The reported model is the checkpoint at the end of the schedule, not the best one on any test set.
Evaluation
The real test set was cut from 14 printed Sindhi sources, labelled by hand, frozen with SHA-256 hashes, and used exactly once for the final results. Every access is logged in the repository.