From 30e1a89aeb8004fc37023d98709bf9d76e04f37d Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 19 Feb 2021 13:01:20 +0100 Subject: [PATCH] Fix displacy output in evaluate CLI (#7122) Now that `nlp.evaluate()` does not modify the examples, rerun the pipeline on the (limited) texts in order to provide the predicted annotation in the displacy output option. --- spacy/cli/evaluate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/cli/evaluate.py b/spacy/cli/evaluate.py index 02f9b6528..368af8d49 100644 --- a/spacy/cli/evaluate.py +++ b/spacy/cli/evaluate.py @@ -132,7 +132,7 @@ def evaluate( if displacy_path: factory_names = [nlp.get_pipe_meta(pipe).factory for pipe in nlp.pipe_names] - docs = [ex.predicted for ex in dev_dataset] + docs = list(nlp.pipe(ex.reference.text for ex in dev_dataset[:displacy_limit])) render_deps = "parser" in factory_names render_ents = "ner" in factory_names render_parses(