demo1 / app.py
phunlh2001's picture
translation with pretrained model
75b4131 verified
raw
history blame
426 Bytes
import streamlit as st
from transformers import pipeline
translator = pipeline("translation_vi_to_en", model="Helsinki-NLP/opus-mt-vi-en")
st.title("Demo translation with pretrained model")
input_text = st.text_area("Nhập văn bản tiếng Việt:", "")
if input_text:
translated_text = translator(input_text)
st.write("Translation Vietnamese to English:")
st.write(translated_text[0]["translation_text"])