Gensim mallet CalledProcessError: returned non-zero exit status

后端 未结 5 1562
忘掉有多难
忘掉有多难 2021-01-21 01:53

I\'m getting an error while trying to access gensims mallet in jupyter notebooks. I have the specified file \'mallet\' in the same folder as my notebook, but cant seem to acces

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-21 02:33

    I got the same problem. What I did was change the location of mallet folder to the c://new_mallet so it worked nicely

        import os
        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 = gensim.models.wrappers.LdaMallet(mallet_path, corpus=corpus, num_topics=10, id2word=id2word)
    

提交回复
热议问题