diff --git a/gensim/models/callbacks.py b/gensim/models/callbacks.py index 824b9b0e1d..9f098abe79 100644 --- a/gensim/models/callbacks.py +++ b/gensim/models/callbacks.py @@ -98,10 +98,13 @@ def get_value(self, **kwargs): self.model = None self.topics = None super(CoherenceMetric, self).set_parameters(**kwargs) + cm = gensim.models.CoherenceModel( - self.model, self.topics, self.texts, self.corpus, self.dictionary, - self.window_size, self.coherence, self.topn + model=self.model, topics=self.topics, texts=self.texts, corpus=self.corpus, + dictionary=self.dictionary, window_size=self.window_size, + coherence=self.coherence, topn=self.topn ) + return cm.get_coherence()