Gensim包中的一致性得分错误

2024-05-02 23:41:09 发布

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

当我试图从Gensim包中获得主题建模的一致性分数时,我得到了这个错误。错误似乎与语法无关:

    coherence_lda_gens = CoherenceModel(model=lda_gens, 
    texts=data_lemmatized, dictionary=dict_lemm, coherence='c_v')
    coherence = coherence_lda_gens.get_coherence()  #this line fails*emphasized text*
    print('\nCoherence Score: ',coherence)

我得到一个错误:

 File "C:\Users\msharifpour\AppData\Local\Continuum\anaconda3\lib\multiprocessing\spawn.py", line 172, in get_preparation_data
    main_mod_name = getattr(main_module.__spec__, "name", None)

AttributeError: module '__main__' has no attribute '__spec__'

我在google上搜索了很多问题,但是找不到问题的来源和解决方法?你知道吗

谢谢


Tags: name主题datagetmain错误line建模