Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -218,6 +218,7 @@ with tab1:
|
|
| 218 |
|
| 219 |
# Keep only necessary columns
|
| 220 |
df = df[['content','Class']]
|
|
|
|
| 221 |
|
| 222 |
#show Classification Results
|
| 223 |
st.subheader("Classification Results")
|
|
@@ -255,7 +256,7 @@ with tab2:
|
|
| 255 |
st.markdown('<div class="card">', unsafe_allow_html=True)
|
| 256 |
st.header("Ask Questions Based on Uploaded News Content File")
|
| 257 |
st.write("Ask questions about news content and get answers from our AI model.")
|
| 258 |
-
|
| 259 |
#check file is uploaded
|
| 260 |
if uploaded_file is not None:
|
| 261 |
context = ' '.join(df['content'].tolist())
|
|
@@ -284,7 +285,7 @@ with tab2:
|
|
| 284 |
#generate the answer based on selected news content using the given model
|
| 285 |
st.markdown("---")
|
| 286 |
st.header("Ask Questions Based on Your News Content")
|
| 287 |
-
context_1 = st.selectbox("Choose an article for the question:",
|
| 288 |
|
| 289 |
question_1 = st.text_input("Enter your question:", key="question_input")
|
| 290 |
if st.button("Get Answer", key="get_answer_1"):
|
|
|
|
| 218 |
|
| 219 |
# Keep only necessary columns
|
| 220 |
df = df[['content','Class']]
|
| 221 |
+
df1=df[['content']]
|
| 222 |
|
| 223 |
#show Classification Results
|
| 224 |
st.subheader("Classification Results")
|
|
|
|
| 256 |
st.markdown('<div class="card">', unsafe_allow_html=True)
|
| 257 |
st.header("Ask Questions Based on Uploaded News Content File")
|
| 258 |
st.write("Ask questions about news content and get answers from our AI model.")
|
| 259 |
+
|
| 260 |
#check file is uploaded
|
| 261 |
if uploaded_file is not None:
|
| 262 |
context = ' '.join(df['content'].tolist())
|
|
|
|
| 285 |
#generate the answer based on selected news content using the given model
|
| 286 |
st.markdown("---")
|
| 287 |
st.header("Ask Questions Based on Your News Content")
|
| 288 |
+
context_1 = st.selectbox("Choose an article for the question:", df1['content'].tolist())
|
| 289 |
|
| 290 |
question_1 = st.text_input("Enter your question:", key="question_input")
|
| 291 |
if st.button("Get Answer", key="get_answer_1"):
|