From 204b58c86491fa9f3cbddadf026c9a49e57b521a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 24 Sep 2017 05:01:03 -0500 Subject: [PATCH] Fix evaluation during training --- spacy/cli/train.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/cli/train.py b/spacy/cli/train.py index 055cccab0..d9c345b97 100644 --- a/spacy/cli/train.py +++ b/spacy/cli/train.py @@ -105,10 +105,10 @@ def train(cmd, lang, output_dir, train_data, dev_data, n_iter=20, n_sents=0, nlp.to_disk(epoch_model_path) nlp_loaded = lang_class(pipeline=pipeline) nlp_loaded = nlp_loaded.from_disk(epoch_model_path) - scorer = nlp.evaluate( - corpus.dev_docs( - nlp, - gold_preproc=gold_preproc)) + scorer = nlp_loaded.evaluate( + list(corpus.dev_docs( + nlp_loaded, + gold_preproc=gold_preproc))) acc_loc =(output_path / ('model%d' % i) / 'accuracy.json') with acc_loc.open('w') as file_: file_.write(json_dumps(scorer.scores))