Skip to content

Instantly share code, notes, and snippets.

@techykajal
Created August 28, 2021 13:39
Show Gist options
  • Select an option

  • Save techykajal/ecda1b5536fc6282f86c3a9da2762997 to your computer and use it in GitHub Desktop.

Select an option

Save techykajal/ecda1b5536fc6282f86c3a9da2762997 to your computer and use it in GitHub Desktop.
coherence = []
for k in range(2,25):
LDA = gensim.models.ldamulticore.LdaMulticore
ldamodel = LDA.load(f"ldamodel_for_{k}topics_Run_10")
cm = gensim.models.coherencemodel.CoherenceModel(model=ldamodel, texts=Complete_Content, dictionary=dictionary, coherence='c_v')
coherence.append((k, 'default', 'default', cm.get_coherence()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment