Views
No views yet
| Input (Singlish) | Output (Sinhala) |
|---|---|
mama giya | මම ගිය |
kohomada | කොහොමද |
| Split | Source | Size |
|---|---|---|
| Phase 1 & 2 training | phonetic_train_1M.csv | 1,000,000 samples |
| Adhoc fine-tuning | adhoc.csv | 11,937 samples |
| Phonetic validation | phonetic_test.csv | 10,003 samples |
| Adhoc validation | adhoc_test.csv | 5,003 samples |
th→t, sh→s, nd→n, etc.)a↔e, i↔e, o↔u)transliterate: at inference time, consistent with T5-style task conditioning.| Phase | Data | Epochs | LR | Validation | Aug |
|---|---|---|---|---|---|
| 1 — Foundation | 65% of phonetic train (~650K) | 2 | 1e-4 | Phonetic | 15% |
| 2 — Expansion | Remaining phonetic + 5× adhoc + 80K replay | 2 | 5e-5 | Adhoc | 20% |
| 3 — Mastery | 10× adhoc + 200K phonetic mix | 2 | 2e-5 | Adhoc | 15% |
| Parameter | Value |
|---|---|
| Rank (r) | 64 |
| Alpha | 128 |
| Dropout | 0.05 |
| Target modules | q_proj, k_proj, v_proj, out_proj, fc1, fc2 |
| Parameter | Value |
|---|---|
| Batch size | 8 |
| Gradient accumulation | 4 (effective batch: 32) |
| Weight decay | 0.01 |
| Max grad norm | 1.0 |
| Warmup ratio | 0.03 |
| Optimizer | AdamW fused |
| Precision | bfloat16 / fp16 |
| Test Set | CER ↓ | WER ↓ | BLEU ↑ | BERTScore ↑ |
|---|---|---|---|---|
| Phonetic | 0.0478 | 0.1764 | 0.6213 | 0.9897 |
| Adhoc | 0.1034 | 0.3015 | 0.4223 | 0.9861 |
BERTScore computed using Ransaka/sinhala-bert-medium-v2.
1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3model_id = "savinugunarathna/mT5-Singlish-Sinhala-Merged"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
6
7inputs = tokenizer("transliterate: mama giya", return_tensors="pt")
8outputs = model.generate(
9 **inputs,
10 num_beams=4,
11 max_length=128,
12 length_penalty=1.2,
13 repetition_penalty=1.2,
14 no_repeat_ngram_size=3,
15)
16print(tokenizer.decode(outputs[0], skip_special_tokens=True))
17# → මම ගියNote: Always prependtransliterate:to inputs. Suppressing<extra_id_N>tokens viabad_words_idsis recommended for clean output.