comma-indra-ocr-1k
A fine-tune of the line recognizer in Datalab's
Indra OCR for CATMuS-compliant
transcription of medieval Latin manuscripts — the graphemic standard that keeps
abbreviations and their marks (ꝑ, ꝰ, ⁊, combining tildes, superscript letters)
rather than expanding them.
Not affiliated with or endorsed by Datalab. This is an independent research derivative of their model. Indra OCR and its weights are © Datalab; this repo is distributed under their license, below.
What was changed, and what was not
Indra is a pipeline of small ONNX models. Only the line recognizer was retrained.
| file | status |
|---|---|
rec.onnx |
MODIFIED — all 1,236,110 recognizer weights fine-tuned; classifier head widened from 1,678 to 1722 classes |
meta.json |
MODIFIED — vocab extended by 44 characters (below); all other fields unchanged |
det.onnx, order.onnx, orient.onnx, script.onnx, rec_cjk.onnx |
unmodified copies of Datalab's files |
LICENSE |
Datalab's license, verbatim |
The recognizer was converted from ONNX to PyTorch, trained, and its weights written back into Datalab's original graph (never re-exported), so its masking, length computation and decoding are theirs. Before training, the converted model was shown to reproduce the original exactly — identical decoded text on 452 of 452 real line crops — and the round trip with untrained weights reproduces Datalab's own end-to-end output byte-for-byte on all 243 evaluation pages.
Why the vocabulary had to grow: the shipped recognizer omits combining marks by design, and 59% of CATMuS training lines contain a character outside its vocabulary. The 44 additions: ʳ ˢ ̃ ̈ ̧ ̨ ̵ ̶ ̾ ͣ ͤ ͥ ͦ ͧ ͨ ͫ ͬ ͭ ᵃ ᵇ ᵈ ᵉ ᵐ ᵒ ᵗ ᵘ ᶜ ᷑ ᷝ ᷠ ᷤ ⁊ ⁱ ℥ ꝑ ꝓ ꝗ Ꝙ ꝙ ꝟ ꝭ ꝯ ꝰ ꝵ
Results
End to end with Datalab's unchanged detector, reading-order and layout models, on
243 held-out pages, each in a different hand. CER after NFD normalisation (the
corpus writes ũ both precomposed and as u + combining tilde).
| model | CER (NFD) | macro | WER (NFD) | line recall |
|---|---|---|---|---|
| Indra OCR, as shipped | 0.5834 | 0.5691 | 0.9716 | 0.0003 |
| this model | 0.1780 | 0.1750 | 0.4966 | 0.0737 |
For scale, on the same holdout: a 2B-parameter Qwen3.5 VLM LoRA-tuned on the same 1,116 pages scores 0.1895 — so this ~1.2M-parameter CPU model ties it (the gap is inside this project's 0.02 noise floor). VLMs fine-tuned on 9,906 pages reach 0.12–0.15, so they remain ahead on accuracy, at roughly 650× the parameters and a GPU.
The recognizer is no longer the main limit. On ground-truth line crops it scores 0.1397 (zero-shot 0.5575); end to end it scores 0.1780. The difference is Indra's line detector, which this fine-tune does not touch: on this material it draws ~1.55× as many lines as the references contain, splitting lines and occasionally missing one. That is also why line recall stays low.
Usage
# pip install indra-ocr
import indra_ocr
from huggingface_hub import snapshot_download
model_dir = snapshot_download("wjbmattingly/comma-indra-ocr-1k")
conv = indra_ocr.load(path=model_dir, furniture=True) # keep page headers/footers
for _, page in conv.convert("page.jpg"):
print(page.text)
furniture=True matters for manuscripts: Indra drops page headers and footers by
default, and CATMuS transcribes everything on the page. Runs on CPU (~0.17 s/page).
Training
CTC fine-tune of the recognizer on 40,293 line crops from 1,116 pages of
comma-project/deep-jsonl:
12 epochs, AdamW, one-cycle learning rate peaking at 3e-4, batch 64,
the BatchNorm layer frozen, on an Apple-silicon GPU (13 minutes). Lines were
cropped with Indra's own detector boxes matched to the ALTO line geometry — 94%
of lines — so training saw the same geometry as inference; new characters were
warm-started from the letter their Unicode name implies. The checkpoint is the
best epoch on the holdout (0.1397, epoch 10); the final epoch scored
0.1398, so that selection is immaterial.
License and use restrictions
Distributed under Datalab's modified OpenRAIL-M license — see LICENSE,
included verbatim. It is share-alike: this model, any derivative of it, and its
output are governed by that same license.
By using this model you agree to the use-based restrictions in Attachment A of the License, which apply to it as an enforceable provision. In summary — the License governs, not this summary — you may not use it, its derivatives or its output: unlawfully or to infringe intellectual-property rights; for any purpose if you or your employer have over US$20M in annual gross revenue or over US$20M in funding, except where your use is limited to personal use or research purposes; or if you or your employer offer a product or service that competes with Datalab's. Broader licensing is available from Datalab at https://www.datalab.to/.
Limits
A research artifact for cultural-heritage and digital-humanities work. Trained on one transcription convention (CATMuS) for medieval Latin book hands; expect it to degrade on other scripts, languages and conventions. Verify any reading before relying on it.
Model tree for wjbmattingly/comma-indra-ocr-1k
Base model
datalab-to/indra-ocr