Ejemplo n.º 1
0
    def top_topics(self,
                   len_topic: int,
                   top_n: int = 10,
                   return_df: bool = True):
        """
        Print important topics based on decomposition.

        Parameters
        ----------
        len_topic: int
        """
        return print_topics_modelling(
            len_topic,
            feature_names=np.array(self._features),
            sorting=np.argsort(self._components)[:, ::-1],
            n_words=top_n,
            return_df=return_df,
        )
Ejemplo n.º 2
0
    def top_topics(self,
                   len_topic: int,
                   top_n: int = 10,
                   return_df: bool = True):
        """
        Print important topics based on decomposition.

        Parameters
        ----------
        len_topic: int
            size of topics.
        top_n: int, optional (default=10)
            top n of each topic.
        return_df: bool, optional (default=True)
            return as pandas.DataFrame, else JSON.
        """
        return print_topics_modelling(
            len_topic,
            feature_names=np.array(self._features),
            sorting=np.argsort(self._components)[:, ::-1],
            n_words=top_n,
            return_df=return_df,
        )