UnarineLeo commited on
Commit
0716ef3
1 Parent(s): 0f5eea3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -12
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
- text_input = st.text_area(
48
- "Enter sentences with <mask> token(one sentence per line):",
49
- value=st.session_state['text_input']
50
- )
51
-
52
- option = st.selectbox(
53
- "How would you like to be contacted?",
54
- ("Email", "Home phone", "Mobile phone"),
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