nami_finetuned: English ⇄ Luganda translation
nami_finetuned is a 89M-parameter encoder-decoder Transformer that translates English → Luganda and
Luganda → English with one model (the direction is set by a prefix token, <2lug> / <2eng>).
It is nami, pretrained on machine-translated pairs, then fine-tuned on the
human-translated SALT train split.
Results
Scores on the complete human-translated SALT sets (beam 4, one reference per sentence, sacreBLEU). Test is the headline: no training or selection decision used it. Dev was used to pick the checkpoint, so its scores are slightly optimistic.
| Split | Direction | Sentences | BLEU | chrF++ |
|---|---|---|---|---|
| test | English → Luganda | 500 | 27.5 | 57.2 |
| test | Luganda → English | 500 | 34.4 | 55.3 |
| dev | English → Luganda | 500 | 29.0 | 58.4 |
| dev | Luganda → English | 500 | 33.8 | 55.7 |
Signatures: nrefs:1|case:mixed|eff:no|tok:13a|smooth:exp|version:2.5.1 · nrefs:1|case:mixed|eff:yes|nc:6|nw:2|space:no|version:2.5.1
Compared with the teacher and with the pretrained base
The Luganda pretraining data was produced by Sunbird/translate-nllb-1.3b-salt, a 1.3B-parameter model fine-tuned on SALT.
| English → Luganda, SALT test | BLEU | chrF |
|---|---|---|
Sunbird/translate-nllb-1.3b-salt |
30.4 | 63.2 |
| nami_finetuned | 27.5 | 61.1 |
| nami (pretrained base, before SALT fine-tuning) | 24.8 | 59.0 |
| Luganda → English, SALT test | BLEU | chrF++ |
|---|---|---|
| nami (pretrained base) | 26.1 | 47.9 |
| nami_finetuned | 34.4 | 55.3 |
- Teacher figures come from the tulati documentation and were measured on the SALT test set; the teacher's decoding settings are not recorded. chrF is plain chrF (no word n-grams), computed the same way for nami_finetuned (the chrF++ column above is a slightly stricter metric).
- No teacher figure exists for Luganda → English.
- With 500 sentences, differences of 1 to 2 BLEU are within noise.
Quick start
pip install torch sentencepiece safetensors huggingface_hub
import sys
from huggingface_hub import snapshot_download
folder = snapshot_download("amDANIEL2024/nami_finetuned") # add token="hf_..." if the repo is still private
sys.path.insert(0, folder)
from nami import Translator
t = Translator(folder) # uses the GPU if there is one
print(t.translate("Parents educate their children.", "eng2lug"))
print(t.translate(["Abazadde basomesa abaana baabwe."], "lug2eng"))
Directions are "eng2lug" and "lug2eng". translate takes a string or a list and accepts beam (default 4).
This is a custom PyTorch model, not a transformers model, so AutoModel will not load it.
Example outputs (SALT test set, unedited, beam 4)
| Direction | Source | Human reference | nami_finetuned |
|---|---|---|---|
| EN → LG | Good quality honey will come from this region. | Omubisi gw'enjuki ogw'omutindo omulungi guva mu kino ekitundu. | Omubisi gw'enjuki omulungi gujja kuva mu kitundu kino. |
| EN → LG | An epidemic is a disease that affects a large number of people within a community. | Endwadde ebalukawo y'endwadde ekosa abantu abangi mu kitundu. | Ekirwadde bbunansi bulwadde obukosa abantu bangi mu kitundu. |
| LG → EN | Omubisi gw'enjuki ogw'omutindo omulungi guva mu kino ekitundu. | Good quality honey will come from this region. | Good quality honey comes from this community. |
| LG → EN | Ekisaawe ky'emisono kitandise okusituka nate. | The fashion industry is starting to thrive again. | The fashion stadium has started to rise again. |
Paragraph Translation Example
English Original:
Education is very important for the future of our children. When we support schools and help teachers, we build a strong community where everyone can succeed and live a good life.
Luganda Translation:
Okusoma kwa mugaso nnyo eri ebiseera by'abaana baffe eby'omu maaso. Bwe tuyamba amasomero n'abasomesa, tuzimba ekitundu eky'amaanyi buli omu mw'asobola okutuuka ku buwanguzi n'okubeera n'obulamu obulungi.
Luganda Original:
Okusomesa abaana kintu kikulu nnyo mu kitundu kyaffe. Ssinga buli muntu awayo obuyambi eri amasomero g'ewaffe, tujja kusobola okukuza abakulembeze b'omu maaso abalungi n'okulwanyisa obwavu mu ggwanga.
English Translation:
Educating children is an important part of our community.It everyone away from support to our schools, we will be able to grow good future leaders and fight poverty in the country.
Model
| Architecture | pre-LN Transformer encoder-decoder, 6 + 6 layers, d_model 640, 8 heads, FFN 2560, GELU |
| Parameters | 89M (input embedding, decoder embedding and output projection are tied) |
| Tokenizer | shared SentencePiece unigram, 32,000 pieces, case preserved, digits split (spm.model) |
| Context | 256 positions (sinusoidal); training pairs were limited to 128 pieces per side |
| Weights | model.safetensors (float32) |
Training
- Pretraining (this is the
namibase): tulati pairs, about 1.5M after filtering, used in both directions, 5 epochs / 19,825 optimizer steps on one Kaggle T4 (fp16). The English side is the full pool of agentlans/high-quality-english-sentences; the Luganda side is machine-translated from it with Sunbird/translate-nllb-1.3b-salt. Pairs overlapping the SALT dev/test sets were removed. - Fine-tuning on the human-translated SALT train split (23,947 pairs, both directions): peak learning rate 6e-5 (100-step warmup, then inverse-sqrt decay), up to about 8k tokens per step, label smoothing 0.1. The model was checked on SALT dev every 100 steps and the checkpoint with the lowest dev loss was kept (step 1,500, dev loss 1.481).
- Evaluation on SALT test, which was used for nothing else.
The tokenizer was trained on tulati plus the text of the SALT train split.
Limitations
- Most of the training data is machine-translated Luganda, so the model inherits that translator's errors and style; the human-translated SALT fine-tuning (about 24k pairs) corrects only part of this.
- Meaning can be changed, especially for rare words, names and numbers (see the examples above). Do not use it for medical, legal or other high-stakes content without human review.
- The English side is general web text, so other domains may be weaker.
- Sentence-level model: inputs longer than about 128 pieces are truncated or degrade.
Files
model.safetensors weights · config.json architecture and training summary · spm.model tokenizer ·
nami.py standalone inference code · README.md this card.
- Downloads last month
- 40