在R topicmodels包中,我们如何才能获得主题'分配超过条款?

时间:2015-08-12 08:04:30

标签: r lda topicmodels

我使用topicmodels包运行LDA。

lda.model = LDA(dtm, k,control = list(em = list(iter.max = 1000, tol = 10^-4)))
apps.terms<-terms(lda.model,15)
head(apps.terms)

    Topic.1 Topic.2 Topic.3 Topic.4 Topic.5
1      38      55     187      38      38
2      40      38     171      40      35
3      55      35     178      56      44
4      49      49      74      35      55
5      35      44     177     190      52
6      44      53      80      55      49

这些代码按比例获得15个术语的顺序。如果我没有理解LDA算法。每个主题都是关于术语的分布。所以我想知道这些术语的确切分布。例如。主题1与38相关的30%,与40 ..etc相关的20%。有没有办法通过使用topicmodels包来获得它?

1 个答案:

答案 0 :(得分:1)

听起来你想要每个文件的后验概率。

lda.inf <- posterior(lda.model,dtm)