zewi_finetuned is a 89M-parameter encoder-decoder Transformer that translates Runyankole → Acholi and
Acholi → Runyankole directly, with one model and no English on either side. The direction is set by a prefix token on the
source (<2ach> / <2nyn>; the tag names the target language).
It is amDANIEL2024/zewi_base (pretrained on machine-translated pairs) fine-tuned on the
human-translated Runyankole–Acholi pairs of the SALT train split. Scores on the held-out SALT test set are below.
pip install torch sentencepiece safetensors huggingface_hub
import sys
from huggingface_hub import snapshot_download
folder = snapshot_download("amDANIEL2024/zewi_finetuned") # add token="hf_..." if the repo is still private
sys.path.insert(0, folder)
from zewi import Translator
t = Translator(folder) # uses the GPU if there is one
acholi = t.translate("Okwombeka orugo kukatandika omu kwezi kw'okubanza 2000.", "nyn2ach")
print(acholi)
print(t.translate(acholi, "ach2nyn")) # back again
Directions are "nyn2ach" and "ach2nyn". 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.
Full SALT sets scored with sacreBLEU 2.5.1, beam 4, length penalty 0.6, checkpoint finetune/best.pt.
The copy baseline outputs the source sentence unchanged, which shows how much the two languages overlap on the surface.
| Split | Direction | System | n | BLEU | chrF | chrF++ |
|---|---|---|---|---|---|---|
| test (headline) | nyn→ach | zewi_finetuned | 500 | 14.30 | 39.72 | 37.31 |
| test (headline) | nyn→ach | copy baseline | 500 | 0.14 | 14.61 | 11.73 |
| test (headline) | ach→nyn | zewi_finetuned | 500 | 9.64 | 44.25 | 39.44 |
| test (headline) | ach→nyn | copy baseline | 500 | 0.14 | 12.73 | 10.48 |
| dev (used for checkpoint choice) | nyn→ach | zewi_finetuned | 500 | 14.49 | 40.52 | 38.18 |
| dev (used for checkpoint choice) | nyn→ach | copy baseline | 500 | 0.21 | 14.88 | 12.03 |
| dev (used for checkpoint choice) | ach→nyn | zewi_finetuned | 500 | 9.43 | 45.05 | 40.39 |
| dev (used for checkpoint choice) | ach→nyn | copy baseline | 500 | 0.21 | 12.76 | 10.60 |
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.
No other system was scored. An English-pivot baseline was not run.
The first rows of the SALT test set in each direction, unedited and not selected, mistakes included.
Runyankole → Acholi
Source: Eby'eby'afaashoni biriyo nibigaruza akatwe. Reference: Yub me cital ruk mapatpat manyen tye ka dongo odoco doki. Model: Dul ma pe jenge I kom gamente tye ka dwoko cen jamigi.
Source: Omuzibwe n'endwara erikukwata abantu baingi omu kyanga. Reference: Can mogo obedo two ma nya oyot totwal ikin dano Model: Two ma opoto ni obedo two ma mako dano mapol
Source: Obwoki burungi, nibwija kuruga omukyanga eki. Reference: Moo kic me rwom ma malo obi aa ki kany Model: Moo kic maber obi aa ki ikabedo eni
Source: Akaba akwise naavuga egaaro obwo nyowe ndikwiruka. Reference: Nyakoni obedo ka ngwec ki lela ci an abedo ka ngwec ki tyena. Model: En onongo tye ka dwoyo motoka motoka motoka kun an pe atye ka ngwec.
Source: Aby'obushoboorozi nibahhiga bundi nuuma abastigazi enkwata-buta abaayeyereire akatare k'omu nju Reference: Luloc gitye ka yenyo co aryo ma guyako cupa maket. Model: Dul ma loyo lok kom tic mapat-pat tye ki miti madit tutwal I kom cuk me ot.
Acholi → Runyankole
Source: Yub me cital ruk mapatpat manyen tye ka dongo odoco doki. Reference: Eby'eby'afaashoni biriyo nibigaruza akatwe. Model: Ensonga nsya z'eby'emishono ziriyo nizikura.
Source: Can mogo obedo two ma nya oyot totwal ikin dano Reference: Omuzibwe n'endwara erikukwata abantu baingi omu kyanga. Model: Obworo obumwe n'endwara erikujanjaara juba omu bantu.
Source: Moo kic me rwom ma malo obi aa ki kany Reference: Obwoki burungi, nibwija kuruga omukyanga eki. Model: Obwoki obw'omutindo gw'ahaiguru nibwija kuruga aha.
Source: Nyakoni obedo ka ngwec ki lela ci an abedo ka ngwec ki tyena. Reference: Akaba akwise naavuga egaaro obwo nyowe ndikwiruka. Model: Akaba navuga egaari ndiho.
Source: Luloc gitye ka yenyo co aryo ma guyako cupa maket. Reference: Aby'obushoboorozi nibahhiga bundi nuuma abastigazi enkwata-buta abaayeyereire akatare k'omu nju Model: Abarikukurira ekitongore bariyo nibaronda abashaija babiri abarikuteera ecupa y'akapiira.
| 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 Runyankole and Acholi text only |
| Context | 256 positions (sinusoidal); training pairs were limited to 128 pieces per side |
| Weights | model.safetensors (float32); the checkpoint with the lowest SALT dev loss during fine-tuning |
Stage 1: pretraining (this is amDANIEL2024/zewi_base).
Stage 2: fine-tuning.
model.safetensors weights · config.json architecture and training summary · spm.model tokenizer ·
zewi.py standalone inference code · README.md this card.
Released under the MIT License (as are tulati, the translation model that generated the pretraining data, and SALT).
Amanyire Daniel (amDANIEL2024) · domusdeiug@gmail.com · https://domusdeiug.com