Downloads · 30 days
50
13% of all-time downloads
mclanorjeff/NLLB-Twi-Human-Aligned
NLLB-Twi-Human-Aligned is a translation model from mclanorjeff. Use it when you need text moved from one language to another. It is set up for peft. The card lists the license as mit.
This repository contains a QLoRA adapter for the NLLB-200 (600M) model, specifically fine-tuned for high-fidelity Twi-to-English translation. This model is the result of a two-stage alignment framework designed to ach…
Downloads · 30 days
50
13% of all-time downloads
All-time downloads
391
Public
Repo size
41.7 MB
Likes
1
Public
Click a slice to open those files.
.json32.5 MB · 77%
From the Hugging Face model README
This repository contains a QLoRA adapter for the NLLB-200 (600M) model, specifically fine-tuned for high-fidelity Twi-to-English translation. This model is the result of a two-stage alignment framework designed to achieve state-of-the-art performance on low-resource hardware.
| Metric | Score |
|---|---|
| BLEU | 41.99 |
| chrF++ | 61.21 |
Note: Evaluation was conducted on a held-out set of 500 sentences from the GhanaNLP Pristine corpus.
The model was developed using a two-stage curriculum to balance structural accuracy with conversational naturalness:
The model can be loaded directly using the Transformers library. The base NLLB model weights will be inferred and loaded automatically from the adapter configuration.
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
import torch
model_id = "mclanorjeff/NLLB-Twi-Human-Aligned"
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_id, src_lang="aka_GH")
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
# Inference
text = "Meresua Twi kasa kyerɛ wo."
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
output_ids = model.generate(
**inputs,
forced_bos_token_id=tokenizer.convert_tokens_to_ids("eng_Latn"),
max_length=128,
num_beams=5
)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True))
This model is intended for research and development in African NLP. It is optimized for Twi-to-English translation across various domains, including conversational and formal text.
We acknowledge the GhanaNLP community for providing the foundational datasets that made this research possible.