shilla_finetuned is a 89M-parameter encoder-decoder Transformer that translates Luganda → Ateso and
Ateso → Luganda directly, with one model and no English on either side. The direction is set by a prefix token on the
source (<2teo> / <2lug>; the tag names the target language).
It is shilla_base (pretrained only on machine-translated pairs) further
trained on the human-translated Luganda–Ateso 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/shilla_finetuned") # add token="hf_..." if the repo is still private
sys.path.insert(0, folder)
from shilla import Translator
t = Translator(folder) # uses the GPU if there is one
ateso = t.translate("Okuzimba bbugwe kwatandika mu Gatonnya 2000.", "lug2teo")
print(ateso)
print(t.translate(ateso, "teo2lug")) # back again
Directions are "lug2teo" and "teo2lug". 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 Luganda sentence above is shortened from a sample row of the machine-translated training data.)
Complete SALT sets (500 sentences each), 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→teo | model | 500 | 17.52 | 50.50 | 47.04 |
| test | lug→teo | copy baseline (source unchanged) | 500 | 0.66 | 16.13 | 13.69 |
| test | teo→lug | model | 500 | 17.46 | 50.45 | 46.74 |
| test | teo→lug | copy baseline (source unchanged) | 500 | 0.65 | 15.64 | 13.41 |
| dev | lug→teo | model | 500 | 18.40 | 51.64 | 48.14 |
| dev | lug→teo | copy baseline (source unchanged) | 500 | 0.16 | 15.84 | 13.47 |
| dev | teo→lug | model | 500 | 16.70 | 50.44 | 46.43 |
| dev | teo→lug | copy baseline (source unchanged) | 500 | 0.16 | 15.27 | 13.11 |
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 → teo
| Source | Human reference | Model output |
|---|---|---|
| Ekisaawe ky'emisono kitandise okusituka nate. | Ageutu ikampunin luka enape apolo bobo. | Ageu esawe loka igoen aibwo bobo. |
| Endwadde ebalukawo y'endwadde ekosa abantu abangi mu kitundu. | Erai adeka na ikamuni itunga luipu kotoma atutubet. | Adekasinei nueyaitos itunga luipu kotoma atutubet. |
| Omubisi gw'enjuki ogw'omutindo omulungi guva mu kino ekitundu. | Esike lo ejok ebuni kosiep kalo. | esike loajokan elomunit kane. |
| Yabadde avuga ggaali nga nze bwe nziruka. | Auta ngesi aicak egali kauta eong akerit. | Auta ngesi airenge egali kwape ka eong. |
| Ab'obuyinza banoonya abavubuka babiri ababba mu ssemaduuka. | Eutasi ipolisin aimo itelepai iarei luabilete ka akoko eiduka lokapolon. | Emoete apedorosio atumunak iarei lu akokwarete kosemaduuka. |
teo → lug
| Source | Human reference | Model output |
|---|---|---|
| Ageutu ikampunin luka enape apolo bobo. | Ekisaawe ky'emisono kitandise okusituka nate. | Kampuni za pulimiya zitandise okuddamu okukulaakulana. |
| Erai adeka na ikamuni itunga luipu kotoma atutubet. | Endwadde ebalukawo y'endwadde ekosa abantu abangi mu kitundu. | Obulwadde bukwata abantu bangi mu kitundu. |
| Esike lo ejok ebuni kosiep kalo. | Omubisi gw'enjuki ogw'omutindo omulungi guva mu kino ekitundu. | Esike ennungi ejja ku ludda luno. |
| Auta ngesi aicak egali kauta eong akerit. | Yabadde avuga ggaali nga nze bwe nziruka. | Yali avuga eggaali nga ndduka. |
| Eutasi ipolisin aimo itelepai iarei luabilete ka akoko eiduka lokapolon. | Ab'obuyinza banoonya abavubuka babiri ababba mu ssemaduuka. | Poliisi enoonya emikutu ebiri egy'okumenya n'okubba edduuka ekkulu. |
| 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 Ateso text only |
| Context | 256 positions (sinusoidal); training pairs were limited to 128 pieces per side |
| Weights | model.safetensors (float32) |
shilla_base): 17,380 optimizer steps on the Luganda–Ateso 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. Of 1,534,699 tulati rows, 127,024 (8.3%)
were dropped because they were flagged empty, degenerate, looks-like-English or length-outlier in either language (flagged in Luganda: 34,011;
in Ateso: 104,732), then 1,026 identical-side pairs and 483 exact duplicates were removed, and 2 pairs that matched a SALT dev/test sentence;
1,406,164 pairs remained. See the shilla_base card for details.model.safetensors weights · config.json architecture and training summary · spm.model tokenizer ·
shilla.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/shilla_base