From 8ac5f222531dcb602d08118693618598bc0c045d Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Fri, 9 Oct 2020 18:00:16 +0200 Subject: [PATCH] Adjust error message --- spacy/errors.py | 5 +++-- spacy/training/loop.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spacy/errors.py b/spacy/errors.py index 0932ba0fd..be327a784 100644 --- a/spacy/errors.py +++ b/spacy/errors.py @@ -456,8 +456,9 @@ class Errors: "issue tracker: http://github.com/explosion/spaCy/issues") # TODO: fix numbering after merging develop into master - E900 = ("Could not run the full 'nlp' pipeline for evaluation. If you specified " - "frozen components, make sure they were already initialized and trained. ") + E900 = ("Could not run the full pipeline for evaluation. If you specified " + "frozen components, make sure they were already initialized and " + "trained. Full pipeline: {pipeline}") E901 = ("Failed to remove existing output directory: {path}. If your " "config and the components you train change between runs, a " "non-empty output directory can lead to stale pipeline data. To " diff --git a/spacy/training/loop.py b/spacy/training/loop.py index 8e688a27d..c3fa83b39 100644 --- a/spacy/training/loop.py +++ b/spacy/training/loop.py @@ -252,7 +252,7 @@ def create_evaluation_callback( try: scores = nlp.evaluate(dev_examples) except KeyError as e: - raise KeyError(Errors.E900) from e + raise KeyError(Errors.E900.format(pipeline=nlp.pipe_names)) from e # Calculate a weighted sum based on score_weights for the main score. # We can only consider scores that are ints/floats, not dicts like # entity scores per type etc.