Top2Vec icon indicating copy to clipboard operation
Top2Vec copied to clipboard

How to get the topc size and topic number of reduced model

Open josepius-clemson opened this issue 1 year ago • 3 comments

Could you please tell me how to get the topic size and topic number of the reduced hierarchical model?

josepius-clemson avatar Mar 16 '23 15:03 josepius-clemson

have you found the solution?

MuntahaShams avatar Mar 30 '23 08:03 MuntahaShams

Could you please tell me how to get the topic size and topic number of the reduced hierarchical model?

Hi did you manage to reduce the number of topics?

yananma1029 avatar Apr 06 '23 17:04 yananma1029

` def get_num_topics(self, reduced=False): """ Get number of topics. This is the number of topics Top2Vec has found in the data by default. If reduced is True, the number of reduced topics is returned. Parameters ---------- reduced: bool (Optional, default False) The number of original topics will be returned by default. If True will return the number of reduced topics, if hierarchical topic reduction has been performed. Returns ------- num_topics: int """

    if reduced:
        self._validate_hierarchical_reduction()
        return len(self.topic_vectors_reduced)
    else:
        return len(self.topic_vectors)`

i think just set reduced=True, and you can get topics after reduced and topic size is in same way. This Module store raw model and raw topics seperately.

Vela-zz avatar Apr 08 '23 01:04 Vela-zz