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, an error popped up:
FileNotFoundError Traceback (most recent call last)
<ipython-input-152-64a947f66dc2> in <module>
----> 1 pyLDAvis.show(LDAvis_prepared)
/opt/anaconda3/lib/python3.7/site-packages/pyLDAvis/_display.py in show(data, ip, port, n_retries, local, open_browser, http_server, **kwargs)
262 open(urls.LDAVIS_LOCAL, 'r').read()],
263 '/LDAvis.css': ["text/css",
--> 264 open(urls.LDAVIS_CSS_URL, 'r').read()],
265 '/d3.js': ["text/javascript",
266 open(urls.D3_URL, 'r').read()]}
FileNotFoundError: [Errno 2] No such file or directory: 'https://cdn.rawgit.com/bmabey/pyLDAvis/files/ldavis.v1.0.0.css'
I searched online unfortunately, not much information on this error. However if I clicked on the .ccs link, I could still view this css file.
I even saved the display as a HTML file but it's a blank page (content is not rendered for some reasons)
pyLDAvis.save_html(LDAvis_prepared,'sss.html')
Try to specify the version of pyLDAvis to 2.1.2
and use pyLDAvis.display() instead of pyLDAvis.show()
This solved the same problem on my machine.