(self, doc: Doc, lang: types.LangLike, **kwargs)
return self._make_new_spacy_doc(new_nested_aug_toks, lang)
Sequentially apply some subset of data augmentation transforms to ``doc``,
        then return a new ``Doc`` created from the augmented text using ``lang``.

        Args:
            doc
            lang
            **kwargs: If, for whatever reason, you have to pass keyword argument values
                into transforms that vary or depend on characteristics of ``doc``,
                specify them here. The transforms' call signatures will be inspected,
                and values will be passed along, as needed.

        Returns:
            :class:`spacy.tokens.Doc`
Sequentially apply some subset of data augmentation transforms to ``doc``,
        then return a new ``Doc`` created from the augmented text using ``lang``.
Sequentially apply some subset of data augmentation transforms to doc then return a new Doc created from the augmented text using lang .
def apply_transforms(self, doc: Doc, lang: types.LangLike, **kwargs) -> Doc:
        """
        Sequentially apply some subset of data augmentation transforms to ``doc``,
        then return a new ``Doc`` created from the augmented text using ``lang``.

        Args:
            doc
            lang
            **kwargs: If, for whatever reason, you have to pass keyword argument values
                into transforms that vary or depend on characteristics of ``doc``,
                specify them here. The transforms' call signatures will be inspected,
                and values will be passed along, as needed.

        Returns:
            :class:`spacy.tokens.Doc`
        """
        if doc.has_annotation("SENT_START"):
            nested_aug_toks = [aug_utils.to_aug_toks(sent) for sent in doc.sents]
        else:
            nested_aug_toks = [aug_utils.to_aug_toks(doc)]
        tfs = self._get_random_transforms()
        new_nested_aug_toks = []
        for aug_toks in nested_aug_toks:
            # this is a bit of a hack, but whatchagonnado
            if kwargs:
                for tf in tfs:
                    tf_kwargs = utils.get_kwargs_for_func(tf, kwargs)
                    aug_toks = tf(aug_toks, **tf_kwargs)
            else:
                for tf in tfs:
                    aug_toks = tf(aug_toks)
            new_nested_aug_toks.append(aug_toks)
        return self._make_new_spacy_doc(new_nested_aug_toks, lang)
def apply_transforms ( self , doc : Doc , lang : types . LangLike , * * kwargs ) -> Doc : if doc . has_annotation ( "SENT_START" ) : nested_aug_toks = [ aug_utils . to_aug_toks ( sent ) for sent in doc . sents ] else : nested_aug_toks = [ aug_utils . to_aug_toks ( doc ) ] tfs = self . _get_random_transforms ( ) new_nested_aug_toks = [ ] for aug_toks in nested_aug_toks : # this is a bit of a hack, but whatchagonnado if kwargs : for tf in tfs : tf_kwargs = utils . get_kwargs_for_func ( tf , kwargs ) aug_toks = tf ( aug_toks , * * tf_kwargs ) else : for tf in tfs : aug_toks = tf ( aug_toks ) new_nested_aug_toks . append ( aug_toks ) return self . _make_new_spacy_doc ( new_nested_aug_toks , lang )