Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,12 +34,11 @@ def sentiment_model():
|
|
34 |
return sentiment_analysis
|
35 |
|
36 |
if option == 'Extractive question answering':
|
37 |
-
sample_text = ""
|
38 |
-
with open(sample.txt, "r") as text_file:
|
39 |
-
sample_text = text_file.read()
|
40 |
st.markdown("<h2 style='text-align: center; color:red;'>Extract answer from text</h2>", unsafe_allow_html=True)
|
41 |
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"])
|
42 |
if source == "I want to input some text":
|
|
|
|
|
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')
|
|
|
34 |
return sentiment_analysis
|
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 |
+
with open("sample.txt", "r") as text_file:
|
41 |
+
sample_text = text_file.read()
|
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')
|