Gemma4 CodeMix
Gemma 4 for Code-Mixed Hindi
People mix English with Hindi when they chat, using informal spelling, transliteration
and mixed scripts. General-purpose models handle this inconsistently. We fine-tuned
Google’s Gemma 4 E2B with LoRA (Unsloth, free Colab T4 GPU) to perform four conversions:
English to romanized Hindi, English to code-mixed Hindi, romanized Hindi to English,
and code-mixed Hindi to romanized Hindi.
Data: AI4Bharat IndicCMix (Hindi). We split by sentence before building tasks, so no
test sentence leaks into training. The test set is 40 held-out examples.
Evaluation: both models are scored with chrF on the same test set. The plain model
averages 41.7 chrF, and it is weakest on English to code-mixed (29.7). Fine-tuned
result: TBD.
App: a custom web app (FastAPI backend, hand-written HTML, CSS and JavaScript) runs
inside Colab. It compares plain and fine-tuned output side by side, auto-detects the
task from the script, scores answers live against your own reference, and has an
Evidence tab that shows held-out test sentences with the reference, both outputs and
chrF. We state our limitations openly: a small test set, a one-reference metric, a
short training run and Hindi only.
Built with
AI tools
Prize Categories Entered
- Event prizeSubmitted
Theme 3: Fine-Tuning Gemma