visualization - 来自gensim的pyLDAvis可视化未在google colab中显示结果

标签 visualization gensim lda pyldavis

import pyLDAvis.gensim
# Visualize the topics
pyLDAvis.enable_notebook()
vis = pyLDAvis.gensim.prepare(lda_model, corpus, id2word)
vis
上面的代码在 google colab 中显示了 LDA 模型的可视化,但在重新打开笔记本后它停止显示。
我什至试过pyLDAvis.display(vis, template_type='notebook')还是行不通
当我设置pyLDAvis.enable_notebook(local=True) enter image description here
它确实显示结果但不显示标签.. 任何帮助将不胜感激!

最佳答案

安装 LDAvis 时,请确保将版本指定为 2.1.2:

!pip install pyLDAvis==2.1.2
新版本似乎不太适合 colab。

关于visualization - 来自gensim的pyLDAvis可视化未在google colab中显示结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66096149/

相关文章:

javascript - 气泡图标签放置算法? (最好在 JavaScript 中)

python-3.x - Altair 为交互式散点图 jar 添加日期 slider

python - Python 中的“display_formatter”属性错误

python - 构造 ClassDict 的预期参数为零(对于 pyspark.ml.linalg.SparseVector)

java - 有哪些好的用户数据统计可视化框架/库?

python - gensim 中的 get_document_topics 和 get_term_topics

python - 使用 gensim 加载经过训练的 fasttext 模型时出现问题

python - 如何使用 gensim 从语料库中提取短语

python - 了解 Gensim LDA 模型中的参数

visualization - 用于可视化成对的人之间的相似性/相异性的软件解决方案