faizhalas commited on
Commit
8964654
β€’
1 Parent(s): 9cd77c7

Update pages/2 Topic Modeling.py

Browse files
Files changed (1) hide show
  1. 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
- #with st.spinner('Performing computations. Please wait ...'):
374
- with st.status('Progress', expanded=True) as status:
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
- status.update(label="Completed", expanded=False)
390
- with st.expander("Visualize Topics"):
391
- st.write(fig1)
392
- with st.expander("Visualize Terms"):
393
- st.write(fig5)
394
- with st.expander("Visualize Documents"):
395
- st.write(fig2)
396
- with st.expander("Visualize Document Hierarchy"):
397
- st.write(fig3)
398
- with st.expander("Visualize Topic Similarity"):
399
- st.write(fig4)
400
- with st.expander("Visualize Topics over Time"):
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')