Downloads · 30 days
164
1% of all-time downloads
marefa-nlp/marefa-mt-en-ar
marefa-mt-en-ar is a translation model from marefa-nlp. 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 is a model for translating English to Arabic. The special about this model that is take into considration the using of additional Arabic characters like پ or گ.
Downloads · 30 days
164
1% of all-time downloads
All-time downloads
26.2K
Public
Repo size
611 MB
Likes
16
Public
Click a slice to open those files.
.bin306 MB · 99%
From the Hugging Face model README
This is a model for translating English to Arabic. The special about this model that is take into considration the
using of additional Arabic characters like پ or گ.
هذا النموذج للترجمة الآلية من اللغة الإنجليزية إلى اللغة العربية, هو أول نماذج الترجمة الآلية التي تصدر تحت رعاية موسوعة المعرفة
يتميز هذا النموذج عن غيره من النماذج بدعمه لحروف الأبجدية العربية الإضافية لتمييز الصوتيات الخاصة في اللغة الإنجليزية مثل پ , گ.
يمكنك زيارة هذه الصفحة لمعرفة أكثر عن أسلوب إستخدام هذه الحروف الأبجدية العربية
Install transformers and sentencepiece (python >= 3.6)
$ pip3 install transformers==4.3.0 sentencepiece==0.1.95 nltk==3.5 protobuf==3.15.3 torch==1.7.1
If you are using
Google Colab, please restart your runtime after installing the packages.
from transformers import MarianTokenizer, MarianMTModel
mname = "marefa-nlp/marefa-mt-en-ar"
tokenizer = MarianTokenizer.from_pretrained(mname)
model = MarianMTModel.from_pretrained(mname)
# English Sample Text
input = "President Putin went to the presidential palace in the capital, Kiev"
translated_tokens = model.generate(**tokenizer.prepare_seq2seq_batch([input], return_tensors="pt"))
translated_text = [tokenizer.decode(t, skip_special_tokens=True) for t in translated_tokens]
# translated Arabic Text
print(translated_text)
# ذهب الرئيس پوتن إلى القصر الرئاسي في العاصمة كييڤ