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)