savitr — terse electoral-roll OCR (distilled Surya)

gojiberries/savitr is datalab-to/surya-ocr-2 (650M Qwen3.5-VL-style OCR) self-distilled to read Indian electoral-roll pages and emit one compact, pipe-delimited line per voter instead of verbose HTML:

epic|name|relation(F/H/M)|relative_name|house|age|sex

The compact output reduces decoding work relative to Surya’s HTML format. The checkpoint is converted to MLX 8-bit for Apple Silicon. Runtime depends on the mlx-vlm version, hardware, thermals, and page content; this card does not publish a current speed multiplier.

Usage

pip install savitr
savitr ocr roll.pdf                  # auto-downloads this model
from huggingface_hub import snapshot_download
from savitr import MLXSuryaOCR, parse_terse
from savitr.rolls.parse import TERSE_PROMPT

path = snapshot_download(
    repo_id="gojiberries/savitr",
    revision="c850ccd21031bb86595f1ba5f9679e6b401ec04f",
)
eng = MLXSuryaOCR(path, prompt=TERSE_PROMPT)
voters = parse_terse(eng.ocr_image("page.png")[0])

How it was trained

Teacher = full Surya (surya-ocr-2) OCRs roll pages to HTML; a parser cleans them into terse targets; the model is LoRA-fine-tuned on (page image → terse rows) — 450 pages drawn from constituencies held out of the eval, 1 epoch, for $0 on a free Kaggle T4. The terse format is the only behavioral change — reading ability is inherited from Surya.

Evaluation (out-of-sample, vs the Surya teacher)

Held-out constituencies never seen in training (37 pages, 1,076 teacher voters):

Field

Fidelity

Field

Fidelity

voter recall

99.3%

relative name

96.2%

EPIC

97.2%

relation code (F/H/M)

97.9%

name

96.2%

house

98.8%

age

97.5%

sex

98.2%

Per-voter record similarity is 98.7% and whole-page similarity is 92.9%. Both are Python SequenceMatcher ratios, as implemented by training/eval_oos.py; they are not normalized edit distance.

Fidelity means agreement with the teacher output, not ground-truth OCR accuracy. The held-out voter records are excluded from Git because they contain personal data, so the public repository does not independently reproduce these numbers. Maintainers with the evaluation corpus can rerun:

uv run python training/eval_oos.py

Limitations

The checkpoint was trained on Manipur 2025 English rolls. Other states and scripts are out of distribution. Pair it with Savitr’s value-anchored parse_terse, which stays aligned when the model drops a field.

License & attribution

Derived from datalab-to/surya-ocr-2; its license governs use of these weights. savitr’s code is MIT. Electoral rolls are public records published by the Election Commission of India.