portathome.blogg.se

Topic coherence score
Topic coherence score





ValueError: This topic model is not currently supported. Supported topic models"Ĥ96 " should implement the `get_topics` method.") > 495 "This topic model is not currently supported. > 469 return self._get_topics_from_model(self.model, self.topn)Ĥ71 in _get_topics_from_model(model, topn) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\coherencemodel.py in _get_topics(self)Ĥ68 """Internal helper function to return topics from a trained topic model.""" ~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\coherencemodel.py in topics(self, topics)Ĥ36 bug("Setting topics to those of the model: %s", self.model) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\coherencemodel.py in _init_(self, model, topics, texts, corpus, dictionary, window_size, keyed_vectors, coherence, topn, processes)Ģ14 self.processes = processes if processes >= 1 else max(1, mp.cpu_count() - 1) > 1 coherence_model_lda = CoherenceModel(model = best_lda_model,texts=data_vectorized, dictionary=dictionary,coherence='c_v')Ģ coherence_lda = coherence_model_lda.get_coherence()ģ print('\n Coherence Score :',coherence_lda) ValueError Traceback (most recent call last) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\coherencemodel.py in _get_topics_from_model(model, topn)Ĥ90 matutils.argsort(topic, topn=topn, reverse=True) for topic inĪttributeError: 'LatentDirichletAllocation' object has no attribute 'get_topics'ĭuring handling of the above exception, another exception occurred: Also, what metric is the sklearn LDA using to group these words together ? -ĪttributeError Traceback (most recent call last) Output : This error pops up because i'm trying to find the coherence score of an sklearn LDA topic model, is there a way around it. Print('\n Coherence Score :',coherence_lda) coherence_model_lda = CoherenceModel(model = best_lda_model,texts=data_vectorized, dictionary=dictionary,coherence='c_v')Ĭoherence_lda = coherence_model_lda.get_coherence() Here, best_model_lda is an sklearn based LDA model and we are trying to find a coherence score for this model.







Topic coherence score