masse_finetuned is a 89M-parameter encoder-decoder Transformer that translates Runyankole → Lugbara and Lugbara → Runyankole with one model, directly, with no English on either side. The direction is set by a prefix token on the source (<2lgg> / <2nyn>; the tag names the target language).
Pretrained on machine-translated tulati pairs (
amDANIEL2024/masse_base), then fine-tuned on the human-translated SALT train split. Scores below are on the complete SALT test set.
pip install torch sentencepiece safetensors huggingface_hub
import sys
from huggingface_hub import snapshot_download
folder = snapshot_download("amDANIEL2024/masse_finetuned") # add token="hf_..." if the repo is still private
sys.path.insert(0, folder)
from masse import Translator
t = Translator(folder) # uses the GPU if there is one
print(t.translate("<a Runyankole sentence>", "nyn2lgg"))
print(t.translate(["<a Lugbara sentence>"], "lgg2nyn"))
Directions are "nyn2lgg" and "lgg2nyn". 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.
| 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, 32,000 pieces, trained on Runyankole and Lugbara text only (spm.model) |
| Context | 256 positions (sinusoidal); training pairs were limited to 128 pieces per side |
| Weights | model.safetensors (float32) |
amDANIEL2024/masse_base.| Set | Direction | n | BLEU | chrF | chrF++ | Copy-baseline chrF++ |
|---|---|---|---|---|---|---|
| SALT test | nyn→lgg | 500 | 13.66 | 42.20 | 39.94 | 11.70 |
| SALT test | lgg→nyn | 500 | 10.16 | 45.15 | 40.30 | 11.40 |
| SALT dev | nyn→lgg | 500 | 15.85 | 43.01 | 40.93 | 11.99 |
| SALT dev | lgg→nyn | 500 | 8.71 | 45.30 | 40.49 | 11.67 |
Beam 4, length penalty 0.6; scored with sacreBLEU. 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: it shows how much of the score is just shared words, names and numbers.
SALT dev was used to choose the checkpoint, so dev scores are slightly optimistic; test is the headline.
Note that SALT's Runyankole and Lugbara sentences are independent human translations of the same English sentence, so a reference in one language is not a translation of the reference in the other.
model.safetensors weights · config.json architecture and training summary · spm.model tokenizer · masse.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