XLM-R English→Lugbara translator (local corpus)

Fine-tuned FacebookAI/xlm-roberta-base for English → Lugbara. 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.

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 its SALT-trained twin ckuma/lugbara-multilingual-translator, so the two can be compared.

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-local")
model = AutoModelForSeq2SeqLM.from_pretrained("ckuma/lugbara-multilingual-translator-local")

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('have you thought about recruiting a new team?', '<2lgg>'))
print(translate('he was a very prominent politician.', '<2lgg>'))

Tags: <2lgg> for English → Lugbara.

Results (local corpus test split, 2141 sentence pairs)

Direction Sentences BLEU ↑ TER ↓ Word F1 ↑ chrF ↑ Apostrophe integrity ↑ Thesis best BLEU*
English → Lugbara 2141 0.6 124.2 0.1175 16.07 0.0231 22.18 (XLM-R (tuned))

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 come from the thesis's own split and cleaning of its corpus, so they are a reference point rather than an exact like-for-like comparison.

Test scores

Quality by sentence length

Training and validation loss

Trained on SALT vs trained on the local corpus

The same 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-multilingual-translator) 0.29 / 16.15 0.22 / 15.79
Local corpus (this model) 0.18 / 13.24 0.6 / 16.07

SALT vs local corpus

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.

Sample test translations (English → Lugbara)

Source Reference Model
have you thought about recruiting a new team? mi ma egata azini ba odi yi eduzu azia ci ya? mi ara kas kas ' 'utiveveve ' ' ' '
he was a very prominent politician. aku amboo a niri eri ovu nizaru 'adisia? aku amboo ni niri eri ovu niz nizaruadisiaisia??
the office has no paper. jo were azitiri ma karatasiyo. jo ' 'a yo yo yo yo
what is happening in uganda? a'du e'yo ni i 'ye kari uganda niri ma alea ni?? e''yo u u u u u ma ma ma???????
the conflict has been ongoing for years. ngiringiri 'da ebi mu drile eli karakara oni rehe eyi anguuu maka et et 'dezuriauria
he was accused of theft by his neighbors. zoza ezuru onthefti omvele nagherita a s a ovu oni his madria zoza ezuru on ' om om om om om naritarita ovu ovu oni madri madri madri madri madri madriaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
always have a driving permit whenever you're driving le mi aa mi ma karatasi mutukari onzuzu ri be sa'wa dria mini mutukari onzuzu ri si. le mi mi mutu mutu mutu mutu mutu mutu mutu mutu mutu mutu mutu mutu mi miriariariariariariariariariariaria
residents in arua district have engaged in business activities. ba aa'pi arua 'diyi e'do tujari 'ye 'bo. ba auauauauauauaua ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

Training

  • Data: the local English–Lugbara corpus (Akuma1992/NLP-data-set, datasetnlp .csv, 15,525 rows). Empty / duplicate / malformed pairs removed (1,163 / 60 / 25), leaving 14,277 pairs, split 70/15/15 at random (seed 13): 9,994 train, 2,142 validation, 2,141 test. The corpus 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: no new grid search: the learning rate and batch size that the SALT grid search chose for ckuma/lugbara-multilingual-translator (lr 3e-05, batch 16), optimiser adamw_torch, early stopping on validation loss (patience 3); 6,875 steps, 38.5 minutes on a Kaggle GPU.

  • Same model and settings as the first SALT-trained XLM-R (version 1: learning rate 3e-5, batch 16, the winner of its SALT grid search); only the training data differs.

See LUGBARA_ANALYSIS.md for the Lugbara language analysis of the training data.

Limits

  • Trained on 9,994 sentence pairs from one corpus; text from other domains may be translated less well (see the SALT cross-test above).
  • 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: Charity Driciru Akuma, local English–Lugbara corpus (GitHub). Its repository states no licence; ask the author before reusing the data.
  • Cross-test 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
18
Safetensors
Model size
0.3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ckuma/lugbara-multilingual-translator-local

Finetuned
(4,305)
this model