Shodhana-34M (शोधन)

Shodhana is Sanskrit for purifying, correcting.

A small English model that corrects lines misread by a handwriting reader. Give it a misread line (and, if you have it, the line before it), and it writes the corrected line. It is Viveka-34M trained further on free Colab and Kaggle T4 GPUs, half on ordinary text (so it still knows English) and half on correction examples.

How to use

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained('vrishv/Shodhana-34M')
lm = AutoModelForCausalLM.from_pretrained('vrishv/Shodhana-34M', dtype='float32').eval()

def fix(bad, prev=''):
    x = tok(f'<fix> {prev[-80:]} | {bad} <to>', return_tensors='pt').input_ids
    out = lm.generate(x, max_new_tokens=int(len(tok(' ' + bad).input_ids) * 1.5) + 6, do_sample=False,
                      eos_token_id=tok.eos_token_id, pad_token_id=tok.eos_token_id)
    return tok.decode(out[0, x.shape[1]:], skip_special_tokens=True).strip()

print(fix('saw his frlend standinq in the rain .', prev='He opened the door and'))

Results

Character errors in lines read by a handwriting reader (lower is better):

Test lines Reader alone + Shodhana
300 Wikipedia sentences, written by hand and misread 6.14% 3.34%
528 real-world handwriting lines (GNHK) 10.70% 10.76%

It fixes almost half the mistakes on ordinary sentences, but not yet on messy real-world handwriting: there its mistakes are of a different kind than the ones it practised on. Use it together with a check against the handwriting (keep its correction only if the letters still fit the picture), as the AksharaVardhan reader does.

Limitations

Small (33.9M numbers): it can turn a badly misread word into a different real word ("the knife is metal" can become "the trigger is vital"). English only. It may change capital letters and punctuation.

About the maker

Shodhana was built by Vrishvardhan Sharma (vrishv), a 9-year-old self-taught builder from India. His other work:

  • GitaVardhan: a free, offline Bhagavad Gita app in 13 Indian languages, and a pocket-sized voice-controlled Gita device he designed, wired and coded himself.
  • Sanskrit Vardhan: an app for learning Sanskrit through the Bhagavad Gita, with word-by-word meanings and step-by-step Pāṇinian derivations. Launched on 20 October 2026 by Prof. Shrinivasa Varakhedi, Vice-Chancellor of Central Sanskrit University.
  • Kannada, Tamil and Telugu Vardhan: apps that teach everyday spoken Kannada, Tamil and Telugu.
  • Hindi Vardhan (hindivardhan.in): a dictionary of pure, Sanskrit-rooted Hindi. Over 6,000 borrowed words in everyday Hindi, each with native alternatives checked against five classical Sanskrit dictionaries.
  • AksharaVardhan: a handwriting reader that runs on an ordinary computer.
  • graphics-studio: a free Space that makes and edits images, videos, music and narration.
  • Viveka-34M: the sentence judge Shodhana is built from.
  • Jigyasa Simple: 473 everyday science questions with short, plain-text answers.
  • Jigyasa Medium and Jigyasa Big: 969 and 970 deeper science questions, built from his own questions, with answers of up to 7 and 10 sentences.

He has memorised the Bhagavad Gita and Pāṇini's Aṣṭādhyāyī, won national Sanskrit recitation competitions, and speaks six languages. More at vrishvardhan.in.

CC BY-NC 4.0 © 2026 Vrishvardhan Sharma. Built from Viveka-34M, whose first training stage used IAM handwriting texts (non-commercial research licence).

Downloads last month
40
Safetensors
Model size
33.9M params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 2 Ask for provider support

Model tree for vrishv/Shodhana-34M

Finetuned
(1)
this model

Datasets used to train vrishv/Shodhana-34M