mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
* Fix rule that made Last action invalid if there was a preset of O, since if the entity is already open, that ship has sailed.
This commit is contained in:
parent
f9d20b1318
commit
e92371bb54
|
@ -256,12 +256,8 @@ cdef class In:
|
|||
cdef class Last:
|
||||
@staticmethod
|
||||
cdef bint is_valid(StateClass st, int label) nogil:
|
||||
cdef int preset_ent_iob = st.B_(0).ent_iob
|
||||
if preset_ent_iob == 2:
|
||||
if st.B_(1).ent_iob == 1:
|
||||
return False
|
||||
elif st.B_(1).ent_iob == 1:
|
||||
return False
|
||||
|
||||
return st.entity_is_open() and label != 0 and st.E_(0).ent_type == label
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in New Issue
Block a user