diff --git a/spacy/ner/context.pxd b/spacy/ner/context.pxd index f9280c516..c12ecc041 100644 --- a/spacy/ner/context.pxd +++ b/spacy/ner/context.pxd @@ -133,6 +133,8 @@ cpdef enum: N2_pos N2_sense + E_label + E0_sic E0_cluster E0_pos diff --git a/spacy/ner/context.pyx b/spacy/ner/context.pyx index c062bb098..c22685dfd 100644 --- a/spacy/ner/context.pyx +++ b/spacy/ner/context.pyx @@ -63,6 +63,7 @@ cdef int fill_context(atom_t* context, State* s, Tokens tokens) except -1: cdef atom_t[5] ent_vals if entity_is_open(s): + context[E_label] = s.curr.label context[E0_sic] = tokens.lex[s.curr.start].sic context[E0_cluster] = tokens.lex[s.curr.start].cluster context[E0_pos] = tokens.pos[s.curr.start] diff --git a/spacy/ner/feats.pyx b/spacy/ner/feats.pyx index 60910f235..f5335919e 100644 --- a/spacy/ner/feats.pyx +++ b/spacy/ner/feats.pyx @@ -93,6 +93,14 @@ STATE = ( (E0_sic, E1_pos,), (E0_pos, E1_sic,), (E0_pos, E1_pos), + + (E_label,), + (E_label, W_sic), + (E_label, W_pos), + (E_label, W_cluster), + (E_label, E0_sic, W_sic), + (E_label, E0_pos, W_pos), + (E_label, E0_cluster, W_pos) )