没有分配概率的 GENSIM LDA 主题
我正在使用 LDA 来发现 BOW 数据集中的主题。当我测试 GENSIM 库的安装时,我发现他们网站上的示例结果没有问题( https://radimrehurek.com/gensim/models/ldamodel.html ),每个观察都有完整的主题分布(每行总计为 1 )。
当我尝试在 BOW 数据集(包含 59892 个观察值和 50 个单词的词袋矩阵)中查找主题时,我发现某些观察结果没有完整的主题分布,例如下面的示例:
npTopicsData[0]
array([0. , 0. , 0. , 0.2406106 , 0.5301496 ,
0.17539015, 0. , 0. , 0. , 0. ],
dtype=float32)
npTopicsData[2]
array([0.0100033 , 0.0100017 , 0.01000299, 0.46430823, 0.01000567,
0.34798136, 0.01000324, 0.11768189, 0.01000131, 0.01001031],
dtype=float32)
npTopicsData[0].sum()
0.9461503
npTopicsData[2].sum()
1.0
让您知道我有没有为 LDA 对象的以下可选参数设置任何值:
minimum_probability (float, optional) – Topics with a probability lower than this threshold will be filtered out.
此问题的可能性是什么?我是否应该设置一个参数来确保每个观察结果的完整分布?我
还 应该在 BOW 数据集中监视任何问题吗?已经用过lda.get_document_topics(corpus)
从 GENSIM 对象中检索主题以获取训练数据(而不是使用 vector = lda[unseen_doc]
获取未见数据),这是正确的做法吗?
I'm using LDA to discover topics in a BOW dataset. As I was testing the installation of the GENSIM library, I found no issue in the results of the example in their website ( https://radimrehurek.com/gensim/models/ldamodel.html ), each observation had a complete distribution of topics ( each row summed up to 1 ).
As I tried to find topics in my BOW dataset ( Bag of words matrix of (59892 observations and 50 words ), I found out that some observations did not have a complete distribution of topics such as the examples below:
npTopicsData[0]
array([0. , 0. , 0. , 0.2406106 , 0.5301496 ,
0.17539015, 0. , 0. , 0. , 0. ],
dtype=float32)
npTopicsData[2]
array([0.0100033 , 0.0100017 , 0.01000299, 0.46430823, 0.01000567,
0.34798136, 0.01000324, 0.11768189, 0.01000131, 0.01001031],
dtype=float32)
npTopicsData[0].sum()
0.9461503
npTopicsData[2].sum()
1.0
letting you know that I have not set any value for the following optional parameter for the LDA object:
minimum_probability (float, optional) – Topics with a probability lower than this threshold will be filtered out.
What are the possibilities of this issue? Is there a parameter I should set to insure a complete distribution for each observation? any problems I should monitor in the BOW dataset?
I also have used lda.get_document_topics(corpus)
to retrieve topics from the GENSIM object for the training data (instead of vector = lda[unseen_doc]
for unseen data), is that the correct practice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过将 GENSIM LDA 对象中的以下参数设置为 0(minimum_probability(float,可选)),可以解决观察的不完整主题分布。
The observation's incomplete topic distribution might have been solved by setting the following parameter in the GENSIM LDA object to 0 ( minimum_probability (float, optional) ).