Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
!pip install sentencepiece
|
4 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-tr")
|
5 |
+
|
6 |
+
def main():
|
7 |
+
st.title("English to Turkish Translator")
|
8 |
+
input_text = st.text_input("Enter text in English:")
|
9 |
+
if input_text:
|
10 |
+
translation = pipe(input_text)[0]["translation_text"]
|
11 |
+
st.write("Translation:")
|
12 |
+
st.write(translation)
|
13 |
+
|
14 |
+
if __name__ == "__main__":
|
15 |
+
main()
|