Skip to content

Commit cef93d3

Browse files
committed
Handle final states in get_oracle_sequence
1 parent a499753 commit cef93d3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spacy/pipeline/_parser_internals/transition_system.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ cdef class TransitionSystem:
8181
return self.get_oracle_sequence_from_state(state, gold)
8282

8383
def get_oracle_sequence_from_state(self, StateClass state, gold, _debug=None):
84+
if state.is_final():
85+
return []
8486
cdef Pool mem = Pool()
8587
# n_moves should not be zero at this point, but make sure to avoid zero-length mem alloc
8688
assert self.n_moves > 0

0 commit comments

Comments
 (0)