From 97a1286129cf5a8dd3dc16fe4ced653bd9d61b2a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 9 Jan 2017 10:08:34 -0600 Subject: [PATCH] Revert changes to tagger and parser for thinc 6 --- spacy/syntax/parser.pyx | 6 +++--- spacy/tagger.pyx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spacy/syntax/parser.pyx b/spacy/syntax/parser.pyx index 50ded884f..eb094fa97 100644 --- a/spacy/syntax/parser.pyx +++ b/spacy/syntax/parser.pyx @@ -255,10 +255,10 @@ cdef class Parser: cdef weight_t loss = 0 cdef Transition action while not stcls.is_final(): - self.model.set_featuresC(eg.c, stcls.c) + self.model.set_featuresC(&eg.c, stcls.c) self.moves.set_costs(eg.c.is_valid, eg.c.costs, stcls, gold) self.model.set_scoresC(eg.c.scores, eg.c.features, eg.c.nr_feat) - self.model.updateC(eg.c) + self.model.updateC(&eg.c) guess = VecVec.arg_max_if_true(eg.c.scores, eg.c.is_valid, eg.c.nr_class) action = self.moves.c[eg.guess] @@ -343,7 +343,7 @@ cdef class StepwiseState: def predict(self): self.eg.reset() - self.parser.model.set_featuresC(self.eg.c, self.stcls.c) + self.parser.model.set_featuresC(&self.eg.c, self.stcls.c) self.parser.moves.set_valid(self.eg.c.is_valid, self.stcls.c) self.parser.model.set_scoresC(self.eg.c.scores, self.eg.c.features, self.eg.c.nr_feat) diff --git a/spacy/tagger.pyx b/spacy/tagger.pyx index c8968f55d..7903c44fb 100644 --- a/spacy/tagger.pyx +++ b/spacy/tagger.pyx @@ -192,7 +192,7 @@ cdef class Tagger: nr_feat=self.model.nr_feat) for i in range(tokens.length): if tokens.c[i].pos == 0: - self.model.set_featuresC(eg.c, tokens.c, i) + self.model.set_featuresC(&eg.c, tokens.c, i) self.model.set_scoresC(eg.c.scores, eg.c.features, eg.c.nr_feat) guess = VecVec.arg_max_if_true(eg.c.scores, eg.c.is_valid, eg.c.nr_class) @@ -244,11 +244,11 @@ cdef class Tagger: nr_class=self.vocab.morphology.n_tags, nr_feat=self.model.nr_feat) for i in range(tokens.length): - self.model.set_featuresC(eg.c, tokens.c, i) + self.model.set_featuresC(&eg.c, tokens.c, i) eg.costs = [ 1 if golds[i] not in (c, -1) else 0 for c in xrange(eg.nr_class) ] self.model.set_scoresC(eg.c.scores, eg.c.features, eg.c.nr_feat) - self.model.updateC(eg.c) + self.model.updateC(&eg.c) self.vocab.morphology.assign_tag_id(&tokens.c[i], eg.guess)