Skip to content

Instantly share code, notes, and snippets.

@CyrilRJK
Created Jun 7, 2022
Embed
What would you like to do?
def get_coherence(topics, documents):
id2word = corpora.Dictionary(documents)
cm = CoherenceModel(topics=topics,
texts=documents,
dictionary=id2word,
coherence='c_v')
return cm.get_coherence()
get_coherence(topics, tokenized_docs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment