负值:使用主题一致性评估Gensim LDA

时间:2018-05-30 14:34:50

标签: python-3.x gensim evaluation topic-modeling

我目前正在尝试使用gensim topiccoherencemodel评估我的主题模型:

from gensim.models.coherencemodel import CoherenceModel
cm_u_mass = CoherenceModel(model = model1, corpus = corpus1, coherence = 'u_mass')
coherence_u_mass = cm_u_mass.get_coherence()

print('\nCoherence Score: ', coherence_u_mass)

输出只是负值。它是否正确?任何人都可以提供一个公式或u_mass如何工作的东西吗?

1 个答案:

答案 0 :(得分:1)

快速浏览original article,您会发现UMass相干性是根据概率的对数计算得出的,因此它是负数。

关于您要求的公式,可以找到公式4 in the same article

我了解到,随着UMass一致性的值接近0,主题一致性会变得更好。

希望这会有所帮助。