Views
No views yet
en) → Egyptian Arabic (ar)1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3tokenizer = AutoTokenizer.from_pretrained("Omar-youssef/english-egyptian-arabic-translation-v1")
4model = AutoModelForSeq2SeqLM.from_pretrained("Omar-youssef/english-egyptian-arabic-translation-v1")
5
6def translate(text):
7 inputs = tokenizer.encode(text, return_tensors="pt")
8 outputs = model.generate(inputs, num_beams=4, early_stopping=True)
9 return tokenizer.decode(outputs[0], skip_special_tokens=True)
10
11print(translate("A novel is a long prose narrative that usually describes fictional characters and events in the form of a sequential story."))
12# Output: الرواية هي رواية نثرية طويلة عادةً بتصف شخصيات وأحداث خيالية في شكل قصة متتابعة.
13
14print(translate("The rapid advancement of artificial intelligence is transforming many industries, creating new opportunities while also raising important ethical and social concerns."))
15# Output: التقدم السريع للـ Artificial Intelligence بيغير صناعات كتير، وبيخلق فرص جديدة وفي نفس الوقت بيثير اهتمامات أخلاقية واجتماعية مهمة.Egyptian Arabic onlyseed=42)| Metric | Description | Range | Better When |
|---|---|---|---|
| BLEU | N-gram overlap between predictions and references | 0 → 1 | Higher ↑ |
| Metric | Score |
|---|---|
| BLEU | 0.6985 |
BLEU of 0.6985 (69.85%) indicates high-quality translations with strong overlap against Egyptian Arabic references.
1@misc{omar-youssef-egyptian-translation,
2 author = {Omar Youssef},
3 title = {English to Egyptian Arabic Translation Model},
4 year = {2026},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/Omar-youssef/english-egyptian-arabic-translation-v1}
7}