def _lemmatize(self, data: List[str], ngram_range: Optional[Tuple[int, int]] = None, batch_size: int = 10000,
                   lowercase: bool = True) -> Generator[List[str], Any, None]:
        """Lemmatize a list of documents.

        Args:
            data: a list of documents to tokenize
            ngram_range: size of ngrams to create; only unigrams are returned by default
            batch_size: a batch size for spaCy buffering

       Yields:
           list of lists of ngramized lemmas or list of detokenized strings

        Returns:
            None

        """
        _batch_size = self.batch_size or batch_size
        _ngram_range = ngram_range or self.ngram_range

        if self.lowercase is None:
            _lowercase = lowercase
        else:
            _lowercase = self.lowercase

        for i, doc in enumerate(
                self.model.pipe(data, batch_size=_batch_size)):
            lemmas = [t.lemma_ for t in doc]
            if _lowercase:
                lemmas = [t.lower() for t in lemmas]
            lemm_doc = " ".join(lemmas)
            filtered = self._filter(lemmas)
            processed_doc = ngramize(filtered, ngram_range=_ngram_range, doc=lemm_doc)
            yield from processed_doc
Lemmatize a list of documents.

        Args:
            data: a list of documents to tokenize
            ngram_range: size of ngrams to create; only unigrams are returned by default
            batch_size: a batch size for spaCy buffering

       Yields:
           list of lists of ngramized lemmas or list of detokenized strings

        Returns:
            None

        
deeppavlov/models/tokenizers/spacy_tokenizer.py