Downloads · 30 days
7
16% of all-time downloads
Abdeljalil-Ounaceur/nllb-tamazight-souss
nllb-tamazight-souss is a translation model from Abdeljalil-Ounaceur. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
A fine-tuned version of NLLB-200-distilled-600M for English ↔ Tamazight (Kabyle Latin script) translation, trained on a comprehensive dictionary dataset.
Downloads · 30 days
7
16% of all-time downloads
All-time downloads
43
Public
Parameters
615M
2.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.5 GB · 99%
From the Hugging Face model README
A fine-tuned version of NLLB-200-distilled-600M for English ↔ Tamazight (Kabyle Latin script) translation, trained on a comprehensive dictionary dataset.
This model is a fine-tuned version of facebook/nllb-200-distilled-600M specifically adapted for English-Tamazight translation. It was trained on ~9,000 translation pairs from a curated dictionary dataset containing vocabulary, verb conjugations, country names, and cultural phrases.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load the model
tokenizer = AutoTokenizer.from_pretrained("Abdeljalil-Ounaceur/nllb-tamazight-souss")
model = AutoModelForSeq2SeqLM.from_pretrained("Abdeljalil-Ounaceur/nllb-tamazight-souss")
# Translate English to Tamazight
def translate(text, src_lang="eng_Latn", tgt_lang="kab_Latn"):
inputs = tokenizer(text, return_tensors="pt")
# Get target language token
forced_bos_token_id = tokenizer.convert_tokens_to_ids(tgt_lang)
generated_tokens = model.generate(
**inputs,
forced_bos_token_id=forced_bos_token_id,
max_length=50,
num_beams=4,
early_stopping=True
)
return tokenizer.decode(generated_tokens[0], skip_special_tokens=True)
# Example usage
print(translate("house")) # Expected: tamdint
print(translate("water")) # Expected: aman