mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
* Update for modified thinc interface
This commit is contained in:
parent
5dc6cffc67
commit
8a13cebdcc
|
@ -200,7 +200,9 @@ cdef class Parser:
|
|||
action = self.moves.c[eg.guess]
|
||||
action.do(stcls.c, action.label)
|
||||
loss += eg.costs[eg.guess]
|
||||
eg.reset_classes(eg.nr_class)
|
||||
eg.fill_scores(0, eg.nr_class)
|
||||
eg.fill_costs(0, eg.nr_class)
|
||||
eg.fill_is_valid(0, eg.nr_class)
|
||||
return loss
|
||||
|
||||
def step_through(self, Doc doc):
|
||||
|
|
|
@ -209,7 +209,7 @@ cdef class Tagger:
|
|||
eg.c.features, eg.c.nr_feat)
|
||||
guess = VecVec.arg_max_if_true(eg.c.scores, eg.c.is_valid, eg.c.nr_class)
|
||||
self.vocab.morphology.assign_tag(&tokens.c[i], guess)
|
||||
eg.reset_classes(eg.c.nr_class)
|
||||
eg.fill_scores(0, eg.c.nr_class)
|
||||
tokens.is_tagged = True
|
||||
tokens._py_tokens = [None] * tokens.length
|
||||
|
||||
|
@ -244,7 +244,8 @@ cdef class Tagger:
|
|||
|
||||
correct += eg.cost == 0
|
||||
self.freqs[TAG][tokens.c[i].tag] += 1
|
||||
eg.reset_classes(eg.c.nr_class)
|
||||
eg.fill_scores(0, eg.c.nr_class)
|
||||
eg.fill_costs(0, eg.c.nr_class)
|
||||
tokens.is_tagged = True
|
||||
tokens._py_tokens = [None] * tokens.length
|
||||
return correct
|
||||
|
|
Loading…
Reference in New Issue
Block a user