top_words | R Documentation |
The most common way to summarize topics is to list their top-weighted words, together with their topic weights. Though every topic assigns some probability to every word in the whole vocabulary, we often disregard all but its most frequent words.
top_words(m, ...)
m |
a |
n |
number of top words per topic to return (omit for all available) |
weighting |
a function to transform the full topic-word matrix before
calculating top-ranked words. If NULL, taken to be identity. Other
possibilities include |
The data frame returned by this function supplies no new information not already present in the topic-word matrix; it is in effect an aggressively sparse representation of the full topic-word matrix. But it is so commonly used that it makes more sense to store it on its own. Indeed, when analyzing model outputs, one will often prefer to load just this data frame and the doc-topics matrix into memory, rather than the full topic-word matrix.
a data frame with three columns, topic
(indexed from 1),
word
(character), and weight
tw_blei_lafferty
, tw_sievert_shirley
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.