rsreetech/LDATopicModelling

I got this error that made me crazy

Closed this issue · 2 comments

AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_4688/4229592419.py in
----> 1 model_list, coherence_values = compute_coherence_values(dictionary=dictionary, corpus=doc_term_matrix, texts=tokenized_reviews, start=2, limit=50, step=1)

~\AppData\Local\Temp/ipykernel_4688/422587657.py in compute_coherence_values(dictionary, corpus, texts, limit, start, step)
25 model_list = []
26 for num_topics in range(start, limit, step):
---> 27 model = gensim.models.ldamodel.LdaModel(corpus=corpus, num_topics=num_topics, id2word=dictionary)
28 model_list.append(model)
29 coherencemodel = CoherenceModel(model=model, texts=texts, dictionary=dictionary, coherence='c_v')

AttributeError: module 'pyLDAvis.gensim' has no attribute 'models'

module 'pyLDAvis.gensim' has no attribute 'models'

what is the problem in this code

Please find the solution here: bmabey/pyLDAvis#131 It is go to do with library versions
My code is quite old now and changes have happened to the library.
Please learn to google to solve your issues . Will always help you in your career