Spaces:
Running
Running
Update pages/2 Topic Modeling.py
Browse files- pages/2 Topic Modeling.py +14 -22
pages/2 Topic Modeling.py
CHANGED
@@ -370,35 +370,27 @@ if uploaded_file is not None:
|
|
370 |
tab1, tab2, tab3 = st.tabs(["π Generate visualization", "π Reference", "π Recommended Reading"])
|
371 |
with tab1:
|
372 |
try:
|
373 |
-
|
374 |
-
|
375 |
-
st.write("β³ Performing computations....")
|
376 |
topic_model, topic_time, topics, probs = bertopic_vis(extype)
|
377 |
-
st.write("β³ Visualizing topics....")
|
378 |
fig1 = Vis_Topics(extype)
|
379 |
-
st.write("β³ Visualizing documents....")
|
380 |
fig2 = Vis_Documents(extype)
|
381 |
-
st.write("β³ Visualizing hierarcy....")
|
382 |
fig3 = Vis_Hierarchy(extype)
|
383 |
-
st.write("β³ Visualizing similarity....")
|
384 |
fig4 = Vis_Heatmap(extype)
|
385 |
-
st.write("β³ Visualizing terms....")
|
386 |
fig5 = Vis_Barchart(extype)
|
387 |
-
st.write("β³ Visualizing topics over time....")
|
388 |
fig6 = Vis_ToT(extype)
|
389 |
-
|
390 |
-
|
391 |
-
st.
|
392 |
-
|
393 |
-
st.
|
394 |
-
|
395 |
-
st.
|
396 |
-
|
397 |
-
st.
|
398 |
-
|
399 |
-
st.
|
400 |
-
|
401 |
-
st.write(fig6)
|
402 |
|
403 |
except ValueError:
|
404 |
st.error('πββοΈ Please raise the number of topics and click submit')
|
|
|
370 |
tab1, tab2, tab3 = st.tabs(["π Generate visualization", "π Reference", "π Recommended Reading"])
|
371 |
with tab1:
|
372 |
try:
|
373 |
+
with st.spinner('Performing computations. Please wait ...'):
|
374 |
+
|
|
|
375 |
topic_model, topic_time, topics, probs = bertopic_vis(extype)
|
|
|
376 |
fig1 = Vis_Topics(extype)
|
|
|
377 |
fig2 = Vis_Documents(extype)
|
|
|
378 |
fig3 = Vis_Hierarchy(extype)
|
|
|
379 |
fig4 = Vis_Heatmap(extype)
|
|
|
380 |
fig5 = Vis_Barchart(extype)
|
|
|
381 |
fig6 = Vis_ToT(extype)
|
382 |
+
with st.expander("Visualize Topics"):
|
383 |
+
st.write(fig1)
|
384 |
+
with st.expander("Visualize Terms"):
|
385 |
+
st.write(fig5)
|
386 |
+
with st.expander("Visualize Documents"):
|
387 |
+
st.write(fig2)
|
388 |
+
with st.expander("Visualize Document Hierarchy"):
|
389 |
+
st.write(fig3)
|
390 |
+
with st.expander("Visualize Topic Similarity"):
|
391 |
+
st.write(fig4)
|
392 |
+
with st.expander("Visualize Topics over Time"):
|
393 |
+
st.write(fig6)
|
|
|
394 |
|
395 |
except ValueError:
|
396 |
st.error('πββοΈ Please raise the number of topics and click submit')
|