(
        self, doc_term_matrix, *, normalize: bool = True
    )
Transform a document-term matrix into a document-topic matrix, where rows
        correspond to documents and columns to the topics in the topic model.

        Args:
            doc_term_matrix (array-like or sparse matrix): Corpus represented as a
                document-term matrix with shape (n_docs, n_terms). LDA expects
                tf-weighting, while NMF and LSA may do better with tfidf-weighting.
            normalize: If True, the values in each row are normalized,
                i.e. topic weights on each document sum to 1.

        Returns:
            Document-topic matrix with shape (n_docs, n_topics).
Transform a document-term matrix into a document-topic matrix, where rows
        correspond to documents and columns to the topics in the topic model.
Transform a document - term matrix into a document - topic matrix where rows correspond to documents and columns to the topics in the topic model .
def get_doc_topic_matrix(
        self, doc_term_matrix, *, normalize: bool = True
    ) -> np.ndarray:
        """
        Transform a document-term matrix into a document-topic matrix, where rows
        correspond to documents and columns to the topics in the topic model.

        Args:
            doc_term_matrix (array-like or sparse matrix): Corpus represented as a
                document-term matrix with shape (n_docs, n_terms). LDA expects
                tf-weighting, while NMF and LSA may do better with tfidf-weighting.
            normalize: If True, the values in each row are normalized,
                i.e. topic weights on each document sum to 1.

        Returns:
            Document-topic matrix with shape (n_docs, n_topics).
        """
        doc_topic_matrix = self.transform(doc_term_matrix)
        if normalize is True:
            return doc_topic_matrix / np.sum(doc_topic_matrix, axis=1, keepdims=True)
        else:
            return doc_topic_matrix
def get_doc_topic_matrix ( self , doc_term_matrix , * , normalize : bool = True ) -> np . ndarray : doc_topic_matrix = self . transform ( doc_term_matrix ) if normalize is True : return doc_topic_matrix / np . sum ( doc_topic_matrix , axis = 1 , keepdims = True ) else : return doc_topic_matrix