DebasishDhal99
commited on
Commit
•
04c2e43
1
Parent(s):
6cfbfef
Adding turkish tab
Browse files
app.py
CHANGED
@@ -33,10 +33,12 @@
|
|
33 |
import streamlit as st
|
34 |
from polish import polish_sentence_to_latin
|
35 |
from hungarian import hungarian_sentence_to_latin
|
|
|
|
|
36 |
import re
|
37 |
from nltk.tokenize import word_tokenize
|
38 |
|
39 |
-
tab1, tab2= st.tabs(["Polish", "Hungarian"])
|
40 |
|
41 |
with tab1:
|
42 |
st.header("Polish Transliteration")
|
@@ -72,4 +74,22 @@ with tab2:
|
|
72 |
else:
|
73 |
st.warning("Please enter a string.")
|
74 |
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
import streamlit as st
|
34 |
from polish import polish_sentence_to_latin
|
35 |
from hungarian import hungarian_sentence_to_latin
|
36 |
+
from turkish import turkish_sentence_to_latin
|
37 |
+
|
38 |
import re
|
39 |
from nltk.tokenize import word_tokenize
|
40 |
|
41 |
+
tab1, tab2, tab3= st.tabs(["Polish/Polski", "Hungarian/Magyar", "Turkish/Türkçe"])
|
42 |
|
43 |
with tab1:
|
44 |
st.header("Polish Transliteration")
|
|
|
74 |
else:
|
75 |
st.warning("Please enter a string.")
|
76 |
|
77 |
+
with tab3:
|
78 |
+
|
79 |
+
st.header("Turkish Transliteration")
|
80 |
+
input_string_turkish = st.text_input("Enter a Turkish word/sentence to transliterate:")
|
81 |
+
turkish_examples = ["Müzik, ruhumuzu besler ve duygularımızı ifade etmemize yardımcı olur.", "İhtiyaçlarınıza uygun özel bir çözüm sunabiliriz",
|
82 |
+
"Türkiye'nin güzel şehirlerinden biri olan İstanbul'u ziyaret etmek istiyorum."]
|
83 |
+
selected_example_tu = st.selectbox('Choose an example as demo', ['None'] + turkish_examples)
|
84 |
+
|
85 |
+
if selected_example_tu != 'None':
|
86 |
+
input_string_turkish = selected_example_tu
|
87 |
+
|
88 |
+
if st.button("Transliterate Turkish"):
|
89 |
+
if input_string_turkish:
|
90 |
+
output_string = turkish_sentence_to_latin(input_string_turkish)
|
91 |
+
st.subheader("Transliterated Output:")
|
92 |
+
st.write(output_string)
|
93 |
+
else:
|
94 |
+
st.warning("Please enter a string.")
|
95 |
+
|