Tools to go from a collection of texts to a structural topic model that can be justified: preparing the texts, choosing the number of topics and the vocabulary, reading the topics, and checking them with human coders. The package is built around the stm package and is fast enough for corpora of millions of words.
Details
Preparing texts:
clean_texts(),detect_language(),get_stop_words(),find_duplicate_texts(),chunk_texts(),pool_texts().Texts to tokens:
extract_ngrams(),score_collocations(),select_collocations(),compare_collocation_rules(),compute_tf_idf(),filter_group_quantile(),filter_vocabulary(),vocabulary_diagnostics(),tokens_to_stm().Choosing a model:
evaluate_topic_models()(grid of corpora x K x runs, in parallel), with the metricstopic_coherence(),topic_exclusivity(),topic_diversity(),topic_similarity(),ldatuning_metrics(),topic_stability(),topic_diagnostics(),model_metrics(), and the plotsplot_model_metrics(),plot_k_frontier(),plot_topic_diagnostics(),plot_topic_stability().Human validation:
make_word_intrusion(),make_word_set_intrusion(),make_topic_intrusion(),write_intrusion_sheets(),score_intrusion(),plot_intrusion_results().Reading topics:
topic_terms(),term_counts(),topic_labels(),topic_documents(),topic_word_mass(),marginal_topic_model(),topic_summary(),topic_correlation(),topic_prevalence_by().Effects and prevalence:
topic_effects(),plot_topic_prevalence(),plot_topic_prevalence_over_time().
Exported functions end with ...: an argument renamed in the development version of mintR
gives an error naming its replacement (see NEWS.md), and removed
functions give an error naming theirs (mintR-defunct).
Functions return data.tables or ggplots; they do not write files, except
evaluate_topic_models() when given an output_dir and
write_intrusion_sheets().
Author
Maintainer: Aurélien Goutsmedt agoutsmedt@hotmail.fr
Authors:
Aurélien Goutsmedt agoutsmedt@hotmail.fr
