当我运行LDA时,如何解决“结果未能取消序列化。请确保函数返回的对象始终可拾取”的问题

2024-04-27 03:04:19 发布

您现在位置:Python中文网/ 问答频道 /正文

当我使用pyLDAvis.gensimfunction在google colab构建可视化时,它显示了以下错误:

a result has failed to un-serialize. please ensure that the objects returned by the function are always picklable.

我的代码是:

!pip install pyldavis
import pyLDAvis
import pyLDAvis.gensim_models as pg
pyLDAvis.enable_notebook()

vis = pg.prepare(lda, corpus, dictionary, sort_topics=False) # construct visualization

enter image description here


Tags: thetoimport可视化错误googleresultserialize