(
        self, tokenized_docs: Iterable[Iterable[str]], grps: Iterable[str]
    )
return self._reweight_values(grp_term_matrix)
Transform ``tokenized_docs`` and ``grps`` into a group-term matrix with
        values weighted according to the parameters in :class:`GroupVectorizer`
        initialization and the global weights computed by calling
        :meth:`GroupVectorizer.fit()`.

        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.

        Note:
            For best results, the tokenization used to produce ``tokenized_docs``
            should be the same as was applied to the docs used in fitting this
            vectorizer or in generating a fixed input vocabulary.

            Consider an extreme case where the docs used in fitting consist of
            lowercased (non-numeric) terms, while the docs to be transformed are
            all uppercased: The output group-term-matrix will be empty.
Transform ``tokenized_docs`` and ``grps`` into a group-term matrix with
        values weighted according to the parameters in :class:`GroupVectorizer`
        initialization and the global weights computed by calling
        :meth:`GroupVectorizer.fit()`.
Transform tokenized_docs and grps into a group - term matrix with values weighted according to the parameters in : class : GroupVectorizer initialization and the global weights computed by calling : meth : GroupVectorizer . fit () .
def transform(
        self, tokenized_docs: Iterable[Iterable[str]], grps: Iterable[str]
    ) -> sp.csr_matrix:
        """
        Transform ``tokenized_docs`` and ``grps`` into a group-term matrix with
        values weighted according to the parameters in :class:`GroupVectorizer`
        initialization and the global weights computed by calling
        :meth:`GroupVectorizer.fit()`.

        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.

        Note:
            For best results, the tokenization used to produce ``tokenized_docs``
            should be the same as was applied to the docs used in fitting this
            vectorizer or in generating a fixed input vocabulary.

            Consider an extreme case where the docs used in fitting consist of
            lowercased (non-numeric) terms, while the docs to be transformed are
            all uppercased: The output group-term-matrix will be empty.
        """
        self._check_vocabulary()
        grp_term_matrix, _, _ = self._count_terms(tokenized_docs, grps, True, True)
        return self._reweight_values(grp_term_matrix)
def transform ( self , tokenized_docs : Iterable [ Iterable [ str ] ] , grps : Iterable [ str ] ) -> sp . csr_matrix : self . _check_vocabulary ( ) grp_term_matrix , _ , _ = self . _count_terms ( tokenized_docs , grps , True , True ) return self . _reweight_values ( grp_term_matrix )