topic_diversity() measures the diversity of topic terms (Dieng et al.
2020): it pools the top n_terms terms of every topic and returns the
proportion of them that are distinct. A value near one means that the topics
are described by different words; a low value means that several topics
repeat the same words and may be redundant.
It returns a single number between 0 and 1 and complements coherence(),
which scores each topic on its own.
Arguments
- object
A topic model fitted by
topics().- n_terms
Top terms per topic to pool (default 10), capped at the terms a topic has.
References
Dieng, A. B., Ruiz, F. J. R., and Blei, D. M. (2020). Topic modeling in embedding spaces. Transactions of the Association for Computational Linguistics, 8, 439–453. doi:10.1162/tacl_a_00325
See also
coherence(); summary();
compare_topics(), which reports both measures per candidate.
