(
        self, tokenized_docs: Iterable[Iterable[str]], grps: Iterable[str]
    )
return grp_term_matrix
Count terms in ``tokenized_docs`` and, if not already provided, build up
        a vocabulary based those terms; do the same for the groups in ``grps``.
        Fit and store global weights (IDFs) and, if needed for term weighting,
        the average document length. Transform ``tokenized_docs`` into a
        group-term matrix with values weighted according to the parameters in
        :class:`GroupVectorizer` initialization.

        Args:
            tokenized_docs: A sequence of tokenized documents, where each is
                a sequence of term strings. For example::

                    >>> ([tok.lemma_ for tok in spacy_doc]
                    ...  for spacy_doc in spacy_docs)
                    >>> ((ne.text for ne in extract.entities(doc))
                    ...  for doc in corpus)

            grps: Sequence of group names by which the terms in ``tokenized_docs``
                are aggregated, where the first item in ``grps`` corresponds to
                the first item in ``tokenized_docs``, and so on.

        Returns:
            The transformed group-term matrix, where rows correspond to groups
            and columns correspond to terms, as a sparse row matrix.
Count terms in ``tokenized_docs`` and, if not already provided, build up
        a vocabulary based those terms; do the same for the groups in ``grps``.
        Fit and store global weights (IDFs) and, if needed for term weighting,
        the average document length. Transform ``tokenized_docs`` into a
        group-term matrix with values weighted according to the parameters in
        :class:`GroupVectorizer` initialization.
Count terms in tokenized_docs and if not already provided build up a vocabulary based those terms ; do the same for the groups in grps . Fit and store global weights ( IDFs ) and if needed for term weighting the average document length . Transform tokenized_docs into a group - term matrix with values weighted according to the parameters in : class : GroupVectorizer initialization .
def fit_transform(
        self, tokenized_docs: Iterable[Iterable[str]], grps: Iterable[str]
    ) -> sp.csr_matrix:
        """
        Count terms in ``tokenized_docs`` and, if not already provided, build up
        a vocabulary based those terms; do the same for the groups in ``grps``.
        Fit and store global weights (IDFs) and, if needed for term weighting,
        the average document length. Transform ``tokenized_docs`` into a
        group-term matrix with values weighted according to the parameters in
        :class:`GroupVectorizer` initialization.

        Args:
            tokenized_docs: A sequence of tokenized documents, where each is
                a sequence of term strings. For example::

                    >>> ([tok.lemma_ for tok in spacy_doc]
                    ...  for spacy_doc in spacy_docs)
                    >>> ((ne.text for ne in extract.entities(doc))
                    ...  for doc in corpus)

            grps: Sequence of group names by which the terms in ``tokenized_docs``
                are aggregated, where the first item in ``grps`` corresponds to
                the first item in ``tokenized_docs``, and so on.

        Returns:
            The transformed group-term matrix, where rows correspond to groups
            and columns correspond to terms, as a sparse row matrix.
        """
        # count terms and fit global weights
        grp_term_matrix = self._fit(tokenized_docs, grps)
        # re-weight values in group-term matrix, as specified in init
        grp_term_matrix = self._reweight_values(grp_term_matrix)
        return grp_term_matrix
def fit_transform ( self , tokenized_docs : Iterable [ Iterable [ str ] ] , grps : Iterable [ str ] ) -> sp . csr_matrix : # count terms and fit global weights grp_term_matrix = self . _fit ( tokenized_docs , grps ) # re-weight values in group-term matrix, as specified in init grp_term_matrix = self . _reweight_values ( grp_term_matrix ) return grp_term_matrix