guymorlan/levanti
Preview • Updated • 102 • 8
How to use guymorlan/levanti_translate_ar_en 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_ar_en") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("guymorlan/levanti_translate_ar_en")
model = AutoModelForSeq2SeqLM.from_pretrained("guymorlan/levanti_translate_ar_en")Trained on the Levanti dataset by fine-tuning Helsinki-NLP/opus-mt-ar-en for 8 epochs. The model supports Palestinian, Jordanian, Syrian, Lebanese and Egyptian dialects.
from transformers import pipeline
trans = pipeline("translation", "guymorlan/levanti_translate_ar_en")
trans("بدي أروح ع الدكان بكرا")
Out[1]: [{'translation_text': 'I want to go to the store tomorrow'}]
Created by Guy Mor-Lan.
Contact: guy.mor AT mail.huji.ac.il