mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
* Adjust NER rules, so that U entries in gazetteer don't become B moves to the model
This commit is contained in:
parent
6e68b344c1
commit
5623242b3e
|
@ -173,6 +173,10 @@ cdef class Begin:
|
|||
# If the next word is B or O, we can't B now
|
||||
elif st.B_(1).ent_iob == 2 or st.B_(1).ent_iob == 3:
|
||||
return False
|
||||
# If the current word is B, and the next word isn't I, the current word
|
||||
# is really U
|
||||
elif preset_ent_iob == 3 and st.B_(1).ent_iob != 1:
|
||||
return False
|
||||
# Don't allow entities to extend across sentence boundaries
|
||||
elif st.B_(1).sent_start:
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue
Block a user