Skip to content

Commit 36a16bf

Browse files
Alexjmshermansj29-innovate
authored andcommitted
Fix positional params used for gensim.models.CoherenceModel in gensim.models.callbacks (piskvorky#1823)
* add keyword params for call to gensim.models.CoherenceModel as positional arguments for coherence and topn were incorrect due to skipping param for keyed_vectors * Fix PEP8
1 parent 33a88f4 commit 36a16bf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gensim/models/callbacks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@ def get_value(self, **kwargs):
9898
self.model = None
9999
self.topics = None
100100
super(CoherenceMetric, self).set_parameters(**kwargs)
101+
101102
cm = gensim.models.CoherenceModel(
102-
self.model, self.topics, self.texts, self.corpus, self.dictionary,
103-
self.window_size, self.coherence, self.topn
103+
model=self.model, topics=self.topics, texts=self.texts, corpus=self.corpus,
104+
dictionary=self.dictionary, window_size=self.window_size,
105+
coherence=self.coherence, topn=self.topn
104106
)
107+
105108
return cm.get_coherence()
106109

107110

0 commit comments

Comments
 (0)