Instructions to use guymorlan/levanti_translate_en_ar with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use guymorlan/levanti_translate_en_ar with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="guymorlan/levanti_translate_en_ar")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("guymorlan/levanti_translate_en_ar") model = AutoModelForSeq2SeqLM.from_pretrained("guymorlan/levanti_translate_en_ar") - Notebooks
- Google Colab
- Kaggle
metadata
license: cc-by-nc-4.0
datasets:
- guymorlan/levanti
language:
- ar
- en
pipeline_tag: translation
widget:
- text: P I wanna go to the store tomorrow
Levanti (English -> colloquial Levantine Arabic) translator
Trained on the Levanti dataset by fine-tuning Helsinki-NLP/opus-mt-en-ar for 8 epochs. This model is trained to support dialect conditional generation by utilizing the first token (followed by a space) as an indicator of the desired dialect:
- P for Palestinian
- L for Lebanese
- S for Syrian
- E for Egyptian
Example usage
from transformers import pipeline
trans = pipeline("translation", "guymorlan/levanti_translate_en_ar")
trans("P I wanna go to the store tomorrow")
Out[1]: [{'translation_text': 'بدي أروح ع الدكان بكرا'}]
Attribution
Created by Guy Mor-Lan.
Contact: guy.mor AT mail.huji.ac.il