0
gensim 패키지를 사용하여 문서 모음을 기반으로 모델을 만드는 주제 모델링 스크립트를 작성하고 있습니다. pyLDAvis 패키지를 사용하여 모델을 시각화하기 위해 준비 할 때Python에서 'display_formatter'속성 오류가 발생했습니다.
, 나는이 오류로 실행 :
import pyLDAvis
pyLDAvis.enable_notebook()
Traceback (most recent call last):
File "/dev2.py", line 2, in <module>
pyLDAvis.enable_notebook()
File "/Users/username/Library/Python/3.6/lib/python/site-packages/pyLDAvis/_display.py", line 311, in enable_notebook
formatter = ip.display_formatter.formatters['text/html']
AttributeError: 'NoneType' object has no attribute 'display_formatter'
감사합니다. 이 말이 맞습니다. 단순히'visualization = pyLDAvis.gensim.prepare (lda_model, corpus, dictionary)'를 실행 한 다음'pyLDAvis.save_html (시각화, 'LDA_Visualization.html')'이 작동합니다! – textnet