kieran_finetuned is a 89M-parameter encoder-decoder Transformer that translates Luganda → Runyankole and
Runyankole → Luganda directly, with one model and no English on either side. The direction is set by a prefix token on the
source (<2nyn> / <2lug>; the tag names the target language).
It is kieran_base (pretrained only on machine-translated pairs) further
trained on the human-translated Luganda–Runyankole pairs of the SALT training set. Headline scores on the complete SALT test set are in Evaluation.
pip install torch sentencepiece safetensors huggingface_hub
import sys
from huggingface_hub import snapshot_download
folder = snapshot_download("amDANIEL2024/kieran_finetuned") # add token="hf_..." if the repo is still private
sys.path.insert(0, folder)
from kieran import Translator
t = Translator(folder) # uses the GPU if there is one
print(t.translate("Okuzimba bbugwe kwatandika mu Gatonnya 2000.", "lug2nyn"))
print(t.translate(["Okwombeka orugo kukatandika omu kwezi kw'okubanza 2000."], "nyn2lug"))
Directions are "lug2nyn" and "nyn2lug". 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.
(The two input sentences above are shortened from a sample row of the machine-translated training data.)
Complete SALT sets (n in the table), beam 4, sacreBLEU 2.5.1. Test is the headline. SALT dev was used to stop training and choose the checkpoint, so dev scores are slightly optimistic.
| Split | Direction | System | n | BLEU | chrF | chrF++ |
|---|---|---|---|---|---|---|
| test | lug→nyn | model | 500 | 14.05 | 50.47 | 45.45 |
| test | lug→nyn | copy baseline (source unchanged) | 500 | 0.96 | 26.74 | 22.45 |
| test | nyn→lug | model | 500 | 19.51 | 52.77 | 48.97 |
| test | nyn→lug | copy baseline (source unchanged) | 500 | 0.96 | 27.55 | 23.02 |
| dev | lug→nyn | model | 500 | 12.71 | 51.33 | 46.16 |
| dev | lug→nyn | copy baseline (source unchanged) | 500 | 0.71 | 27.08 | 22.87 |
| dev | nyn→lug | model | 500 | 18.51 | 52.49 | 48.50 |
| dev | nyn→lug | copy baseline (source unchanged) | 500 | 0.72 | 27.59 | 23.21 |
Signatures: BLEU nrefs:1|case:mixed|eff:no|tok:13a|smooth:exp|version:2.5.1; chrF nrefs:1|case:mixed|eff:yes|nc:6|nw:0|space:no|version:2.5.1; chrF++ nrefs:1|case:mixed|eff:yes|nc:6|nw:2|space:no|version:2.5.1.
The copy baseline outputs the source sentence unchanged and scores it against the reference. An English-pivot baseline was not run. Differences of 1 to 2 BLEU on a few hundred sentences are within noise.
The first 5 sentences of each SALT test file, not selected and not edited. The reference is the human translation. Mistakes are included; read the model output critically.
lug → nyn
| Source | Human reference | Model output |
|---|---|---|
| Ekisaawe ky'emisono kitandise okusituka nate. | Eby'eby'afaashoni biriyo nibigaruza akatwe. | Ekishaayi ky'emishono kitandikire kwimuka. |
| Endwadde ebalukawo y'endwadde ekosa abantu abangi mu kitundu. | Omuzibwe n'endwara erikukwata abantu baingi omu kyanga. | Okubarukaho kw'endwara nikuteganisa abantu baingi omu kyanga. |
| Omubisi gw'enjuki ogw'omutindo omulungi guva mu kino ekitundu. | Obwoki burungi, nibwija kuruga omukyanga eki. | Obwoki burungi niburuga omu mwanya ogu. |
| Yabadde avuga ggaali nga nze bwe nziruka. | Akaba akwise naavuga egaaro obwo nyowe ndikwiruka. | Akaba navuga egaari nk'oku naziruka. |
| Ab'obuyinza banoonya abavubuka babiri ababba mu ssemaduuka. | Aby'obushoboorozi nibahhiga bundi nuuma abastigazi enkwata-buta abaayeyereire akatare k'omu nju | Ab'obushoborozi bariyo nibaronda eminyeeto ebiri eyiiba omu maduuka. |
nyn → lug
| Source | Human reference | Model output |
|---|---|---|
| Eby'eby'afaashoni biriyo nibigaruza akatwe. | Ekisaawe ky'emisono kitandise okusituka nate. | Ekitongole ky'eby'empuliziganya kiri mu kudaabiriza kutu. |
| Omuzibwe n'endwara erikukwata abantu baingi omu kyanga. | Endwadde ebalukawo y'endwadde ekosa abantu abangi mu kitundu. | Omulwadde bulwadde obukosa abantu bangi mu kitundu. |
| Obwoki burungi, nibwija kuruga omukyanga eki. | Omubisi gw'enjuki ogw'omutindo omulungi guva mu kino ekitundu. | Omubisi omulungi gujja kuva mu kitundu kino. |
| Akaba akwise naavuga egaaro obwo nyowe ndikwiruka. | Yabadde avuga ggaali nga nze bwe nziruka. | Yali avuga emmotoka ng'adduka. |
| Aby'obushoboorozi nibahhiga bundi nuuma abastigazi enkwata-buta abaayeyereire akatare k'omu nju | Ab'obuyinza banoonya abavubuka babiri ababba mu ssemaduuka. | Ab'eby'enfuna basobola okwongera ku muwendo gw'abantu abafiira mu katale. |
| 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); trained on Luganda and Runyankole text only |
| Context | 256 positions (sinusoidal); training pairs were limited to 128 pieces per side |
| Weights | model.safetensors (float32) |
kieran_base): 5 epochs, 19,305 optimizer steps, on the Luganda–Runyankole pairs of
tulati, both directions. In tulati every non-English column is a
machine translation of one English column, made by
Sunbird/translate-nllb-1.3b-salt; no human-written text is in it, so
both sides of every pretraining pair are machine output. The English column was not used. Rows flagged empty, degenerate,
looks-like-English or length-outlier in either language were dropped (58,115 of 1,534,699), as were identical-side and duplicate pairs;
1,473,618 pairs remained after removing one pair that matched a SALT dev/test sentence. See the kieran_base card for details.| Second fine-tune (not published) | Split | Direction | BLEU | chrF | chrF++ |
|---|---|---|---|---|---|
| lug→nyn examples repeated 2× | dev | lug→nyn | 12.95 | 51.38 | 46.23 |
| dev | nyn→lug | 18.17 | 51.74 | 47.81 | |
| test | lug→nyn | 13.30 | 50.27 | 45.20 | |
| test | nyn→lug | 19.45 | 52.34 | 48.58 |
model.safetensors weights · config.json architecture and training summary · spm.model tokenizer ·
kieran.py standalone inference code · README.md this card.
Released under the MIT License (as are tulati, the translation model that generated the training data, and SALT).
Amanyire Daniel (amDANIEL2024) · domusdeiug@gmail.com · https://domusdeiug.com
amDANIEL2024/kieran_base