Examine highest per-term per-topic probabilities
Source:R/text_mining_functions.R
examine_top_terms.Rd
Examine highest per-term per-topic probabilities.
Arguments
- data
A tidy data frame that includes per-term per-topic probabilities (beta).
- top_n
A number of highest per-term per-topic probabilities in each document (number of top_n can be changed).
- ...
Further arguments passed to
dplyr::group_by
.
Value
A tibble (data frame) object with a list of word probabilities from tidytext::tidy
.
The result is a data frame containing word probabilities for each topic.
Examples
suppressWarnings({
if(requireNamespace("quanteda", "tidytext")){
dfm <- SpecialEduTech %>%
preprocess_texts(text_field = "abstract") %>%
quanteda::dfm()
data <- tidytext::tidy(stm_15, document_names = rownames(dfm), log = FALSE)
data %>% examine_top_terms(top_n = 5) %>%
dplyr::mutate_if(is.numeric, ~ round(., 3)) %>%
DT::datatable(rownames = FALSE)
}
})