* Remove use of new beam.loss property, to maintain compatibility with older versions of thinc for now.

This commit is contained in:
Matthew Honnibal 2015-06-02 00:57:09 +02:00
parent a3de20118e
commit 75658b2ed3
1 changed files with 2 additions and 2 deletions

View File

@ -152,11 +152,11 @@ cdef class Parser:
self._advance_beam(gold, gold_parse, True) self._advance_beam(gold, gold_parse, True)
violn.check(pred, gold) violn.check(pred, gold)
counts = {} 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.g_hist, 1)
self._count_feats(counts, tokens, violn.p_hist, -1) self._count_feats(counts, tokens, violn.p_hist, -1)
self.model._model.update(counts) self.model._model.update(counts)
return pred.loss return pred._states[0].loss
def _advance_beam(self, Beam beam, GoldParse gold, bint follow_gold): def _advance_beam(self, Beam beam, GoldParse gold, bint follow_gold):
cdef atom_t[CONTEXT_SIZE] context cdef atom_t[CONTEXT_SIZE] context