Questions tagged [pyldavis]

Python library for interactive topic model visualization. Port of the R LDAvis package.

pyLDAvis is designed to help users interpret the topics in a topic model that has been fit to a corpus of text data. The package extracts information from a fitted LDA topic model to inform an interactive web-based visualization.

The visualization is intended to be used within an IPython notebook but can also be saved to a stand-alone HTML file for easy sharing.

References: pyLDAvis- Wiki pyLDAvis- readthedocs PyPI

44 questions
25
votes
8 answers

No module named pyLDAvis

I can't import pyLDAvis. It is installed but for some reason, I can not import it. I tried conda update anaconda pip install --upgrade pip pip install --upgrade jupyter notebook pip install pyLDAvis Installing pyLDAvis returns the message…
Dohun
  • 477
  • 2
  • 7
  • 13
7
votes
2 answers

pyLDAvis visualization from gensim not displaying the result in google colab

import pyLDAvis.gensim # Visualize the topics pyLDAvis.enable_notebook() vis = pyLDAvis.gensim.prepare(lda_model, corpus, id2word) vis The above code displayed the visualization of LDA model in google colab but then after reopening the notebook it…
Ravi Prajapati
  • 71
  • 1
  • 1
  • 4
4
votes
1 answer

LDA visualisation in Jupyter notebook

When using the pyLDAvis package as follows, inside my jupyter notebook, pyLDAvis.enable_notebook() lda_tfidf = LatentDirichletAllocation(n_components=20, random_state=0) lda_tfidf.fit(dtm_tfidf) pyLDAvis.sklearn.prepare(lda_tf, dtm_tf,…
GooJ
  • 257
  • 3
  • 13
3
votes
1 answer

Recreating the pyLDAvis chart in Altair - filtered data with empty selection

I am trying to recreating the classic pyLDAvis visualization for topic modelling in Altair. I've hit a snag when it comes to filtering. In the pyLDAvis chart, an empty selection in the scatter chart shows the so-called "Default" topic in the right…
campo
  • 624
  • 5
  • 15
3
votes
1 answer

Export pyLDAvis graphs as pdf

I am doing LDA topic modeling in Python and the folloing is my code for visualization: import pyLDAvis.gensim pyLDAvis.enable_notebook() vis = pyLDAvis.gensim.prepare(lda_model, corpus, dictionary=lda_model.id2word) vis I am looking for a way to…
Samira Khorshidi
  • 963
  • 1
  • 9
  • 29
3
votes
1 answer

AttributeError: 'numpy.ndarray' object has no attribute 'getA1'

When using pyLDAvis.sklearn.prepare to visualize an LDA topic model, I encountered the following error message: >>> pyLDAvis.sklearn.prepare(lda_model, dtm, vectorizer) ... ---> 12 return dtm.sum(axis=1).getA1() ... AttributeError:…
Miles Erickson
  • 2,574
  • 2
  • 17
  • 18
2
votes
1 answer

Jupyter Notebook cannot import pyLDAvis.sklearn

I am using Jupyter Notebook to run python code. I already did the following: !pip install pyldavis I can successfully import pyLDAvis via the following codes: import pyLDAvis pyLDAvis.enable_notebook() However, I cannot import pyLDAvis.sklearn…
Bella
  • 47
  • 4
2
votes
1 answer

How to get list of words for each topic for a specific relevance metric value (lambda) in pyLDAvis?

I am using pyLDAvis along with gensim.models.LdaMulticore for topic modeling. I have totally 10 topics. When I visualize the results using pyLDAvis, there is a bar called lambda with this explanation: "Slide to adjust relevance metric". I am…
Sam G.
  • 53
  • 1
  • 7
2
votes
1 answer

LDA visualization [ import_optional_dependency() got an unexpected keyword argument 'errors' ]

i got a error message while visualizing LDA model import pyLDAvis import pyLDAvis.gensim_models pyLDAvis.enable_notebook() vis = pyLDAvis.gensim_models.prepare(ldamodel,corpus, dictionary) vis and it gives me error message "…
Jamie L
  • 21
  • 2
2
votes
1 answer

pyLDAvis .show function asks for missing .css file in Jupyter notebook

import pyLDAvis import pyLDAvis.gensim pyLDAvis.enable_notebook() LDAvis_prepared = pyLDAvis.gensim.prepare(lda_model, bow_corpus, dictionary) pyLDAvis.show(LDAvis_prepared) This is a very simple visualization however, when I ran the show command,…
zxcisnoias
  • 494
  • 3
  • 19
2
votes
3 answers

Permession denied error while installing pyldavis in conda env [Errorno 13]

I'm trying to install pyldavis in a conda env using the command conda install -c conda-forge pyldavis but I get the following errors: ERROR conda.core.link:_execute(700): An error occurred while installing package…
E. Aly
  • 321
  • 4
  • 16
1
vote
3 answers

Trying to visualize topics using pyldavis but it is giving drop error

I am trying to visualize topics using PyLDAVis but the following code is giving error. Not sure what the issue is. import pyLDAvis.gensim_models pyLDAvis.enable_notebook() vis = pyLDAvis.gensim_models.prepare(lda_model, corpus,…
Prince Modi
  • 425
  • 1
  • 4
  • 16
1
vote
2 answers

pyLDAvis error AttributeError: 'CountVectorizer' object has no attribute 'get_feature_names'

I am conducting topic modelling for a project of mine and struggled into visualizing the results. I think the proceeding is right. Specifically when I run this line vis = pyLDAvis.sklearn.prepare(bi_lda, bigram_vectorized, bivectorizer,…
1
vote
0 answers

How to correctly display pyLDAvis output inside for loop?

I'm analyzing the main topics in a group of sentences on pycharm. This sentences are already classified in 8 different categories, but i wish to be more specific: i want to detect the topics for the sentences in each category. I have a dataframe…
Perrupi
  • 79
  • 7
1
vote
0 answers

Topic Correlation Analysis for Cross-Domain Text Classification using Python [or R]

do you have any pointers on how to perform NLP topic correlation with Python. I have used pyLDAvis for a visual topic correlation but am unable to find a method to get the correlation in tabular format? Below is a reference link to the subject to…
1
2 3