Image-to-Text
Transformers
Safetensors
vision-encoder-decoder
image-text-to-text
trocr
ocr
sanskrit
devanagari
iso-15919

trocr-large-printed-sanskrit-iso-preadapt

A TrOCR model fine-tuned from microsoft/trocr-large-printed to transcribe printed Devanagari Sanskrit line images directly into ISO 15919 romanization. It is the shared initialization of all models in yzk/trocr-vedic-cross-notation-rv-ms.

  • Input: one printed Devanagari text-line (or word) image.
  • Output: ISO 15919 romanization, unaccented (no Vedic accent marks).
  • Parameters: 609,169,408 (encoder 304,666,624 / decoder 304,502,784).

Training data

9,681 real printed Devanagari Sanskrit images (non-Vedic, no accent marks) with ISO 15919 targets, from two public Hugging Face datasets:

Source train val test License
Process-Venue/Sanskrit-OCR-Typed-Dataset 3,085 171 171 CC BY-NC-SA 4.0
diabolic6045/sanskrit-ocr-parallel-corpus-chat-template 5,630 312 312 not stated on the dataset card

License note. This model is released under CC BY-NC-SA 4.0 to respect the share-alike, non-commercial terms of the Process-Venue dataset. The diabolic6045 dataset does not state a license, and the origin of its images is not documented; rights in that data remain with their holders. Contact the author if you hold rights in this data and have concerns.

Training

3 epochs, learning rate 2e-5, linear schedule with warmup ratio 0.05, batch size 4 per device. The base model microsoft/trocr-large-printed is released under the MIT license as part of microsoft/unilm.

Usage

from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image

repo = "yzk/trocr-large-printed-sanskrit-iso-preadapt"
processor = TrOCRProcessor.from_pretrained(repo)
model = VisionEncoderDecoderModel.from_pretrained(repo)

pixel_values = processor(Image.open("line.png").convert("RGB"), return_tensors="pt").pixel_values
ids = model.generate(pixel_values, num_beams=4, max_length=256)
print(processor.batch_decode(ids, skip_special_tokens=True)[0])

Citation

@inproceedings{TODO-paclic2026,
  title     = {Transfer Between Accent Notations in Vedic OCR: Learning Visual Conventions from Parallel Text},
  author    = {TODO},
  booktitle = {Proceedings of the 40th Pacific Asia Conference on Language, Information and Computation (PACLIC 2026)},
  year      = {2026}
}
Downloads last month
14
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yzk/trocr-large-printed-sanskrit-iso-preadapt

Finetuned
(8)
this model
Finetunes
1 model

Datasets used to train yzk/trocr-large-printed-sanskrit-iso-preadapt