Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ st.subheader(":point_left: Use the menu on the left to select a NLP task (click
|
|
11 |
expander = st.sidebar.expander("About")
|
12 |
expander.write("This web app allows you to perform common Natural Language Processing tasks, select a task below to get started.")
|
13 |
|
14 |
-
st.sidebar.header("
|
15 |
option = st.sidebar.radio("", ["Extractive question answering", "Text summarization", "Text generation"])
|
16 |
|
17 |
@st.cache(show_spinner=False, allow_output_mutation=True)
|
@@ -33,7 +33,7 @@ def generation_model():
|
|
33 |
return generator
|
34 |
|
35 |
if option == "Extractive question answering":
|
36 |
-
st.markdown("<h2 style='text-align: center; color:grey;'>
|
37 |
st.markdown("<h3 style='text-align: left; color:#F63366; font-size:18px;'><b>What is extractive question answering about?<b></h3>", unsafe_allow_html=True)
|
38 |
st.write("Extractive Question Answering is a part of Natural Language Processing where textual context is provided for a model so that the model can refer to it and make predictions about where the answer to a question is inside the text.")
|
39 |
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"])
|
@@ -67,7 +67,7 @@ if option == "Extractive question answering":
|
|
67 |
st.text(answer)
|
68 |
|
69 |
elif option == "Text summarization":
|
70 |
-
st.markdown("<h2 style='text-align: center; color:grey;'>
|
71 |
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"])
|
72 |
if source == "I want to input some text":
|
73 |
with open("sample.txt", "r") as text_file:
|
@@ -95,7 +95,7 @@ elif option == "Text summarization":
|
|
95 |
st.text(summary[0]["summary_text"])
|
96 |
|
97 |
elif option == "Text generation":
|
98 |
-
st.markdown("<h2 style='text-align: center; color:grey;'>
|
99 |
text = st.text_input(label="Enter one line of text and let the NLP model generate the rest for you")
|
100 |
button = st.button("Generate text")
|
101 |
if button:
|
|
|
11 |
expander = st.sidebar.expander("About")
|
12 |
expander.write("This web app allows you to perform common Natural Language Processing tasks, select a task below to get started.")
|
13 |
|
14 |
+
st.sidebar.header("Select Task")
|
15 |
option = st.sidebar.radio("", ["Extractive question answering", "Text summarization", "Text generation"])
|
16 |
|
17 |
@st.cache(show_spinner=False, allow_output_mutation=True)
|
|
|
33 |
return generator
|
34 |
|
35 |
if option == "Extractive question answering":
|
36 |
+
st.markdown("<h2 style='text-align: center; color:grey;'>Extractive Question Answering</h2>", unsafe_allow_html=True)
|
37 |
st.markdown("<h3 style='text-align: left; color:#F63366; font-size:18px;'><b>What is extractive question answering about?<b></h3>", unsafe_allow_html=True)
|
38 |
st.write("Extractive Question Answering is a part of Natural Language Processing where textual context is provided for a model so that the model can refer to it and make predictions about where the answer to a question is inside the text.")
|
39 |
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"])
|
|
|
67 |
st.text(answer)
|
68 |
|
69 |
elif option == "Text summarization":
|
70 |
+
st.markdown("<h2 style='text-align: center; color:grey;'>Text Summarization</h2>", unsafe_allow_html=True)
|
71 |
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"])
|
72 |
if source == "I want to input some text":
|
73 |
with open("sample.txt", "r") as text_file:
|
|
|
95 |
st.text(summary[0]["summary_text"])
|
96 |
|
97 |
elif option == "Text generation":
|
98 |
+
st.markdown("<h2 style='text-align: center; color:grey;'>Text Generation</h2>", unsafe_allow_html=True)
|
99 |
text = st.text_input(label="Enter one line of text and let the NLP model generate the rest for you")
|
100 |
button = st.button("Generate text")
|
101 |
if button:
|