Skip to content

Instantly share code, notes, and snippets.

@wandabwa2004
Created January 17, 2020 11:51
Show Gist options
  • Save wandabwa2004/8231792d944dec36a3c92f0d8ab3399b to your computer and use it in GitHub Desktop.
Save wandabwa2004/8231792d944dec36a3c92f0d8ab3399b to your computer and use it in GitHub Desktop.
import pyLDAvis
import pyLDAvis.gensim
pyLDAvis.enable_notebook()
visualization_q1 = pyLDAvis.gensim.prepare(lda_model_bigrams_q1, bi_corpus_q1, dictionary_bi_q1, mds='mmds') #prepares the model, related corpus and dictionary.
visualization_q1 #Visualizes the plot
#To save the visualization
pyLDAvis.save_html(visualization_q1, 'lda_q1.html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment