* Hack on l/r reversal bug

This commit is contained in:
Matthew Honnibal 2015-08-10 05:58:43 +02:00
parent 6116413b47
commit bf38b3b883

View File

@ -175,7 +175,8 @@ cdef class StepwiseState:
moves = {'S': 0, 'D': 1, 'L': 2, 'R': 3} moves = {'S': 0, 'D': 1, 'L': 2, 'R': 3}
if action_name == '_': if action_name == '_':
action_name = self.predict() 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() self.predict()
move = moves[action_name] move = moves[action_name]
clas = _arg_max_clas(self.eg.c.scores, move, self.parser.moves.c, 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 cdef int i
for i in range(nr_class): for i in range(nr_class):
if actions[i].move == move and (mode == -1 or scores[i] >= score): if actions[i].move == move and (mode == -1 or scores[i] >= score):
mode = actions[i].clas mode = i
score = scores[i] score = scores[i]
return mode return mode