Spaces:
Running
Running
Update pages/2 Topic Modeling.py
Browse files- pages/2 Topic Modeling.py +10 -10
pages/2 Topic Modeling.py
CHANGED
@@ -340,7 +340,7 @@ if uploaded_file is not None:
|
|
340 |
with st.spinner('Performing computations. Please wait ...'):
|
341 |
fig1 = Vis_Topics(extype)
|
342 |
st.write(fig1)
|
343 |
-
img_bert(fig1)
|
344 |
with open(my_saved_image, "rb") as file:
|
345 |
btn = st.download_button(
|
346 |
label="Download image",
|
@@ -353,7 +353,7 @@ if uploaded_file is not None:
|
|
353 |
with st.spinner('Performing computations. Please wait ...'):
|
354 |
fig2 = Vis_Documents(extype)
|
355 |
st.write(fig2)
|
356 |
-
img_bert(fig2)
|
357 |
with open(my_saved_image, "rb") as file:
|
358 |
btn = st.download_button(
|
359 |
label="Download image",
|
@@ -366,7 +366,7 @@ if uploaded_file is not None:
|
|
366 |
with st.spinner('Performing computations. Please wait ...'):
|
367 |
fig3 = Vis_Hierarchy(extype)
|
368 |
st.write(fig3)
|
369 |
-
img_bert(fig3)
|
370 |
with open(my_saved_image, "rb") as file:
|
371 |
btn = st.download_button(
|
372 |
label="Download image",
|
@@ -379,7 +379,7 @@ if uploaded_file is not None:
|
|
379 |
with st.spinner('Performing computations. Please wait ...'):
|
380 |
fig4 = Vis_Heatmap(extype)
|
381 |
st.write(fig4)
|
382 |
-
img_bert(fig4)
|
383 |
with open(my_saved_image, "rb") as file:
|
384 |
btn = st.download_button(
|
385 |
label="Download image",
|
@@ -392,7 +392,7 @@ if uploaded_file is not None:
|
|
392 |
with st.spinner('Performing computations. Please wait ...'):
|
393 |
fig5 = Vis_Barchart(extype)
|
394 |
st.write(fig5)
|
395 |
-
img_bert(fig5)
|
396 |
with open(my_saved_image, "rb") as file:
|
397 |
btn = st.download_button(
|
398 |
label="Download image",
|
@@ -405,7 +405,7 @@ if uploaded_file is not None:
|
|
405 |
with st.spinner('Performing computations. Please wait ...'):
|
406 |
fig6 = Vis_ToT(extype)
|
407 |
st.write(fig6)
|
408 |
-
img_bert(fig6)
|
409 |
with open(my_saved_image, "rb") as file:
|
410 |
btn = st.download_button(
|
411 |
label="Download image",
|
@@ -414,11 +414,11 @@ if uploaded_file is not None:
|
|
414 |
mime="image/png"
|
415 |
)
|
416 |
|
417 |
-
|
418 |
-
|
419 |
|
420 |
-
except NameError:
|
421 |
-
st.warning('🖱️ Please click Submit')
|
422 |
|
423 |
with tab2:
|
424 |
st.markdown('**Grootendorst, M. (2022). BERTopic: Neural topic modeling with a class-based TF-IDF procedure. arXiv preprint arXiv:2203.05794.** https://doi.org/10.48550/arXiv.2203.05794')
|
|
|
340 |
with st.spinner('Performing computations. Please wait ...'):
|
341 |
fig1 = Vis_Topics(extype)
|
342 |
st.write(fig1)
|
343 |
+
my_saved_image = img_bert(fig1)
|
344 |
with open(my_saved_image, "rb") as file:
|
345 |
btn = st.download_button(
|
346 |
label="Download image",
|
|
|
353 |
with st.spinner('Performing computations. Please wait ...'):
|
354 |
fig2 = Vis_Documents(extype)
|
355 |
st.write(fig2)
|
356 |
+
my_saved_image = img_bert(fig2)
|
357 |
with open(my_saved_image, "rb") as file:
|
358 |
btn = st.download_button(
|
359 |
label="Download image",
|
|
|
366 |
with st.spinner('Performing computations. Please wait ...'):
|
367 |
fig3 = Vis_Hierarchy(extype)
|
368 |
st.write(fig3)
|
369 |
+
my_saved_image = img_bert(fig3)
|
370 |
with open(my_saved_image, "rb") as file:
|
371 |
btn = st.download_button(
|
372 |
label="Download image",
|
|
|
379 |
with st.spinner('Performing computations. Please wait ...'):
|
380 |
fig4 = Vis_Heatmap(extype)
|
381 |
st.write(fig4)
|
382 |
+
my_saved_image = img_bert(fig4)
|
383 |
with open(my_saved_image, "rb") as file:
|
384 |
btn = st.download_button(
|
385 |
label="Download image",
|
|
|
392 |
with st.spinner('Performing computations. Please wait ...'):
|
393 |
fig5 = Vis_Barchart(extype)
|
394 |
st.write(fig5)
|
395 |
+
my_saved_image = img_bert(fig5)
|
396 |
with open(my_saved_image, "rb") as file:
|
397 |
btn = st.download_button(
|
398 |
label="Download image",
|
|
|
405 |
with st.spinner('Performing computations. Please wait ...'):
|
406 |
fig6 = Vis_ToT(extype)
|
407 |
st.write(fig6)
|
408 |
+
my_saved_image = img_bert(fig6)
|
409 |
with open(my_saved_image, "rb") as file:
|
410 |
btn = st.download_button(
|
411 |
label="Download image",
|
|
|
414 |
mime="image/png"
|
415 |
)
|
416 |
|
417 |
+
except ValueError:
|
418 |
+
st.error('🙇♂️ Please raise the number of topics and click submit')
|
419 |
|
420 |
+
#except NameError:
|
421 |
+
#st.warning('🖱️ Please click Submit')
|
422 |
|
423 |
with tab2:
|
424 |
st.markdown('**Grootendorst, M. (2022). BERTopic: Neural topic modeling with a class-based TF-IDF procedure. arXiv preprint arXiv:2203.05794.** https://doi.org/10.48550/arXiv.2203.05794')
|