Update app.py
Browse files
app.py
CHANGED
@@ -39,20 +39,27 @@ with col1:
|
|
39 |
st.markdown("Input :clipboard:")
|
40 |
|
41 |
select_options = ['Choose option', 'Enter text input', 'Upload a file(csv/txt)']
|
42 |
-
sample_sentence = "Rabulasi wa <mask> u khou bvelela nga u lima."
|
43 |
-
|
|
|
44 |
option_selected = st.selectbox(f"Select an input option:", select_options, index=0)
|
45 |
-
|
|
|
46 |
if option_selected == 'Enter text input':
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
input_sentences = text_input.split("\n")
|
58 |
|
|
|
39 |
st.markdown("Input :clipboard:")
|
40 |
|
41 |
select_options = ['Choose option', 'Enter text input', 'Upload a file(csv/txt)']
|
42 |
+
sample_sentence = "tshivenda: Rabulasi wa <mask> u khou bvelela nga u lima."
|
43 |
+
language_options = ['Choose language', 'Zulu', 'Tshivenda', 'Sepedi', 'Tswana', 'Tsonga']
|
44 |
+
|
45 |
option_selected = st.selectbox(f"Select an input option:", select_options, index=0)
|
46 |
+
input_sentences = {}
|
47 |
+
|
48 |
if option_selected == 'Enter text input':
|
49 |
+
@st.experimental_fragment
|
50 |
+
def choose_language():
|
51 |
+
language = st.selectbox(f"Select language for sentence {i+1}:",
|
52 |
+
language_options, key=f'language_{i}', index=0)
|
53 |
+
|
54 |
+
|
55 |
+
input1, input2 = st.columns(2)
|
56 |
+
for i in range(5):
|
57 |
+
with input1:
|
58 |
+
choose_language()
|
59 |
+
with input2:
|
60 |
+
sentence = st.text_input(f"Enter sentence for {language} (with <mask>):", key=f'text_input_{i}')
|
61 |
+
if sentence:
|
62 |
+
input_sentences[f'{language.lower()}_{i+1}'] = (language.lower(), sentence)
|
63 |
|
64 |
input_sentences = text_input.split("\n")
|
65 |
|