-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CoherenceModel in top_topics in LDAModel to avoid code duplication #1128
Comments
I have a doubt regarding calculating the coherence of each individual topic. Is it like: This will I believe generate non-aggregated coherence scores. I will make a PR accordingly. |
* Add a `get_topics` method to all topic models, add test coverage for this, and update the `CoherenceModel` to use this for getting topics from models. * Require topics returned from `get_topics` to be probability distributions for the probabilistic topic models. * Replace code in `LdaModel.top_topics` with use of `CoherenceModel`. * Fix docstrings to use Google style throughout PR changes and various LdaModel methods.
…iskvorky#1427) * Add a `get_topics` method to all topic models, add test coverage for this, and update the `CoherenceModel` to use this for getting topics from models. * Require topics returned from `get_topics` to be probability distributions for the probabilistic topic models. * Replace code in `LdaModel.top_topics` with use of `CoherenceModel`. * Fix docstrings to use Google style throughout PR changes and various LdaModel methods.
@tmylk dear ` cm = CoherenceModel(model=Lda_Model, texts=texts, dictionary=dictionary, coherence='c_v') plz guide me if u have any idea about this issue |
'u_mass' coherence is currently implemented in two places in gensim: CoherenceModel and LDAModel.
Use
CoherenceModel(coherence='u_mass', topn=num_words)
in LDAModeltop_topics
Will require changes to CoherenceModel to return non-aggregated coherence scores, topic words and avoid importing LDAModel.
The text was updated successfully, but these errors were encountered: