akello_finetuned: direct Lugbara ⇄ Ateso translation (fine-tuned model)

akello_finetuned is a 89M-parameter encoder-decoder Transformer that translates Lugbara → Ateso and Ateso → Lugbara with one model, directly, with no English on either side. The direction is set by a prefix token on the source (<2teo> / <2lgg>; the tag names the target language).

Pretrained on machine-translated tulati pairs (amDANIEL2024/akello_base), then fine-tuned on the human-translated SALT train split. Scores below are on the complete SALT test set.

Quick start

pip install torch sentencepiece safetensors huggingface_hub
import sys
from huggingface_hub import snapshot_download

folder = snapshot_download("amDANIEL2024/akello_finetuned")   # add token="hf_..." if the repo is still private
sys.path.insert(0, folder)
from akello import Translator

t = Translator(folder)                                   # uses the GPU if there is one
print(t.translate("<a Lugbara sentence>", "lgg2teo"))
print(t.translate(["<a Ateso sentence>"], "teo2lgg"))

Directions are "lgg2teo" and "teo2lgg". 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.

Model

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 Lugbara and Ateso text only (spm.model)
Context 256 positions (sinusoidal); training pairs were limited to 128 pieces per side
Weights model.safetensors (float32)

Training

  • Data: the Lugbara–Ateso pairs of tulati, used in both directions. In tulati every non-English column is a machine translation of one English column, made by Sunbird/translate-nllb-1.3b-salt; so both sides of every pair are machine output and no human-written Lugbara or Ateso is in it. The English column was not used. This card does not report how good that translator is for Lugbara or Ateso.
  • Filtering (counts from this run): of 1,534,699 tulati rows, 188,556 were dropped by tulati's quality flags (empty, degenerate, looks-like-English, length-outlier; flagged in Lugbara: 104,472, in Ateso: 104,732). Then 1,071 pairs with identical sides and 399 exact duplicates were removed, leaving 1,344,673 pairs. Decontamination against SALT dev/test removed 2 pair(s), leaving 1,344,671; 1,999 of those were held out for validation.
  • Tokenizer: trained on tulati plus the text of the SALT train split (Lugbara and Ateso only).
  • Pretraining: on tulati, as described in amDANIEL2024/akello_base.
  • Fine-tuning: on the SALT train split (human translations), both directions, LR 6e-5, early stopping on SALT dev loss (patience 5 validations); this is the best checkpoint (step 3420). SALT test was used only for the final scores.

Evaluation

Set Direction n BLEU chrF chrF++ Copy-baseline chrF++
SALT test lgg→teo 500 16.83 48.79 45.54 11.63
SALT test teo→lgg 500 14.65 43.90 41.54 11.30
SALT dev lgg→teo 500 17.57 48.90 45.79 11.48
SALT dev teo→lgg 500 17.14 45.14 42.96 11.24

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 Lugbara and Ateso 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.

Limitations

  • Pretraining pairs were machine output and fine-tuning data is limited to SALT, so the model may handle text unlike SALT (other domains, dialect, spelling, code-switching) worse than the scores suggest.
  • Meaning can be dropped or changed, especially for numbers, names and rare words. Do not use it for medical, legal or other high-stakes content without human review.
  • Sentence-level model: inputs longer than about 128 pieces are truncated or degrade.
  • Outputs have not been reviewed by native Lugbara / Ateso speakers.

Files

model.safetensors weights · config.json architecture and training summary · spm.model tokenizer · akello.py standalone inference code · README.md this card.

License

Released under the MIT License (as are tulati, the translation model that generated the training data, and SALT).

Author

Amanyire Daniel (amDANIEL2024) · domusdeiug@gmail.com · https://domusdeiug.com

Downloads last month
-
Safetensors
Model size
89.4M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train amDANIEL2024/akello_finetuned