【问题标题】:Why it is so slow when calculating the coherence score for LDA using gensim为什么使用 gensim 计算 LDA 的相干分数时速度如此之慢
【发布时间】:2019-06-22 03:33:15
【问题描述】:

我是 LDA 的新手,当我使用 gensim CoherenceModel 计算我的 LDA 模型的相干性分数时,运行需要很长时间。但是,训练部分相对较快,而且在合理的时间内。我想知道这是否是因为我的数据大小(大约 250000 长文本),有什么方法可以加快这个过程吗?谢谢

这是我的代码,和教程一模一样

from gensim.models import CoherenceModel
coherence_model_lda = CoherenceModel(model=lda_model_tfidf, texts=LDA_, dictionary=dictionary, coherence='c_v')
coherence_lda = coherence_model_lda.get_coherence()
print('\nCoherence Score: ', coherence_lda)

【问题讨论】:

  • 嗨,欢迎来到堆栈溢出。显示您的问题的最小(代码)示例。

标签: nlp gensim lda


【解决方案1】:

'c_v' 一致性度量已知是最慢的方法,但可以得到最好的结果。您可以尝试'u_mass' 以获得最快的性能。

请注意,您只需要 'u_mass' 的模型、语料库和连贯性参数。

您可以在此处阅读有关这两种方法之间区别的更多信息:http://palmetto.aksw.org/palmetto-webapp/

【讨论】:

  • 感谢回答,我也想知道在可解释性和a模型的分数之间如何选择,我应该先考虑哪个?
猜你喜欢
  • 2018-11-11
  • 2014-04-21
  • 1970-01-01
  • 1970-01-01
  • 2012-03-02
  • 1970-01-01
  • 1970-01-01
  • 2018-07-31
  • 2017-11-20
相关资源
最近更新 更多