

If `corpus` is an instance of `tomotopy.LDAModel` and its descendants, target words are extracted from each topic of the topic model.īut if `targets` are given, target words are extracted from `targets`, even if `corpus` is an instance of topic models.Īn epsilon value to prevent division by zeroĪ gamma value for indirect confirm measures The number of top words to be extracted from each topic. Only words that are provided as `targets` are included in probability estimation. If `corpus` is an instance of ``, target words must be given. Or a combination of (``, ``, ``, ``).Īlso shorthands in `str` type are supported as follows:

The metric can be a combination of (``, ``, ``) If `corpus` is an instance of ``, `targets` must be given too.Ĭoherence : Union, Tuple]Ī coherence metric to be used. Supports not only an instance of ``, but also any topic model instances including `tomotopy.LDAModel` and its descendants. '''Initialize an instance to calculate coherence for given corpusĬorpus : UnionĪ reference corpus to be used for estimating probability. 'c_npmi':(ProbEstimation.SLIDING_WINDOWS, 10, Segmentation.ONE_ONE, ConfirmMeasure.NPMI, IndirectMeasure.NONE)ĭef _init_(self, corpus, coherence='u_mass', window_size=0, targets=None, top_n=10, eps=1e-12, gamma=1.0): 'c_uci':(ProbEstimation.SLIDING_WINDOWS, 10, Segmentation.ONE_ONE, ConfirmMeasure.PMI, IndirectMeasure.NONE), 'c_v':(ProbEstimation.SLIDING_WINDOWS, 110, Segmentation.ONE_SET, ConfirmMeasure.NPMI, IndirectMeasure.COSINE), 'u_mass':(ProbEstimation.DOCUMENT, 0, Segmentation.ONE_PRE, ConfirmMeasure.LOGCOND, IndirectMeasure.NONE), '''`Coherence` class provides the way to calculate topic coherence. This enumeration follows the indirect confirm measure in the paper. This enumeration follows the direct confirm measure in the paper. This enumeration follows the segmentation in the paper. This enumeration follows the probability estimator in the paper.

In Proceedings of the eighth ACM international conference on Web search and data mining (pp. Exploring the space of topic coherence measures. This module provides the way to calculate topic coherence introduced the following paper:
