Downloads · 30 days
21
2% of all-time downloads
AnasAber/seamless-darija-eng
seamless-darija-eng 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.
- Model Name: seamless-darija-eng - Base Model: facebook/seamless-m4t-v2-large - Model Type: Fine-tuned translation model - Languages: Moroccan Arabic (Darija) ↔ English - Developer: Anas ABERCHIH
Downloads · 30 days
21
2% of all-time downloads
All-time downloads
1.2K
Public
Parameters
1.4B
5.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.5 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of Facebook's Seamless large m4t-v2 model, specifically optimized for translation between Moroccan Arabic (Darija) and English. It leverages the power of the base Seamless model while being tailored for the nuances of Darija, making it particularly effective for Moroccan Arabic to English translations and vice versa.
The model was trained on two datasets.
First on a dataset of 40,000 sentence pairs:
Training set: 32,780 pairs Validation set: 5,785 pairs Test set: 6,806 pairs
And second, on a dataset of 82,332 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 further fine-tuned, and deployed in various applications requiring translation services. This version is more capable than the original model in Darija to English translation.
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/seamless-darija-eng"
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", tgt_lang="eng")
print(english_translation)
# English to Darija
english_text = "How can I learn English quickly?"
darija_translation = translate(english_text, src_lang="eng", tgt_lang="ary")
print(darija_translation)
Remember to handle exceptions and implement proper error checking in production environments.
For questions, citations, 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 my linked github account.