Skip to content

Commit

Permalink
Default to per_word_topics=False in LDA get_item for performance (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
menshikh-iv authored and tmylk committed Feb 20, 2017
1 parent 5a7b43e commit e56fcbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gensim/models/ldamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ def get_document_topics(self, bow, minimum_probability=None, minimum_phi_value=N
)
return self._apply(corpus, **kwargs)

gamma, phis = self.inference([bow], collect_sstats=True)
gamma, phis = self.inference([bow], collect_sstats=per_word_topics)
topic_dist = gamma[0] / sum(gamma[0]) # normalize distribution

document_topics = [(topicid, topicvalue) for topicid, topicvalue in enumerate(topic_dist)
Expand Down

0 comments on commit e56fcbc

Please sign in to comment.