f24ec78689de323f35eee0b66a01019676518b77,gensim/models/coherencemodel.py,CoherenceModel,_get_topics,#CoherenceModel#,269

Before Change


        topics = []
        if isinstance(self.model, LdaModel):
            for topic in self.model.state.get_lambda():
                bestn = argsort(topic, topn=self.topn, reverse=True)
                topics.append(bestn)
        elif isinstance(self.model, LdaVowpalWabbit):
            for topic in self.model._get_topics():
                bestn = argsort(topic, topn=self.topn, reverse=True)

After Change


    def _get_topics(self):
        Internal helper function to return topics from a trained topic model.
        try:
            return [
                argsort(topic, topn=self.topn, reverse=True) for topic in
                self.model.get_topics()
            ]
        except AttributeError:
            raise ValueError(
                "This topic model is not currently supported. Supported topic models"
                " should implement the `get_topics` method.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: f24ec78689de323f35eee0b66a01019676518b77
Time: 2017-08-18
Author: macks22@users.noreply.github.com
File Name: gensim/models/coherencemodel.py
Class Name: CoherenceModel
Method Name: _get_topics


Project Name: tensorpack/tensorpack
Commit Name: 13ee370cfcad89fe4ad2556120dd2def49e1e0a7
Time: 2019-08-07
Author: ppwwyyxx@users.noreply.github.com
File Name: examples/FasterRCNN/viz.py
Class Name:
Method Name: draw_final_outputs_blackwhite


Project Name: tensorflow/models
Commit Name: 64710c051f26a2778c03fc15ef29c4bcae01df32
Time: 2018-08-22
Author: reedwm@google.com
File Name: official/recommendation/ncf_main.py
Class Name:
Method Name: evaluate_model