Extracts and summarizes topic probabilities (gamma values) from an STM model, returning a formatted data table of mean topic prevalence.
Value
A DT::datatable showing topics and their mean gamma (prevalence) values, rounded to 3 decimal places.
See also
Other topic-modeling:
analyze_semantic_evolution(),
assess_embedding_stability(),
assess_hybrid_stability(),
auto_tune_embedding_topics(),
calculate_assignment_consistency(),
calculate_eval_metrics_internal(),
calculate_keyword_stability(),
calculate_semantic_drift(),
calculate_topic_stability(),
find_optimal_k(),
find_topic_matches(),
fit_embedding_model(),
fit_hybrid_model(),
fit_temporal_model(),
generate_topic_labels(),
get_topic_prevalence(),
get_topic_terms(),
get_topic_texts(),
identify_topic_trends(),
plot_model_comparison(),
plot_quality_metrics(),
run_contrastive_topics_internal(),
run_neural_topics_internal(),
run_temporal_topics_internal(),
validate_semantic_coherence()
Examples
if (interactive()) {
data <- TextAnalysisR::SpecialEduTech
united <- unite_cols(data, c("title", "keyword", "abstract"))
tokens <- prep_texts(united, text_field = "united_texts")
dfm_obj <- quanteda::dfm(tokens)
stm_data <- quanteda::convert(dfm_obj, to = "stm")
topic_model <- stm::stm(
documents = stm_data$documents,
vocab = stm_data$vocab,
K = 10,
verbose = FALSE
)
prob_table <- calculate_topic_probability(topic_model, top_n = 10)
print(prob_table)
}
