Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,8 @@ st.set_page_config(page_title="Automated Question Answering System") # set pa
|
|
17 |
st.markdown("<h2 style='text-align: center;'>Question Answering on Academic Essays</h2>", unsafe_allow_html=True)
|
18 |
# description
|
19 |
st.markdown("<h3 style='text-align: left; color:#F63366; font-size:18px;'><b>What is this project about?<b></h3>", unsafe_allow_html=True)
|
20 |
-
st.write("
|
21 |
-
st.write("Click 'Input Text' or 'Upload File' to start experience the system. ")
|
22 |
|
23 |
# store the model in cache resources to enhance efficiency (ref: https://docs.streamlit.io/library/advanced-features/caching)
|
24 |
@st.cache_resource(show_spinner=True)
|
@@ -82,15 +82,6 @@ with tab1:
|
|
82 |
context = st.session_state.get("contextInput", "")
|
83 |
question = st.session_state.get("questionInput", "")
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
# Display the text area and text input with the updated or default values
|
88 |
-
context = st.text_area("Enter the essay below:", value=context, key="contextInput", height=330)
|
89 |
-
question = st.text_input(label="Enter the question: ", value=question, key="questionInput")
|
90 |
-
|
91 |
-
# perform question answering when "get answer" button clicked
|
92 |
-
button = st.button("Get answer", key="textInput")
|
93 |
-
|
94 |
# Button to try the example
|
95 |
example = st.button("Try with example")
|
96 |
|
@@ -98,7 +89,13 @@ with tab1:
|
|
98 |
if example:
|
99 |
context = sample_text
|
100 |
question = sample_question
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
if button:
|
103 |
if context=="" or question=="":
|
104 |
st.error ("Please enter BOTH the context and the question", icon="🚨")
|
@@ -148,6 +145,7 @@ with tab2:
|
|
148 |
else:
|
149 |
question_answering(context2, question2)
|
150 |
|
|
|
151 |
st.markdown("<br><br><br><br><br>", unsafe_allow_html=True)
|
152 |
|
153 |
|
|
|
17 |
st.markdown("<h2 style='text-align: center;'>Question Answering on Academic Essays</h2>", unsafe_allow_html=True)
|
18 |
# description
|
19 |
st.markdown("<h3 style='text-align: left; color:#F63366; font-size:18px;'><b>What is this project about?<b></h3>", unsafe_allow_html=True)
|
20 |
+
st.write("This project is to develop a web-based automated question-and-answer system for academic essays using natural language processing (NLP). Users can enter the essay and ask questions about it, and the system will automatically create answers.")
|
21 |
+
st.write("👐 Click 'Input Text' or 'Upload File' to start experience the system. ")
|
22 |
|
23 |
# store the model in cache resources to enhance efficiency (ref: https://docs.streamlit.io/library/advanced-features/caching)
|
24 |
@st.cache_resource(show_spinner=True)
|
|
|
82 |
context = st.session_state.get("contextInput", "")
|
83 |
question = st.session_state.get("questionInput", "")
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
# Button to try the example
|
86 |
example = st.button("Try with example")
|
87 |
|
|
|
89 |
if example:
|
90 |
context = sample_text
|
91 |
question = sample_question
|
92 |
+
|
93 |
+
# Display the text area and text input with the updated or default values
|
94 |
+
context = st.text_area("Enter the essay below:", value=context, key="contextInput", height=330)
|
95 |
+
question = st.text_input(label="Enter the question: ", value=question, key="questionInput")
|
96 |
+
|
97 |
+
# perform question answering when "get answer" button clicked
|
98 |
+
button = st.button("Get answer", key="textInput")
|
99 |
if button:
|
100 |
if context=="" or question=="":
|
101 |
st.error ("Please enter BOTH the context and the question", icon="🚨")
|
|
|
145 |
else:
|
146 |
question_answering(context2, question2)
|
147 |
|
148 |
+
st.markdown("<br>© 20069913D HUI Man Ki - Final Year Project")
|
149 |
st.markdown("<br><br><br><br><br>", unsafe_allow_html=True)
|
150 |
|
151 |
|