diff --git a/spacy/syntax/parser.pyx b/spacy/syntax/parser.pyx index 7da734399..b308aa2e2 100644 --- a/spacy/syntax/parser.pyx +++ b/spacy/syntax/parser.pyx @@ -152,11 +152,11 @@ cdef class Parser: self._advance_beam(gold, gold_parse, True) violn.check(pred, gold) counts = {} - if pred.loss >= 1: + if pred._states[0].loss >= 1: self._count_feats(counts, tokens, violn.g_hist, 1) self._count_feats(counts, tokens, violn.p_hist, -1) self.model._model.update(counts) - return pred.loss + return pred._states[0].loss def _advance_beam(self, Beam beam, GoldParse gold, bint follow_gold): cdef atom_t[CONTEXT_SIZE] context