-
-
Save CyrilRJK/d6d500cd00906d5ae60c4a1810f759ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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