Bangla Transliteration (Indian Bengali)
Fine-tuned facebook/nllb-200-distilled-600M for Romanized Bengali (Banglish) to Bengali script transliteration, specifically targeting Indian (West Bengal) Bengali romanization patterns rather than Bangladeshi Bengali.
Converts text like ami tomake bhalobashi into native Bengali script: আমি তোমাকে ভালোবাসি
Model description
This model performs transliteration, not translation — it maps the phonetic sounds of Romanized Bengali into the corresponding Bengali script, preserving meaning rather than translating into English-equivalent vocabulary. This distinction matters for words that exist as both English loanwords and Bengali sounds (e.g. "tire" — the model correctly outputs তীরে / "riverbank" in context rather than টায়ার / "vehicle tire").
The model was fine-tuned in two stages:
- Base fine-tuning on the Aksharantar Bengali subset (~1.2M word-level Romanized-to-native pairs), establishing broad vocabulary coverage.
- Targeted fine-tuning on a custom, hand-curated dataset of colloquial Indian Bengali sentence pairs, covering casual conversation, literary references (Tagore, Sukumar Ray, Kazi Nazrul Islam), regional food and cultural vocabulary, common proverbs, social media and digital-native slang, code-mixing with English, and deliberate romanization variance (e.g. both
bhalo and valo for ভালো, reflecting how different people actually type the same word).
Intended use
- Transliteration APIs and backend services for Bengali-facing products
- Input methods and keyboard tools for Bengali typists who type phonetically in Latin script
- Content and publishing tools for Bengali social media, chat applications, and editorial platforms
- Research and NLP tooling for Indian Bengali specifically, where public resources are scarce compared to Hindi and other major Indic languages
Limitations
- Optimized for Indian (West Bengal) Bengali. Bangladeshi Bengali uses different romanization conventions and may perform less reliably.
- Strongest on conversational, everyday vocabulary. Rare technical, scientific, or highly formal vocabulary may be less reliable, particularly less-common conjunct-heavy words that were underrepresented in fine-tuning data.
- Trained on a relatively small custom fine-tuning set (several hundred sentence pairs). While this meaningfully improved sentence-level coherence over the Aksharantar-only baseline, broader coverage will continue to improve with more data.
- Romanization is inherently ambiguous (multiple Latin spellings can map to the same Bengali word, and vice versa); the model reflects the conventions present in its training data.
Performance
| Metric | Value |
|---|
| CER (Character Error Rate) | 0.0578 |
| WER (Word Error Rate) | 0.1946 |
Evaluated on a held-out validation split of the custom fine-tuning dataset. CER is the more representative metric for transliteration quality, as it captures partial correctness at the character level rather than penalizing near-miss words as complete failures.
Usage
1from transformers import AutoModelForSeq2SeqLM, NllbTokenizer
2
3tokenizer = NllbTokenizer.from_pretrained(
4 "Ana-04/bangla-transliteration-v1",
5 src_lang="eng_Latn",
6 tgt_lang="ben_Beng",
7)
8model = AutoModelForSeq2SeqLM.from_pretrained("Ana-04/bangla-transliteration-v1")
9
10text = "ami tomake bhalobashi"
11inputs = tokenizer(text, return_tensors="pt")
12output = model.generate(
13 **inputs,
14 forced_bos_token_id=tokenizer.convert_tokens_to_ids("ben_Beng"),
15 max_length=64,
16 num_beams=4,
17)
18print(tokenizer.decode(output[0], skip_special_tokens=True))
19# আমি তোমাকে ভালোবাসি
Batch inference
1texts = ["kemon acho tumi", "gangar tire ghurte jai chol", "aj office e deri hobe"]
2inputs = tokenizer(texts, return_tensors="pt", padding=True)
3outputs = model.generate(
4 **inputs,
5 forced_bos_token_id=tokenizer.convert_tokens_to_ids("ben_Beng"),
6 max_length=64,
7 num_beams=4,
8)
9for text, output in zip(texts, outputs):
10 print(tokenizer.decode(output, skip_special_tokens=True))
Training data
The custom fine-tuning dataset (several hundred hand-written and curated Indian Bengali sentence pairs) was developed specifically for this project to address a gap in publicly available Indian Bengali NLP resources — most existing transliteration datasets are either word-level only or focused on Bangladeshi Bengali. The dataset spans multiple registers: casual texting and social media language, literary and proverbial Bengali, food and cultural vocabulary, kinship and address terms, and deliberate romanization variants reflecting real-world typing diversity. A public release of this dataset is planned.
Training procedure
- Base model:
facebook/nllb-200-distilled-600M
- Stage 1: Fine-tuned on Aksharantar (Bengali subset), ~10,000 steps, batch size 4 with gradient accumulation, fp16, T4 GPU
- Stage 2: Further fine-tuned on the custom sentence dataset, 20 epochs with early stopping (best checkpoint at epoch 11), learning rate 2e-5
Citation
If you use this model, please link back to this repository.