mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 02:06:31 +03:00
* Hack on l/r reversal bug
This commit is contained in:
parent
6116413b47
commit
bf38b3b883
|
@ -175,7 +175,8 @@ cdef class StepwiseState:
|
|||
moves = {'S': 0, 'D': 1, 'L': 2, 'R': 3}
|
||||
if action_name == '_':
|
||||
action_name = self.predict()
|
||||
if action_name == 'L' or action_name == 'R':
|
||||
action = self.parser.moves.lookup_transition(action_name)
|
||||
elif action_name == 'L' or action_name == 'R':
|
||||
self.predict()
|
||||
move = moves[action_name]
|
||||
clas = _arg_max_clas(self.eg.c.scores, move, self.parser.moves.c,
|
||||
|
@ -198,6 +199,6 @@ cdef int _arg_max_clas(const weight_t* scores, int move, const Transition* actio
|
|||
cdef int i
|
||||
for i in range(nr_class):
|
||||
if actions[i].move == move and (mode == -1 or scores[i] >= score):
|
||||
mode = actions[i].clas
|
||||
mode = i
|
||||
score = scores[i]
|
||||
return mode
|
||||
|
|
Loading…
Reference in New Issue
Block a user