📌  相关文章
📜  mallet 使用 - 不管代码示例返回非零退出状态 1

📅  最后修改于: 2022-03-11 15:00:43.899000             🧑  作者: Mango

代码示例1
can you create a new folder ('new_mallet') in c:/ drive and unzip the mallet there and try to re-run the code below again
----------------------------------Run this code---------------------------------------
import os
from gensim.models.wrappers import LdaMallet

os.environ.update({'MALLET_HOME':r'C:/new_mallet/mallet-2.0.8/'})
mallet_path = 'C:/new_mallet/mallet-2.0.8/bin/mallet' # update this path

ldamallet = LdaMallet(mallet_path, corpus=corpus, num_topics=20, id2word=id2word)

result=(ldamallet.show_topics(num_topics=20,num_words=5,formatted=False))
for each in result:
print(each)