下载由 LDAvis 库生成的图像

Downloading the image produced by LDAvis library

我正在使用主题可视化库 LDAvis:

## visualization of the topics
import pyLDAvis
import pyLDAvis.gensim
pyLDAvis.enable_notebook()
pyLDAvis.gensim.prepare(ldamodel, corpus, dictionary)

生成 LDA(潜在狄利克雷分配)模型揭示的主题的主成分图像。我想下载图像,但我被卡住了。非常感谢任何帮助!

您可以在 Python 中像这样保存 HTML 文件:

vis_data = pyLDAvis.gensim.prepare(lda, corpus, dictionary)
pyLDAvis.save_html(vis_data, 'output_filename.html')

或者您可以使用 SVG Crowbar 从已加载的页面下载 SVG 节点。