Instructions to use NethranjaliSE/Pali_Sinhala_fine_tune_Model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NethranjaliSE/Pali_Sinhala_fine_tune_Model with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="NethranjaliSE/Pali_Sinhala_fine_tune_Model")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("NethranjaliSE/Pali_Sinhala_fine_tune_Model") model = AutoModelForSeq2SeqLM.from_pretrained("NethranjaliSE/Pali_Sinhala_fine_tune_Model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Pāli → Sinhala Neural Machine Translation
Fine-tuned from facebook/mbart-large-50-many-to-many-mmt on a curated Pāli–Sinhala parallel corpus of 15,235 sentence pairs.
Pāli is represented in Sinhala script, so both the source and target sides use the si_LK language code.
Results (held-out test split, 1,524 sentences)
| Metric | Baseline (15 epochs) | This model |
|---|---|---|
| BLEU ↑ | 71.18 | 26.28 |
| chrF ↑ | 83.73 | 51.34 |
| chrF++ ↑ | 82.31 | 48.06 |
| TER ↓ | 21.31 | 69.20 |
95 % bootstrap confidence intervals (500 replicates): BLEU [np.float64(24.462), np.float64(28.238)], chrF [np.float64(49.947), np.float64(52.846)].
Paired bootstrap against the previous system on the identical test split: ΔchrF = -32.50 (p = 1.0000), ΔBLEU = -45.02 (p = 1.0000).
Metric signatures: BLEU nrefs:1|case:mixed|eff:no|tok:13a|smooth:exp, chrF nchars:6|space:no, chrF++ nchars:6|nw:2|space:no (sacreBLEU 2.6.0).
Training configuration
| Base model | facebook/mbart-large-50-many-to-many-mmt |
| Train / valid / test | 12,188 / 1,523 / 1,524 |
| Epochs | 25 max, early stopping on chrF (patience 5), best epoch 25 |
| Effective batch size | 32 |
| Learning rate | 5e-05, cosine schedule, 6 % warm-up |
| Label smoothing | 0.1 |
| Dropout / attention dropout | 0.1 / 0.1 |
| Precision | bf16 |
| Checkpoint averaging | single best checkpoint |
| Decoding | beam 4, length penalty 0.8 (tuned on validation) |
| Hardware | NVIDIA A100-SXM4-80GB |
Usage
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
repo = "NethranjaliSE/Pali_Sinhala_fine_tune_Model"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSeq2SeqLM.from_pretrained(repo)
tok.src_lang = "si_LK"
text = "අදින්නං නාදියති"
enc = tok(text, return_tensors="pt")
out = model.generate(**enc, num_beams=4, length_penalty=0.8, max_length=128,
forced_bos_token_id=tok.convert_tokens_to_ids("si_LK"))
print(tok.batch_decode(out, skip_special_tokens=True)[0])
Intended use and limitations
Intended for scholarly assistance with canonical Pāli texts, teaching, and research on low-resource translation. Output is a draft, not an authoritative rendering: doctrinal terminology can be translated inconsistently, rare compounds are sometimes copied from the source untranslated, and the model was trained on canonical/commentarial register, so modern or colloquial Pāli-adjacent input is out of distribution. Do not rely on it for liturgical or legal purposes without expert review.
Citation
@misc{pali_sinhala_nmt_2026,
title = {Neural Machine Translation from P\=ali to Sinhala for Low-Resource Buddhist Texts},
author = {Nethranjali},
year = {2026},
note = {Hugging Face model repository: NethranjaliSE/Pali_Sinhala_fine_tune_Model}
}
- Downloads last month
- 22
Model tree for NethranjaliSE/Pali_Sinhala_fine_tune_Model
Base model
facebook/mbart-large-50-many-to-many-mmtSpace using NethranjaliSE/Pali_Sinhala_fine_tune_Model 1
Evaluation results
- BLEU on Pali-Sinhala parallel corpus (custom)test set self-reported26.280
- chrF on Pali-Sinhala parallel corpus (custom)test set self-reported51.340
- chrF++ on Pali-Sinhala parallel corpus (custom)test set self-reported48.060