do we have any function in gensim package to calculate the weights of topics ? I need this weight to compare them with 0.05 (p_value) to understand which one is mean full.
1 Answers
It's not clear what you mean by "weights of topics". Can you clarify, in a comment, or edit to your question?
Core Gensim LDA methods like get_document_topics()
(docs) already return results as a list of (topic, probability)
pairs, and allow you to supply an optional minimum_probability
to not return any topics with a lower probability. That may be roughly what you want.
But keep in mind, despite the convention in many fields of research that "the chance of the null hypothesis generating these results is less than 0.05", there's nothing magical or true about that threshold – just convenient & customary. Topics that LDA reports with lower-probability could still be useful to end-users, or helpful contributors to downstream analyses (like classifiers).

- 52,260
- 14
- 86
- 115