Description Usage Arguments Value
Get word assignments from LDA_GIBBS class (output of lda.fit). This is similar to the documentsums object that comes as the output of lda.collapsed.gibbs.sampler LDA assigns a topic to each unique word in a document. If you also want to take into account how often this word occured, the document term matrix (as used in the input for lda.fit) must be included in the weight.by.dtm argument.
1 | documentsums(m, weight.by.dtm = NULL)
|
m |
The output from one of the topicmodeling functions in the topicmodels package (e.g., LDA_GIBBS) |
weight.by.dtm |
If you want to weight the topic assignment of a word to the number of times the word occured, give the document term matrix for this argument |
A matrix where rows are topics and columns are documents. Values represent the number of times the topic is assigned to a word in this document (essentially this is the same as the documentsums object in the output of lda.collapsed.gibbs.samler)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.