top_terms | R Documentation |
Returns top-N terms for a topic ranked by probability.
top_terms(mod, topic_id, n_terms)
mod |
an object with STM or LDA model. |
topic_id |
topic ID (numeric). |
n_terms |
the number of terms to return. |
A tibble with a ranked list of terms.
library(stm)
mod <- stm(poliblog5k.docs,
poliblog5k.voc, K=25,
prevalence=~rating,
data=poliblog5k.meta,
max.em.its=2,
init.type="Spectral")
top_terms(mod, 1, 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.