faizhalas commited on
Commit
ac9c1fe
1 Parent(s): cf740ac

Update pages/2 Topic Modeling.py

Browse files
Files changed (1) hide show
  1. pages/2 Topic Modeling.py +3 -3
pages/2 Topic Modeling.py CHANGED
@@ -174,11 +174,11 @@ if uploaded_file is not None:
174
  coherence_lda = coherence_model_lda.get_coherence()
175
  vis = pyLDAvis.gensim_models.prepare(lda_model, corpus, id2word)
176
  py_lda_vis_html = pyLDAvis.prepared_data_to_html(vis)
177
- return py_lda_vis_html, coherence_lda
178
 
179
  with st.spinner('Performing computations. Please wait ...'):
180
  try:
181
- py_lda_vis_html, coherence_lda = pylda(extype)
182
  st.write('Coherence: ', (coherence_lda))
183
  st.components.v1.html(py_lda_vis_html, width=1500, height=800)
184
  st.markdown('Copyright (c) 2015, Ben Mabey. https://github.com/bmabey/pyLDAvis')
@@ -202,7 +202,7 @@ if uploaded_file is not None:
202
  )
203
  img_lda(vis)
204
 
205
- except ValueError:
206
  st.warning('🖱️ Please click Submit')
207
 
208
  with tab2:
 
174
  coherence_lda = coherence_model_lda.get_coherence()
175
  vis = pyLDAvis.gensim_models.prepare(lda_model, corpus, id2word)
176
  py_lda_vis_html = pyLDAvis.prepared_data_to_html(vis)
177
+ return py_lda_vis_html, coherence_lda, vis
178
 
179
  with st.spinner('Performing computations. Please wait ...'):
180
  try:
181
+ py_lda_vis_html, coherence_lda, vis = pylda(extype)
182
  st.write('Coherence: ', (coherence_lda))
183
  st.components.v1.html(py_lda_vis_html, width=1500, height=800)
184
  st.markdown('Copyright (c) 2015, Ben Mabey. https://github.com/bmabey/pyLDAvis')
 
202
  )
203
  img_lda(vis)
204
 
205
+ except NameError:
206
  st.warning('🖱️ Please click Submit')
207
 
208
  with tab2: