pytorch marian text2text-generation es pt transformers translation salesken opus-mt-es-en license:apache-2.0 autotrain_compatible
---
license: apache-2.0
language: 
- es
- pt
tags:
- translation
- salesken
- es
- pt
- opus-mt-es-en
---
opus-mt-es-en model finetuned on the Europarl parallel[Portuguese-English] corpus extracted from the proceedings of the European Parliament
source-language: Spanish, Portuguese

target-language: English


```python

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("salesken/translation-spanish-and-portuguese-to-english")
model = AutoModelForSeq2SeqLM.from_pretrained("salesken/translation-spanish-and-portuguese-to-english")
snippet = "Eu estou falando em Língua Portuguesa."
inputs = tokenizer.encode(
    snippet, return_tensors="pt",padding=True,max_length=512,truncation=True)
outputs = model.generate(
    inputs, max_length=128, num_beams=None, early_stopping=True)
translated = tokenizer.decode(outputs[0]).replace('<pad>',"").strip().lower()
print(translated)
# I am speaking in Portuguese language
```