OOlajide commited on
Commit
960d6c2
·
1 Parent(s): 4cd35d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -35,10 +35,11 @@ def sentiment_model():
35
 
36
  if option == 'Extractive question answering':
37
  st.markdown("<h2 style='text-align: center; color:red;'>Extract answer from text</h2>", unsafe_allow_html=True)
38
- with open(sample.txt, "r") as text_file:
39
- sample_text = text_file.read()
40
- source = st.radio("How would you like to start? Choose an option below", ["I want to input some text", "I want to upload a file"])
41
  if source == "I want to input some text":
 
 
 
42
  context = st.text_area('Use the example below or input your own text in English (10,000 characters max)', value=sample_text, max_chars=10000, height=330)
43
  question = st.text_input(label='Enter your question')
44
  button = st.button('Get answer')
 
35
 
36
  if option == 'Extractive question answering':
37
  st.markdown("<h2 style='text-align: center; color:red;'>Extract answer from text</h2>", unsafe_allow_html=True)
38
+ source = st.radio("How would you like to start? Choose an option below", ["I want to input some text", "I want to upload a file"])
 
 
39
  if source == "I want to input some text":
40
+ sample_text = ""
41
+ with open(sample.txt, "r") as text_file:
42
+ sample_text = text_file.read()
43
  context = st.text_area('Use the example below or input your own text in English (10,000 characters max)', value=sample_text, max_chars=10000, height=330)
44
  question = st.text_input(label='Enter your question')
45
  button = st.button('Get answer')