(
        self,
        records: Iterable[types.Record],
        batch_size: int = 1000,
        n_process: int = 1,
    )
Add a stream of records to the corpus, efficiently processing them into
        :class:`spacy.tokens.Doc` s using the :attr:`Corpus.spacy_lang` pipeline.

        Args:
            records: Sequence of records to process and add to corpus.
            batch_size: Number of texts to buffer when processing with spaCy.
            n_process: Number of parallel processors to run when processing.
                If -1, this is set to ``multiprocessing.cpu_count()``.

                .. note:: This feature is only available in spaCy 2.2.2+.
Add a stream of records to the corpus, efficiently processing them into
        :class:`spacy.tokens.Doc` s using the :attr:`Corpus.spacy_lang` pipeline.
Add a stream of records to the corpus efficiently processing them into : class : spacy . tokens . Doc s using the : attr : Corpus . spacy_lang pipeline .
def add_records(
        self,
        records: Iterable[types.Record],
        batch_size: int = 1000,
        n_process: int = 1,
    ) -> None:
        """
        Add a stream of records to the corpus, efficiently processing them into
        :class:`spacy.tokens.Doc` s using the :attr:`Corpus.spacy_lang` pipeline.

        Args:
            records: Sequence of records to process and add to corpus.
            batch_size: Number of texts to buffer when processing with spaCy.
            n_process: Number of parallel processors to run when processing.
                If -1, this is set to ``multiprocessing.cpu_count()``.

                .. note:: This feature is only available in spaCy 2.2.2+.
        """
        if spacy.__version__ >= "2.2.2":
            for doc, meta in self.spacy_lang.pipe(
                records,
                as_tuples=True,
                batch_size=batch_size,
                n_process=n_process,
            ):
                doc._.meta = meta
                self._add_valid_doc(doc)
        else:
            if n_process != 1:
                LOGGER.warning("`n_process` is not available with spacy < 2.2.2")
            for doc, meta in self.spacy_lang.pipe(
                records,
                as_tuples=True,
                batch_size=batch_size,
            ):
                doc._.meta = meta
                self._add_valid_doc(doc)
def add_records ( self , records : Iterable [ types . Record ] , batch_size : int = 1000 , n_process : int = 1 , ) -> None : if spacy . __version__ >= "2.2.2" : for doc , meta in self . spacy_lang . pipe ( records , as_tuples = True , batch_size = batch_size , n_process = n_process , ) : doc . _ . meta = meta self . _add_valid_doc ( doc ) else : if n_process != 1 : LOGGER . warning ( "`n_process` is not available with spacy < 2.2.2" ) for doc , meta in self . spacy_lang . pipe ( records , as_tuples = True , batch_size = batch_size , ) : doc . _ . meta = meta self . _add_valid_doc ( doc )