Update app.py
Browse filesTransfered to translation En-Ua
123456789import streamlit as stfrom transformers import pipelinepipe = pipeline('sentiment-analysis')text = st.text_area('Enter some text!')if text:out = pipe(text)st.json(out)1234567891011121314import streamlit as stfrom transformers import pipeline# Load translation modeltranslator = pipeline('translation_en_to_uk', model='Helsinki-NLP/opus-mt-en-uk')# Streamlit UIst.title("English to Ukrainian Translator")text = st.text_area("Enter English text:")if text:translated_text = translator(text, max_length=100)[0]['translation_text']st.subheader("Translation:")st.write(translated_text)
app.py+10-5