* Add ne_iob and ne_type features to NER

This commit is contained in:
Matthew Honnibal 2015-04-10 19:07:08 +02:00
parent 4df8a3d90f
commit 1d05e6da00
2 changed files with 21 additions and 2 deletions

View File

@ -255,6 +255,4 @@ cpdef enum:
S1_has_head S1_has_head
S2_has_head S2_has_head
ent_type
CONTEXT_SIZE CONTEXT_SIZE

View File

@ -104,6 +104,7 @@ cdef int fill_context(atom_t* context, State* state) except -1:
if state.stack_len >= 3: if state.stack_len >= 3:
context[S2_has_head] = has_head(get_s2(state)) context[S2_has_head] = has_head(get_s2(state))
ner = ( ner = (
(N0W,), (N0W,),
(P1W,), (P1W,),
@ -176,6 +177,26 @@ ner = (
(E0W, E1p,), (E0W, E1p,),
(E0p, E1W,), (E0p, E1W,),
(E0p, E1W), (E0p, E1W),
(P1_ne_iob,),
(P1_ne_iob, P1_ne_type),
(N0w, P1_ne_iob, P1_ne_type),
(N0_shape,),
(N1_shape,),
(N2_shape,),
(P1_shape,),
(P2_shape,),
(N0_prefix,),
(N0_suffix,),
(P1_ne_iob,),
(P2_ne_iob,),
(P1_ne_iob, P2_ne_iob),
(P1_ne_iob, P1_ne_type),
(P2_ne_iob, P2_ne_type),
(N0w, P1_ne_iob, P1_ne_type),
) )