mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Use Language.pipe in evaluate (#9800)
This commit is contained in:
parent
9964243eb2
commit
a0cdc2b007
|
@ -1404,20 +1404,13 @@ class Language:
|
|||
for eg in examples:
|
||||
self.make_doc(eg.reference.text)
|
||||
# apply all pipeline components
|
||||
for name, pipe in self.pipeline:
|
||||
kwargs = component_cfg.get(name, {})
|
||||
kwargs.setdefault("batch_size", batch_size)
|
||||
for doc, eg in zip(
|
||||
_pipe(
|
||||
(eg.predicted for eg in examples),
|
||||
proc=pipe,
|
||||
name=name,
|
||||
default_error_handler=self.default_error_handler,
|
||||
kwargs=kwargs,
|
||||
),
|
||||
examples,
|
||||
):
|
||||
eg.predicted = doc
|
||||
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)
|
||||
n_words = sum(len(eg.predicted) for eg in examples)
|
||||
|
|
Loading…
Reference in New Issue
Block a user