How to use from the
Use from the
Transformers library
# 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="Helsinki-NLP/opus-mt-en-ar")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-en-ar")
model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-en-ar", device_map="auto")
Quick Links

eng-ara

  • source group: English

  • target group: Arabic

  • OPUS readme: eng-ara

  • model: transformer

  • source language(s): eng

  • target language(s): acm afb apc apc_Latn ara ara_Latn arq arq_Latn ary arz

  • model: transformer

  • pre-processing: normalization + SentencePiece (spm32k,spm32k)

  • a sentence initial language token is required in the form of >>id<< (id = valid target language ID)

  • download original weights: opus-2020-07-03.zip

  • test set translations: opus-2020-07-03.test.txt

  • test set scores: opus-2020-07-03.eval.txt

Benchmarks

testset BLEU chr-F
Tatoeba-test.eng.ara 14.0 0.437

System Info:

Downloads last month
28,636
Inference Providers NEW
Examples

Model tree for Helsinki-NLP/opus-mt-en-ar

Adapters
6 models
Finetunes
26 models
Quantizations
3 models

Spaces using Helsinki-NLP/opus-mt-en-ar 100