From 1f7c56cd932bc1543101608fa8d01baf8951abc6 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 24 Feb 2019 16:53:22 +0100 Subject: [PATCH] Fix parser.add_label() --- spacy/syntax/nn_parser.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index ab983dc85..ee9d0ee7e 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -163,7 +163,7 @@ cdef class Parser: added = self.moves.add_action(action, label) if added: resized = True - if resized: + if resized and "nr_class" in self.cfg: self.cfg["nr_class"] = self.moves.n_moves if self.model not in (True, False, None) and resized: self.model.resize_output(self.moves.n_moves)