From 75658b2ed324f6fa14d0a6fb179b595df38be807 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 2 Jun 2015 00:57:09 +0200 Subject: [PATCH] * Remove use of new beam.loss property, to maintain compatibility with older versions of thinc for now. --- spacy/syntax/parser.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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