Downloads · 30 days
33
5% of all-time downloads
AnasAber/nllb-enhanced-darija-eng_v1.1
nllb-enhanced-darija-eng_v1.1 is a text generation model from AnasAber. Use it when you need the model to write or continue text. It is set up for transformers.
This is an ongoing project, constantly improving as the model is training on more data.
Downloads · 30 days
33
5% of all-time downloads
All-time downloads
727
Public
Parameters
3.3B
37.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors13.4 GB · 100%
From the Hugging Face model README
This is an ongoing project, constantly improving as the model is training on more data.
This model is a fine-tuned version of Facebook's NLLB-200 3.3B model, specifically optimized for translation between Moroccan Arabic (Darija) and English. It leverages the power of the base NLLB model while being tailored for the nuances of Darija, making it particularly effective for Moroccan Arabic to English translations and vice versa.
For now, the model is trained on a dataset of 40,000 sentence pairs:
Each entry in the dataset contains:
This model is intended to be used directly for translating text from Moroccan Arabic (Darija) to English. It can be deployed in various applications requiring translation services.
This model is designed for:
It can be particularly useful for:
The model can be integrated into various applications, such as:
The model's performance may be influenced by biases present in the training data, such as the representation of certain dialectal variations or cultural nuances. Additionally, the model's accuracy may vary depending on the complexity of the text being translated and the presence of out-of-vocabulary words.
This model should not be used for:
To use this model:
Install the Transformers library:
pip install transformers
Load the model and tokenizer:
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_name = "AnasAber/nllb-enhanced-darija-eng_v1.1"
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
Translate text:
def translate(text, src_lang, tgt_lang):
inputs = tokenizer(text, return_tensors="pt")
translated = model.generate(**inputs, forced_bos_token_id=tokenizer.lang_code_to_id[tgt_lang])
return tokenizer.batch_decode(translated, skip_special_tokens=True)[0]
# Darija to English
darija_text = "كيفاش نقدر نتعلم الإنجليزية بسرعة؟"
english_translation = translate(darija_text, src_lang="ary_Arab", tgt_lang="eng_Latn")
print(english_translation)
# English to Darija
english_text = "How can I learn English quickly?"
darija_translation = translate(english_text, src_lang="eng_Latn", tgt_lang="ary_Arab")
print(darija_translation)
Remember to handle exceptions and implement proper error checking in production environments.
[Include any relevant citations or references here]
For questions or feedback about this model, please contact Anas ABERCHIH at [https://www.linkedin.com/in/anas-aberchih-%F0%9F%87%B5%F0%9F%87%B8-b6007121b/] or [https://github.com/AnasAber].