Instructions to use ckuma/lugbara-multilingual-translator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ckuma/lugbara-multilingual-translator 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-multilingual-translator")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("ckuma/lugbara-multilingual-translator") model = AutoModelForSeq2SeqLM.from_pretrained("ckuma/lugbara-multilingual-translator", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Use the fusion model instead. This XLM-R encoder-decoder (version 2, documented below) did not learn to translate on SALT: BLEU 0.00 (version 1 reached 0.29). For English to Lugbara and English to Luganda, use ckuma/lugbara-ensemble-translator, the XLM-R + mT5 fusion model (8.14 and 6.72 BLEU). For Lugbara to English and Luganda to English, use ckuma/lugbara-english-translator, the mT5 model (12.71 and 16.65 BLEU).
XLM-R EnglishβLugbara/Luganda translator
Fine-tuned FacebookAI/xlm-roberta-base for English β Lugbara, English β Luganda.
It follows the model choice and training method of C. D. Akuma, An Optimized Machine
Translation Model for Low-Resource Lugbara Language, MSc Computer Science, Muni University
(October 2025): XLM-R was the thesis's optimised EnglishβLugbara model.
How to use
Put the target-language tag in front of the sentence and use lowercase text, as in training.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tok = AutoTokenizer.from_pretrained("ckuma/lugbara-multilingual-translator")
model = AutoModelForSeq2SeqLM.from_pretrained("ckuma/lugbara-multilingual-translator")
def translate(text, tag):
x = tok(tag + " " + text.lower(), return_tensors="pt")
y = model.generate(**x, num_beams=4, max_new_tokens=128)
return tok.decode(y[0], skip_special_tokens=True)
print(translate("women and girls' voices are often excluded from decision making.", "<2lgg>"))
print(translate("the cars have to be serviced before they go out to the field.", "<2lgg>"))
Tags: <2lgg> for English β Lugbara, <2lug> for English β Luganda.
Results (test split, 4656 sentence pairs)
| Direction | Sentences | BLEU β | TER β | Word F1 β | chrF β | Apostrophe integrity β | Thesis best BLEU* |
|---|---|---|---|---|---|---|---|
| English β Lugbara | 2328 | 0.0 | 99.94 | 0.0016 | 0.85 | 0.0035 | 22.18 (XLM-R (tuned)) |
| English β Luganda | 2328 | 0.0 | 99.88 | 0.0047 | 0.96 | β | β |
BLEU and TER are sacreBLEU corpus scores; word F1 is unigram precision/recall F1; apostrophe
integrity is the share of apostrophe words in the reference ('ba, a'dule β¦) reproduced intact.
*The thesis scores were measured on the thesis's own corpus, not on SALT, so they are a
reference point rather than a like-for-like comparison.
Sample test translations (English β Lugbara)
| Source | Reference | Model |
|---|---|---|
| women and girls' voices are often excluded from decision making. | ba erini tutuni o'duko oku eyini azini ezoanzi eyini ri e'yo peta pezu 'diyi ma alea ku | |
| the cars have to be serviced before they go out to the field. | ba ma 'ye mutukari ma rua e'deta eri 'bazu pa dria 'diyi ra ka de nga fu ni mu amve azia ku | |
| some of the government officials in uganda are just appointed into office. | ba lu azi'ba gameteni kari uganda niri ma alea 'diyi ma azi eyini azi fefe | diyi |
| the personal protective equipment is heavy and hot. | bongo azi'ba yi ageyi tepiri yini suu ri nzi nzi dika dri dri. | diyi |
| the task force managed to contain the spread of diseases in the district. | drice'ba azo korona niri ni 'diyi o'bi azo eyi ma ereta distrikitia ri atri ra | |
| the area is out of bounds. | pari ndea 'ba leni 'ba ma ca ku | |
| what could be the hindrances to the future development of youths? | e'yo ecopi 'ba ode eyi ma zota ewu drialeri ma alea ri atri pi ra 'diyi a'duni? | e |
| my grandfather died when he was eighty eight years old. | ma a'bi dra de eri ma eli kali aro drini aro. |
Training
Data: the thesis corpus (15,524 EnglishβLugbara pairs) is not public, so the same number of sentences was drawn at random (seed 13) from the cleaned Sunbird SALT
text-alltable and split 70/15/15 like the thesis: 10,867 train, 2,329 validation, 2,328 test. Luganda uses the same sentences. SALT has no domain labels, so the split is random rather than stratified by domain.Preprocessing (thesis Β§3.2.2): lowercased, punctuation normalised, all apostrophe variants folded to
', empty / duplicate / malformed pairs removed.Model: encoder-decoder warm-started from XLM-R base (Rothe et al., 2020), encoder and decoder weights shared.
Hyperparameters (thesis Β§3.4.3): grid search over learning rate Γ batch size (3e-05/16 β 0.0 BLEU, 3e-05/32 β 0.07 BLEU, 5e-05/16 β 0.04 BLEU, 5e-05/32 β 0.1 BLEU, 0.0001/16 β 0.01 BLEU, 0.0001/32 β 0.06 BLEU), then fine-tuning with lr 5e-05, batch 32, optimiser adamw_torch, early stopping on validation loss (patience 5); 4,080 steps, 34.2 minutes on a Kaggle GPU.
Version 2: grid settings compared after 2 passes instead of 1; the cross-attention layers (new, randomly initialised) learn at 10x the grid learning rate; label smoothing 0.1; early-stopping patience 5; repeated 3-word phrases are blocked when generating. Version 1 (1-pass grid, patience 3, no repeat blocking) stopped at validation loss 4.46 and scored BLEU 0.29 / 0.16 because its output looped.
See LUGBARA_ANALYSIS.md for the Lugbara language analysis of the training data.
Limits
- Trained on short SALT sentences (agriculture, health, community life); other domains are weaker.
- Lowercase only. Tone is not written in Lugbara, so tone-only differences are lost.
- Automatic scores use one reference per sentence; Lugbara speakers should review output before use.
Credits
- Thesis and method: Charity Driciru Akuma, Muni University (2025).
- Data: Sunbird AI, SALT (CC BY-SA 4.0).
- Base model:
FacebookAI/xlm-roberta-base. - Earlier work: mmuniversity/rutooro-multilingual-translator (Mountains of the Moon University).
- Downloads last month
- -
Model tree for ckuma/lugbara-multilingual-translator
Base model
FacebookAI/xlm-roberta-base


