Remove use of hash function in beam parser

This commit is contained in:
Matthew Honnibal 2017-08-15 03:13:57 -05:00
parent 60d8111245
commit e420e0366c
2 changed files with 2 additions and 6 deletions

View File

@ -86,11 +86,7 @@ cdef class ParserBeam(object):
self._set_scores(beam, scores[i])
if self.golds is not None:
self._set_costs(beam, self.golds[i], follow_gold=follow_gold)
if follow_gold:
assert self.golds is not None
beam.advance(_transition_state, NULL, <void*>self.moves.c)
else:
beam.advance(_transition_state, _hash_state, <void*>self.moves.c)
beam.advance(_transition_state, NULL, <void*>self.moves.c)
beam.check_done(_check_final_state, NULL)
if beam.is_done:
for j in range(beam.size):

View File

@ -471,7 +471,7 @@ cdef class Parser:
for k in range(nr_class):
beam.scores[i][k] = c_scores[j * scores.shape[1] + k]
j += 1
beam.advance(_transition_state, _hash_state, <void*>self.moves.c)
beam.advance(_transition_state, NULL, <void*>self.moves.c)
beam.check_done(_check_final_state, NULL)
beams.append(beam)
return beams