Downloads · 30 days
112
5% of all-time downloads
Farid59/nllb-darija-fr_eng
nllb-darija-fr_eng is a translation model from Farid59. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as apache-2.0.
This repository contains a specialized translation model for Darija (Moroccan Arabic), French, and English, based on the facebook/nllb-200-distilled-600M model.
Downloads · 30 days
112
5% of all-time downloads
All-time downloads
2.5K
Public
Parameters
615M
2.5 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.2 GB · 98%
From the Hugging Face model README
This repository contains a specialized translation model for Darija (Moroccan Arabic), French, and English, based on the facebook/nllb-200-distilled-600M model.
The model has been fine-tuned using the LoRA (Low-Rank Adaptation) technique to enhance its translation capabilities for these specific language pairs, which are often underrepresented in generalist models.
The model can translate in both directions (e.g., French to Darija and Darija to French).
This project was developed following a full MLOps approach, including an automated training and deployment pipeline.
transformersYou can use this model directly with a pipeline from the transformers library.
Make sure you have the necessary libraries installed:
pip install torch transformers sentencepiece
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
# 1. Load the model and tokenizer from the Hub
model_id = "Farid59/nllb-darija-fr_eng"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
# 2. Create the translation pipeline
translator = pipeline("translation", model=model, tokenizer=tokenizer)
# --- Example 1: French to Darija ---
texte_fr = "Bonjour, je voudrais réserver une table pour deux personnes ce soir."
traduction_darija = translator(
texte_fr,
src_lang="fra_Latn",
tgt_lang="ary_Arab"
)
print(f"French -> Darija:")
print(f" Input: {texte_fr}")
print(f" Output: {traduction_darija[0]['translation_text']}")
# Expected output: أهلا, بغيت نحجز طاولا لشخصين هاد الليلا
# --- Example 2: Darija to English ---
texte_darija = "شحال كايكلف هادشي"
traduction_anglais = translator(
texte_darija,
src_lang="ary_Arab",
tgt_lang="eng_Latn"
)
print(f"\nDarija -> English:")
print(f" Input: {texte_darija}")
print(f" Output: {traduction_anglais[0]['translation_text']}")
# Expected output: How much does that cost?
facebook/nllb-200-distilled-600Mfra_Latn (French)eng_Latn (English)ary_Arab (Darija, Arabic script)The model was trained on a composite corpus assembled from several sources:
All data was cleaned, deduplicated, and formatted for bidirectional training.
Training was orchestrated by an automated MLOps pipeline using GitHub Actions. The process includes:
Fine-tuning resulted in a very significant performance improvement on the dedicated test set.
| Model | BLEU Score (on test set) |
|---|---|
facebook/nllb-200-distilled-600M (Base model) | 8.19 |
Farid59/nllb-darija-fr_eng (This fine-tuned model) | 18.9 |
This increase of over 10 BLEU points demonstrates the effectiveness of fine-tuning to specialize the model for the nuances of Darija.
Farid Igouti
This project is part of a portfolio showcasing skills in MLOps, CI/CD, and AI model deployment.