TL;DR
Informal Nepali social media is a chaotic blend of Romanized Nepali and English ("code-mixed" text) where a single word can be spelled a dozen different ways. LipiMix tackles this by pairing a massive social-media dataset and a Phonetic Variant Dictionary (mapping 92.7K+ spelling variants to 15.6K+ canonical forms) with a byte-level Transformer (ByT5). The result is a system that transliterates messy, code-mixed Nepali into Devanagari script at 5.96% character error rate, outperforming existing Nepali transliteration tools.
What Problem Does This Paper Address?
Nepali is spoken by roughly 17 million native speakers, and online, they rarely type in pure Devanagari script. Instead, they use code-mixed text—fluently weaving Romanized Nepali and English together in the same sentence (e.g., "Ekdam few manxe haru matrw extra hunxan...").
The catch? Almost all downstream Nepali NLP tools—sentiment analysis, hate-speech detection, machine translation—expect formal Devanagari script. Converting Romanized social-media text back into Devanagari is surprisingly hard for two reasons:
- Extreme orthographic inconsistency: There is no standard way to spell Romanized Nepali. The word for "it will happen" shows up as huncha, hunchha, hunxa, hunachha, and more.
- Homophonic ambiguity: The same Romanized word can mean completely different things depending on context—kala could be कला (art) or काला (black); bal could be बल (strength) or बाल (hair). Word-level mappers can't disambiguate these.
Existing rule-based converters, Google Transliteration, and even open neural models like NepaliXlit are built for formal Romanized Nepali and stumble badly on colloquial, code-mixed slang.
Methods
Rather than inventing a new neural architecture, the authors' main contribution is a data engineering pipeline that makes standard sequence-to-sequence models thrive on noisy text:
- Rule-Based Cleaning & Phonetic Variant Dictionary (PVD): They apply seven deterministic rules (lowercasing, collapsing repeated letters like bachnaaa → bachnaa, etc.) and then run a Nepali-adapted Soundex/Metaphone phonetic clustering algorithm. Words with the same phonetic code are grouped, manually validated, and assigned a single canonical base word.
- Inference-Time Normalization & Chunking: At inference, every input token is cleaned and looked up in the PVD. Known variants are swapped for their canonical base word; unseen slang passes through untouched. Because Devanagari takes up more UTF-8 bytes than Romanized text, long comments are greedily chunked into ≤200-character segments so they don't exceed the model's 512-byte output limit.
- Byte-Level vs. Subword Seq2Seq: They fine-tune
google/byt5-small(which processes raw UTF-8 bytes) andgoogle/mt5-small(which uses a 250K-vocabulary SentencePiece subword tokenizer) for 20 epochs on a single A100 GPU.
Datasets
The authors built and publicly released several new resources:
- Cleaned Social-Media Corpus: Starting from 2,772,519 comments scraped from 10 Nepali YouTube channels and Facebook pages, a three-stage filtering pipeline retained 444,116 usable Romanized sentences.
- Parallel Corpus: Native speakers manually transcribed 20,500 sentences into Devanagari (80% from the scraped corpus, 20% annotator-authored for conversational coverage), split into 19,500 training and 1,000 validation pairs.
- PVD-Augmented Training Set: Expanding the 19,500 training pairs with PVD variants yielded 85,870 total training pairs.
- Test Set: A separately annotated 500-sentence raw social-media test set.
Key Insights and Ideas
- Bytes beat subwords for messy spelling: ByT5 outperformed mT5 in every single setting. Fixed subword tokenizers (like mT5's SentencePiece) shatter when fed irregular Romanized spellings, whereas raw UTF-8 bytes handle them gracefully.
- Preprocessing and augmentation are complementary: Ablation studies showed that rule-based cleaning and PVD normalization each improve accuracy on their own, and combining them gives the best results. Notably, even without normalization, raw ByT5 still beats all external baselines.
- Augmentation helps mT5 more than ByT5: PVD-based data augmentation dropped mT5's character error rate (CER) by 3.95 points, whereas ByT5's CER budged by only 0.07 points (6.03% → 5.96%), suggesting ByT5's byte-level representations already generalize well to spelling quirks.
Key Results
On the 500-sentence social-media test set, ByT5 Augmented + Normalization achieved:
- 5.96% CER and 21.85% WER (94.04% character accuracy, 78.15% word accuracy).
- This comfortably beats NepaliXlit (9.22% CER, 43.68% WER), Google Transliteration (20.76% CER, 60.88% WER), and rule-based tools (21–31% CER).
In a human evaluation where 10 native Nepali speakers rated 500 outputs on a 1–5 Likert scale, the model scored 4.61 for Accuracy and 4.35 for Naturalness (4.48 overall).
Limitations and Future Work
- Static PVD: The dictionary is fixed and cannot normalize unseen slang or emerging neologisms.
- Diacritic & Homophonic Errors: The model still confuses nasalization markers (chandrabindu vs. anusvara), short/long vowels, and occasionally drops halant or visarga. Homophones requiring discourse-level context remain unsolved at the sentence level.
- English Loanwords: Words like static or quantify still produce unnatural transliterations due to limited training exposure.
- Future Directions: Due to compute constraints, only
smallmodel variants were trained. The authors suggest scaling the corpus via semi-supervised methods (like back-translation), exploring paragraph-level decoding, and transferring their language-agnostic pipeline to other low-resource pairs like Sinhala-English or Bengali-English.
Summary updated