nkrane-mt-opus-en2tw)ghanaopenai/nkrane-mt-opus-en2tw is an entity-grounded English $\to$ Asante Twi translation model based on Helsinki-NLP/opus-mt-en-tw, fine-tuned on the 769,594-pair Nkrane-MT Parallel Corpus using dual-sided entity bracket preservation.
Part of the Nkrane-MT pipeline developed by GhanaOpenAI.
Evaluated on held-out test splits with live SacreBLEU, chrF2, and post-translation dictionary substitution:
| Metric | Substituted (Final Output) | Raw (Bracketed Generation) |
|---|---|---|
| SacreBLEU | 29.72 | 24.63 |
| chrF2 | 50.34 | 46.95 |
| Evaluation Loss | 1.551 | - |
Note: The +5.09 BLEU gain from Raw to Substituted reflects the pipeline's offline dictionary and reranker resolving preserved English entity brackets into natural Twi.
If you provide plain English text, the model generates fluent, complete Twi directly without any brackets:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("ghanaopenai/nkrane-mt-opus-en2tw")
model = AutoModelForSeq2SeqLM.from_pretrained("ghanaopenai/nkrane-mt-opus-en2tw")
text = "The president of Ghana visited the military hospital in Accra yesterday."
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True)[0])
# -> Ghana ɔmampanyin kɔsraa asraafo ayaresabea a ɛwɔ Accra no da a etwaam no.
nkrane_mt)To preserve specific entities or resolve them through an offline glossary and contextual reranker:
pip install git+https://github.com/GhanaOpenAI/nkrane-mt.git
from nkrane_mt.inference import NkraneMTTranslator
translator = NkraneMTTranslator(
model="ghanaopenai/nkrane-mt-opus-en2tw",
marker_model_name="ghanaopenai/nkrane-mt-marker-en",
use_default_dictionary=True, # Resolves preserved terms into Twi
)
result = translator.translate("The president of Ghana visited the military hospital in Accra yesterday.")
print(result["translation"])
# -> Ghana mampanyin no kɔsraa military ayaresabea no wɔ Nkran da a etwaam no.
You can also provide custom term mappings:
result = translator.translate(
"The doctor gave medicine to the patient.",
custom_glossary={"patient": "ɔyarefoɔ"}
)
Helsinki-NLP/opus-mt-en-tw)ghanaopenai/nkrane-mt-parallel-corpus-eng-twi)bfloat16 + TF32 on NVIDIA H200@misc{nkrane-mt-2026,
author = {GhanaOpenAI},
title = {Nkrane-MT: Entity-Grounded English-Twi Translation Pipeline},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/ghanaopenai/nkrane-mt-opus-en2tw}}
}
Helsinki-NLP/opus-mt-en-tw