mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +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:
|
cdef class Last:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
cdef bint is_valid(StateClass st, int label) nogil:
|
cdef bint is_valid(StateClass st, int label) nogil:
|
||||||
cdef int preset_ent_iob = st.B_(0).ent_iob
|
if st.B_(1).ent_iob == 1:
|
||||||
if preset_ent_iob == 2:
|
|
||||||
return False
|
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
|
return st.entity_is_open() and label != 0 and st.E_(0).ent_type == label
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue
Block a user