Loading…
Loading…
AfriSpeech/afrigloss-opus-mt-fr-ig is a production glossary-constrained machine translation model for French $\rightarrow$ Igbo, fine-tuned under the Afri-Gloss-MT framework.
Part of the Afri-Gloss-MT Models Collection.
<target_term>) inside the source sentence, and reliably preserves them in the generated translation.AfriSpeech/africa-corpus and AfriSpeech/african-corpus-jw with 100% verified in-place noun-chunk replacements.transformers)from transformers import MarianMTModel, MarianTokenizer
model_name = "AfriSpeech/afrigloss-opus-mt-fr-ig"
tokenizer = MarianTokenizer.from_pretrained(model_name)
model = MarianMTModel.from_pretrained(model_name)
# 1. Plain source sentence with in-place target glossary insertion
prompt = "The <nna> gave <ndụ> and <udo> to his family."
inputs = tokenizer(prompt, return_tensors="pt", padding=True)
translated_tokens = model.generate(**inputs, max_length=128, num_beams=4)
translation = tokenizer.decode(translated_tokens[0], skip_special_tokens=True)
print("Output Translation:", translation)
# Output preserves the injected terms fluently!
This model was trained on the ibo subset of the official dataset:
"ig"@article{owusu2026afrigloss,
title={Afri-Gloss-MT: In-Place Glossary Constraints for African Machine Translation},
author={Owusu, Mich-Seth},
journal={arXiv preprint},
year={2026}
}