没有分配概率的 GENSIM LDA 主题

发布于 2025-01-12 19:19:59 字数 1155 浏览 2 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧梦荧光笔 2025-01-19 19:19:59

通过将 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) ).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文