File size: 418 Bytes
a02892b
 
 
f6f0134
 
a02892b
f6f0134
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import streamlit as st
from transformers import pipeline

# Load translation model
translator = pipeline('translation_en_to_uk', model='Helsinki-NLP/opus-mt-en-uk')

# Streamlit UI
st.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)