def evaluate(
        self,
        examples: Iterable[Example],
        *,
        batch_size: Optional[int] = None,
        scorer: Optional[Scorer] = None,
        component_cfg: Optional[Dict[str, Dict[str, Any]]] = None,
        scorer_cfg: Optional[Dict[str, Any]] = None,
        per_component: bool = False,
    ) -> Dict[str, Any]:
        """Evaluate a model's pipeline components.

        examples (Iterable[Example]): `Example` objects.
        batch_size (Optional[int]): Batch size to use.
        scorer (Optional[Scorer]): Scorer to use. If not passed in, a new one
            will be created.
        component_cfg (dict): An optional dictionary with extra keyword
            arguments for specific components.
        scorer_cfg (dict): An optional dictionary with extra keyword arguments
            for the scorer.
        per_component (bool): Whether to return the scores keyed by component
            name. Defaults to False.

        RETURNS (Scorer): The scorer containing the evaluation results.

        DOCS: https://spacy.io/api/language#evaluate
        """
        examples = list(examples)
        validate_examples(examples, "Language.evaluate")
        examples = _copy_examples(examples)
        if batch_size is None:
            batch_size = self.batch_size
        if component_cfg is None:
            component_cfg = {}
        if scorer_cfg is None:
            scorer_cfg = {}
        if scorer is None:
            kwargs = dict(scorer_cfg)
            kwargs.setdefault("nlp", self)
            scorer = Scorer(**kwargs)
        # reset annotation in predicted docs and time tokenization
        start_time = timer()
        # this is purely for timing
        for eg in examples:
            self.make_doc(eg.reference.text)
        # apply all pipeline components
        docs = self.pipe(
            (eg.predicted for eg in examples),
            batch_size=batch_size,
            component_cfg=component_cfg,
        )
        for eg, doc in zip(examples, docs):
            eg.predicted = doc
        end_time = timer()
        results = scorer.score(examples, per_component=per_component)
        n_words = sum(len(eg.predicted) for eg in examples)
        results["speed"] = n_words / (end_time - start_time)
        return _replace_numpy_floats(results)
Evaluate a model's pipeline components.

        examples (Iterable[Example]): `Example` objects.
        batch_size (Optional[int]): Batch size to use.
        scorer (Optional[Scorer]): Scorer to use. If not passed in, a new one
            will be created.
        component_cfg (dict): An optional dictionary with extra keyword
            arguments for specific components.
        scorer_cfg (dict): An optional dictionary with extra keyword arguments
            for the scorer.
        per_component (bool): Whether to return the scores keyed by component
            name. Defaults to False.

        RETURNS (Scorer): The scorer containing the evaluation results.

        DOCS: https://spacy.io/api/language#evaluate
        
spacy/language.py