Build labels such as "3: labor, wages, unions" from the top
words of each topic, with the same words as stm::labelTopics().
Usage
topic_labels(
model,
measure = c("prob", "frex", "lift", "score"),
n_terms = 3L,
sep = ", ",
frexw = 0.5,
...
)Arguments
- model
A fitted
stmmodel without a content covariate (for a content-covariate model, usemarginal_topic_model()first).- measure
Measure used to pick the words:
"prob","frex","lift"or"score"(seetopic_terms()).- n_terms
Integer scalar, number of words per label.
- sep
Character scalar placed between words.
- frexw
Numeric scalar in [0, 1], FREX weight (as in
stm::labelTopics()).- ...
Not used: an argument renamed in the development version of mintR gives an error naming its replacement.
Details
Faster than stm::labelTopics(), which computes the four
measures for every topic: only the measure asked for is computed, and
only the n_terms best words are kept. The words are identical to
labelTopics(), ties included (both keep the vocabulary order among
ties). FREX is computed with stm's internal function because
labelTopics() shrinks exclusivity towards the corpus word counts
(James-Stein estimator), which topic_terms() does not; the FREX
labels may thus differ from its FREX top terms.
