apio_base: direct Acholi ⇄ English translation (pretrained base)
apio_base is a 89M-parameter encoder-decoder Transformer that translates Acholi → English and English → Acholi with one model. The direction is set by a prefix token on the source (<2eng> / <2ach>; the tag names the target language).
This is a pretrained base, not a finished translator. It was trained only on machine-translated pairs (see Training) and has not been fine-tuned on human-translated data. A fine-tuned version is published separately as
amDANIEL2024/apio_finetuned.
Quick start
pip install torch sentencepiece safetensors huggingface_hub
import sys
from huggingface_hub import snapshot_download
folder = snapshot_download("amDANIEL2024/apio_base") # add token="hf_..." if the repo is still private
sys.path.insert(0, folder)
from apio import Translator
t = Translator(folder) # uses the GPU if there is one
print(t.translate("<a Acholi sentence>", "ach2eng"))
print(t.translate(["<a English sentence>"], "eng2ach"))
Directions are "ach2eng" and "eng2ach". 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 Acholi and English text only (spm.model) |
| Context | 256 positions (sinusoidal); training pairs were limited to 128 pieces per side |
| Weights | model.safetensors (float32) |
Training
- Data: the Acholi–English pairs of tulati, used in both directions. In tulati the English column is the source text and every other language column is a machine translation of it, made by Sunbird/translate-nllb-1.3b-salt; so the Acholi side of every pair is machine output and no human-written Acholi is in it. This card does not report how good that translator is for Acholi.
- Filtering (counts from this run): of 1,534,699 tulati rows, 61,272 were dropped by tulati's quality flags (empty, degenerate, looks-like-English, length-outlier; flagged in Acholi: 61,272; flags are not applied to English text). Then 2,680 pairs with identical sides and 0 exact duplicates were removed, leaving 1,470,747 pairs. Decontamination against SALT dev/test removed 1 pair(s), leaving 1,470,746; 2,000 of those were held out for validation.
- Tokenizer: trained on tulati plus the text of the SALT train split (Acholi and English only).
- Pretraining: 5 epochs, 20,027 optimizer steps (about 25k target tokens per step), fp16 on one Kaggle T4, label smoothing 0.1, AdamW, linear warmup then inverse-sqrt decay (peak LR 3e-4). Trained on tulati only.
Evaluation
Full SALT dev/test scores: not run for this base yet. SALT test has not been used for anything.
End of pretraining (step 20,027), quick checks:
| Set | Direction | Loss | Quick chrF++ (greedy, first 128 sentences) |
|---|---|---|---|
| tulati validation (held-out machine-translated pairs) | ach→eng | 1.803 | 47.77 |
| tulati validation (held-out machine-translated pairs) | eng→ach | 0.799 | 66.51 |
| SALT dev (human translations) | ach→eng | 2.432 | 38.88 |
| SALT dev (human translations) | eng→ach | 3.121 | 43.50 |
The quick chrF++ is a noisy check on a small subset with greedy decoding; it is not comparable to full-set scores.
Limitations
- Training pairs are machine output (see Training), so the model inherits that translator's errors and style; real human-written text (dialect, spelling, code-switching) may be handled worse than benchmark numbers 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 Acholi speakers.
Files
model.safetensors weights · config.json architecture and training summary · spm.model tokenizer · apio.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
- -