首页 > 解决方案 > Python 中的 LDA,我从 GitHub 获得了代码,但出现了一些错误,您可以在所附屏幕截图中看到错误

问题描述

这是我的代码

import pyLDAvis
import pyLDAvis.gensim_models
import importlib
pyLDAvis.enable_notebook()
vis = pyLDAvis.gensim_models.prepare(lda_model, doc_term_matrix, dictionary)
vis

我收到了这个错误

  /usr/local/lib/python3.7/dist-packages/joblib/externals/loky/process_executor.py in submit(self, fn, *args, **kwargs)
   1100         with self._flags.shutdown_lock:
   1101             if self._flags.broken is not None:
-> 1102                 raise self._flags.broken
   1103             if self._flags.shutdown:
   1104                 raise ShutdownExecutorError(

BrokenProcessPool: A task has failed to un-serialize. Please ensure that the arguments of the function are all picklable.

您还可以看到错误的屏幕截图

错误截图

标签: pythonnlpmodelinglda

解决方案


推荐阅读