Estimate topic-word distributions from a sub-corpus
This function returns a matrix of word probabilities for each topic similar to mallet.topic.words
, but estimated from a subset of the documents in the corpus.
The model assumes that topics are the same no matter where they are used, but we know this is often not the case. This function lets us test whether some words are used more or less than we expect in a particular set of documents.
mallet.subset.topic.words(topic.model, subset.docs, normalized=FALSE, smoothed=FALSE)
topic.model |
The model returned by |
subset.docs |
An array of TRUE/FALSE values specifying which documents should be used and which should be ignored. |
normalized |
If true, normalize the rows so that each topic sums to one. If false, values will be integers (possibly plus the smoothing constant) representing the actual number of words of each type in the topics. |
smoothed |
If true, add the smoothing parameter for the model (initial value specified as |
## Not run: nips.topic.words <- mallet.subset.topic.words(topic.model, documents$class == "NIPS", smoothed=T, normalized=T) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.