Instructions to use ckuma/lugbara-ensemble-translator-local with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ckuma/lugbara-ensemble-translator-local with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="ckuma/lugbara-ensemble-translator-local")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ckuma/lugbara-ensemble-translator-local", device_map="auto") - Notebooks
- Google Colab
- Kaggle
XLM-R + mT5 fusion translator (English β Lugbara, local corpus)
An ensemble of the two models of C. D. Akuma, An Optimized Machine Translation Model for Low-Resource Lugbara Language, MSc Computer Science, Muni University (October 2025). The thesis found XLM-R best for EnglishβLugbara and mT5 best for LugbaraβEnglish; this model fuses them into one network that translates in both directions between English and Lugbara.
It is trained on the local EnglishβLugbara corpus published with the thesis (Akuma1992/NLP-data-set) instead of SALT, with the same settings as the SALT-trained fusion model ckuma/lugbara-ensemble-translator, so the two can be compared.
source βββΊ XLM-R encoder βββΊ projection + LayerNorm ββ
ββββΊ mT5 encoder βββββββββββββββββββββββββββββββ΄ββΊ joint memory βββΊ mT5 decoder βββΊ translation
The mT5 decoder attends over the states of both encoders at every output word; a learned source-type vector tells it which encoder each state came from (dual-encoder fusion, cf. Zhu et al., 2020, Incorporating BERT into Neural Machine Translation).
How to use
The repository holds the two encoders' weights (mt5/, xlmr/), the fusion layers
(fusion_head.safetensors) and the model code (fusion_mt.py, lugbara_mt.py).
import sys
from huggingface_hub import snapshot_download
d = snapshot_download("ckuma/lugbara-ensemble-translator-local")
sys.path.insert(0, d)
import fusion_mt
tm, tx, model = fusion_mt.build(from_dir=d)
print(fusion_mt.translate(tm, tx, model, ["<2lgg> farmers should plant early when the rains begin."]))
print(fusion_mt.translate(tm, tx, model, ["<2en> " + "<a lugbara sentence, lowercase>"]))
Tags: <2lgg> β Lugbara, <2en> β English. Use lowercase input, as in training.
Results (local corpus test split, 4282 sentence pairs)
| Direction | Sentences | BLEU β | TER β | Word F1 β | chrF β | Apostrophe integrity β | BLEU of the single models | Thesis best BLEU* |
|---|---|---|---|---|---|---|---|---|
| English β Lugbara | 2141 | 13.42 | 82.04 | 0.3174 | 34.25 | 0.3279 | 0.6 (XLM-R alone (local)) | 22.18 (XLM-R (tuned)) |
| Lugbara β English | 2141 | 13.4 | 74.95 | 0.3908 | 36.36 | β | 12.18 (mT5 alone (local)) | 25.41 (mT5 (tuned)) |
The single models were trained and scored on exactly the same split. *Thesis scores come from the thesis's own split and cleaning of its corpus, so they are a reference point only.
Trained on SALT vs trained on the local corpus
The same fusion model with the same settings, trained once on each corpus and tested on both test splits (BLEU / chrF; the SALT test split is the 2,328-sentence split of the thesis-sized SALT sample).
| Direction | Trained on | SALT test | Local test |
|---|---|---|---|
| English β Lugbara | SALT (ckuma/lugbara-ensemble-translator) | 8.14 / 35.22 | 10.21 / 33.73 |
| Local corpus (this fusion model) | 11.06 / 31.04 | 13.42 / 34.25 | |
| Lugbara β English | SALT (ckuma/lugbara-ensemble-translator) | 5.72 / 26.53 | 6.96 / 27.08 |
| Local corpus (this fusion model) | 19.58 / 38.42 | 13.4 / 36.36 |
Shared sentences. 6,109 of the 14,277 local pairs have an English sentence that is also in the SALT sample: 649 of the 2,141 local test sentences are in SALT's training split, and 648 of the 2,328 SALT test sentences are in the local training split, so the cross-test cells above are partly helped by sentences seen in training. The table below repeats the comparison without them.
Lugbara word tokens of each test split that never occur in the training split: SALT test 3.5% (SALT train) vs 6.9% (local train); local test 3.3% (local train) vs 8.1% (SALT train). See LUGBARA_ANALYSIS.md.
Only the test sentences the two corpora do not share
Each test split cut to the sentences whose English is not in the other corpus's training split (1,680 SALT test and 1,492 local test sentences), so every cell is scored on sentences none of the models saw in training.
| Direction | Trained on | SALT test (unshared) | Local test (unshared) |
|---|---|---|---|
| English β Lugbara | SALT (ckuma/lugbara-ensemble-translator) | 6.54 / 33.92 | 7.63 / 29.86 |
| Local corpus (this fusion model) | 3.95 / 24.07 | 13.63 / 33.2 | |
| Lugbara β English | SALT (ckuma/lugbara-ensemble-translator) | 5.21 / 25.77 | 3.81 / 24.12 |
| Local corpus (this fusion model) | 8.41 / 29.32 | 11.83 / 34.47 |
Sample test translations
English β Lugbara
| Source | Reference | Fusion model |
|---|---|---|
| have you thought about recruiting a new team? | mi ma egata azini ba odi yi eduzu azia ci ya? | oni ree eyi angu team makala etuni 'dezuria |
| he was a very prominent politician. | aku amboo a niri eri ovu nizaru 'adisia? | aku amboo a niri eri ovu nizaru 'adisia? |
| the office has no paper. | jo were azitiri ma karatasiyo. | ofisi 'da ma alea kuye |
| what is happening in uganda? | a'du e'yo ni i 'ye kari uganda niri ma alea ni?? | e'yo 'ye kari uganda niri ma alea ri a'duni? |
| the conflict has been ongoing for years. | ngiringiri 'da ebi mu drile eli karakara | oni rehe eyi angu years makala etuni 'dezuria |
Lugbara β English
| Source | Reference | Fusion model |
|---|---|---|
| mi ma egata azini ba odi yi eduzu azia ci ya? | have you thought about recruiting a new team? | what are you thinking of being a youth? |
| aku amboo a niri eri ovu nizaru 'adisia? | he was a very prominent politician. | he is a member of parliament. |
| jo were azitiri ma karatasiyo. | the office has no paper. | the offices were closed. |
| a'du e'yo ni i 'ye kari uganda niri ma alea ni?? | what is happening in uganda? | what is the history of uganda? |
| ngiringiri 'da ebi mu drile eli karakara | the conflict has been ongoing for years. | the riots have been between the two years. |
Training
- Data: the local EnglishβLugbara corpus (Akuma1992/NLP-data-set, 15,525 rows; 1,163 / 60 / 25 empty / duplicate / malformed pairs removed), 9,994 / 2,142 / 2,141 pairs (train / validation / test, random, seed 13); every pair is used in both directions.
- Learning rates: mT5 and the fusion layers 0.001 (mT5's grid-search winner on SALT); XLM-R 3e-05 (XLM-R's grid-search winner on SALT); Adafactor; XLM-R's word embeddings frozen.
- Training: batch 16, early stopping on validation loss (patience 3), 11,250 steps, 168.4 minutes on a Kaggle T4; 860M parameters (668M trained).
See LUGBARA_ANALYSIS.md for the Lugbara language analysis of the training data.
Limits
- Trained on 9,994 sentence pairs from one corpus; other domains may be translated less well (see the SALT cross-test above).
- Lowercase only; Lugbara tone is not written, so tone-only differences are lost.
- Automatic scores use one reference per sentence; Lugbara speakers should review output before use.
Credits
Thesis, method and data: Charity Driciru Akuma, Muni University (2025); the corpus repository (GitHub) states no licence, so ask the author before reusing the data Β· Cross-test data: Sunbird AI, SALT (CC BY-SA 4.0)
Β· Base models: google/mt5-base, FacebookAI/xlm-roberta-base Β· Earlier work: mmuniversity/rutooro-multilingual-translator.
Model tree for ckuma/lugbara-ensemble-translator-local
Base model
FacebookAI/xlm-roberta-base





