Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -149,6 +149,9 @@ with tab1:
|
|
| 149 |
mime='text/csv'
|
| 150 |
)
|
| 151 |
|
|
|
|
|
|
|
|
|
|
| 152 |
|
| 153 |
with tab2:
|
| 154 |
st.header("Question Answering Pipeline")
|
|
@@ -156,10 +159,9 @@ with tab2:
|
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
-
if
|
| 160 |
-
qa_df =
|
| 161 |
-
|
| 162 |
-
context = ' '.join(qa_df['predicted_category'].tolist())
|
| 163 |
st.write(f"Loaded {len(qa_df)} news excerpts")
|
| 164 |
|
| 165 |
else:
|
|
|
|
| 149 |
mime='text/csv'
|
| 150 |
)
|
| 151 |
|
| 152 |
+
# Store classification results for Q&A pipeline
|
| 153 |
+
st.session_state['qa_df'] = df
|
| 154 |
+
|
| 155 |
|
| 156 |
with tab2:
|
| 157 |
st.header("Question Answering Pipeline")
|
|
|
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
+
if 'qa_df' in st.session_state:
|
| 163 |
+
qa_df = st.session_state['qa_df']
|
| 164 |
+
context = ' '.join(qa_df['content'].tolist()) # Use predictions for Q&A
|
|
|
|
| 165 |
st.write(f"Loaded {len(qa_df)} news excerpts")
|
| 166 |
|
| 167 |
else:
|