File size: 358 Bytes
1b9fb34
e58f8c6
7de0515
1b9fb34
7de0515
 
 
 
1b9fb34
7de0515
 
1b9fb34
 
7de0515
 
1b9fb34
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st
import transformers
from transformers import pipeline

translator = pipeline(
    "translation", 
    model="Helsinki-NLP/opus-mt-fr-en", 
)

title = st.title("Tradutor FR to EN")
txt = st.text_area("Setença para traduzir:",)

if st.button("Traduzir"):
    translation = translator(txt)
    print(translation[0]['translation_text'])