简体   繁体   English

我可以在 LDA 中获得一个单词的主题分布吗?

[英]Can I get topics distribution of a word in LDA?

I'm new to LDA and I want to calculate the topic similarity between words.我是 LDA 的新手,我想计算单词之间的主题相似度。 Can I get the topic distribution of a word?我可以得到一个单词的主题分布吗? If so, how can I do this in gensim.ldamodel?如果是这样,我该如何在 gensim.ldamodel 中做到这一点?

Gensim's LDA mallet wrapper has a load_word_topics() function (I would assume this is true for its python LDA implementation as well). Gensim 的 LDA mallet 包装器有一个load_word_topics() function(我认为它的 python LDA 实现也是如此)。 It returns a matrix that is words X topics.它返回一个由单词 X 个主题组成的矩阵。 From that, you can get a vector of frequencies each word in each topic.由此,您可以获得每个主题中每个单词的频率向量。 That would be the topic-word distribution for a given word.这将是给定单词的主题词分布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM