I am learning about Probabilistic Topic Models by reading this article by D. Blei, watching this video, and doing this exercise A Gentle Introduction to Topic Modeling in R.

After the topics in my corpus are defined (by the algorithm), will the "LDA" package in R allow me to find the documents for a specific topic that was modeled? Put differently, how can I check which documents contributed to the formation of a certain topic in the final model?

Any advice on this topic or how to better formulate my question is appreciated.


In the R code under the link for A Gentle Introduction to Topic Modeling there is a snippet that does just what I'm looking for - i.e. it attributes each document in the corpus to one of 5 theme topics.

#write out results
#docs to topics
ldaOut.topics <- as.matrix(topics(ldaOut))

This snippet quantifies the probability with which each document is associated with a certain theme:

#probabilities associated with each topic assignment
topicProbabilities <- as.data.frame(ldaOut@gamma)
  • $\begingroup$ Note that topic model attributes a stochastic mixture of the topics to each document, not one topic. $\endgroup$ – Emre Jul 8 '16 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.