* Add ne_iob and ne_type attributes to context vector

This commit is contained in:
Matthew Honnibal 2015-04-10 05:02:15 +02:00
parent 8c354c432b
commit 4df8a3d90f
2 changed files with 40 additions and 0 deletions

View File

@ -32,6 +32,8 @@ cpdef enum:
S2_prefix S2_prefix
S2_suffix S2_suffix
S2_shape S2_shape
S2_ne_iob
S2_ne_type
S1w S1w
S1W S1W
@ -43,6 +45,8 @@ cpdef enum:
S1_prefix S1_prefix
S1_suffix S1_suffix
S1_shape S1_shape
S1_ne_iob
S1_ne_type
S1rw S1rw
S1rW S1rW
@ -54,6 +58,8 @@ cpdef enum:
S1r_prefix S1r_prefix
S1r_suffix S1r_suffix
S1r_shape S1r_shape
S1r_ne_iob
S1r_ne_type
S0lw S0lw
S0lW S0lW
@ -65,6 +71,8 @@ cpdef enum:
S0l_prefix S0l_prefix
S0l_suffix S0l_suffix
S0l_shape S0l_shape
S0l_ne_iob
S0l_ne_type
S0l2w S0l2w
S0l2W S0l2W
@ -76,6 +84,8 @@ cpdef enum:
S0l2_prefix S0l2_prefix
S0l2_suffix S0l2_suffix
S0l2_shape S0l2_shape
S0l2_ne_iob
S0l2_ne_type
S0w S0w
S0W S0W
@ -87,6 +97,8 @@ cpdef enum:
S0_prefix S0_prefix
S0_suffix S0_suffix
S0_shape S0_shape
S0_ne_iob
S0_ne_type
S0r2w S0r2w
S0r2W S0r2W
@ -98,6 +110,8 @@ cpdef enum:
S0r2_prefix S0r2_prefix
S0r2_suffix S0r2_suffix
S0r2_shape S0r2_shape
S0r2_ne_iob
S0r2_ne_type
S0rw S0rw
S0rW S0rW
@ -109,6 +123,8 @@ cpdef enum:
S0r_prefix S0r_prefix
S0r_suffix S0r_suffix
S0r_shape S0r_shape
S0r_ne_iob
S0r_ne_type
N0l2w N0l2w
N0l2W N0l2W
@ -120,6 +136,8 @@ cpdef enum:
N0l2_prefix N0l2_prefix
N0l2_suffix N0l2_suffix
N0l2_shape N0l2_shape
N0l2_ne_iob
N0l2_ne_type
N0lw N0lw
N0lW N0lW
@ -131,6 +149,8 @@ cpdef enum:
N0l_prefix N0l_prefix
N0l_suffix N0l_suffix
N0l_shape N0l_shape
N0l_ne_iob
N0l_ne_type
N0w N0w
N0W N0W
@ -142,6 +162,8 @@ cpdef enum:
N0_prefix N0_prefix
N0_suffix N0_suffix
N0_shape N0_shape
N0_ne_iob
N0_ne_type
N1w N1w
N1W N1W
@ -153,6 +175,8 @@ cpdef enum:
N1_prefix N1_prefix
N1_suffix N1_suffix
N1_shape N1_shape
N1_ne_iob
N1_ne_type
N2w N2w
N2W N2W
@ -164,6 +188,8 @@ cpdef enum:
N2_prefix N2_prefix
N2_suffix N2_suffix
N2_shape N2_shape
N2_ne_iob
N2_ne_type
P1w P1w
P1W P1W
@ -175,6 +201,8 @@ cpdef enum:
P1_prefix P1_prefix
P1_suffix P1_suffix
P1_shape P1_shape
P1_ne_iob
P1_ne_type
P2w P2w
P2W P2W
@ -186,6 +214,8 @@ cpdef enum:
P2_prefix P2_prefix
P2_suffix P2_suffix
P2_shape P2_shape
P2_ne_iob
P2_ne_type
E0w E0w
E0W E0W
@ -197,6 +227,8 @@ cpdef enum:
E0_prefix E0_prefix
E0_suffix E0_suffix
E0_shape E0_shape
E0_ne_iob
E0_ne_type
E1w E1w
E1W E1W
@ -208,6 +240,8 @@ cpdef enum:
E1_prefix E1_prefix
E1_suffix E1_suffix
E1_shape E1_shape
E1_ne_iob
E1_ne_type
# Misc features at the end # Misc features at the end
dist dist
@ -221,4 +255,6 @@ cpdef enum:
S1_has_head S1_has_head
S2_has_head S2_has_head
ent_type
CONTEXT_SIZE CONTEXT_SIZE

View File

@ -32,6 +32,8 @@ cdef inline void fill_token(atom_t* context, const TokenC* token) nogil:
context[7] = 0 context[7] = 0
context[8] = 0 context[8] = 0
context[9] = 0 context[9] = 0
context[10] = 0
context[11] = 0
else: else:
context[0] = token.lex.orth context[0] = token.lex.orth
context[1] = token.lemma context[1] = token.lemma
@ -55,6 +57,8 @@ cdef inline void fill_token(atom_t* context, const TokenC* token) nogil:
context[7] = token.lex.prefix context[7] = token.lex.prefix
context[8] = token.lex.suffix context[8] = token.lex.suffix
context[9] = token.lex.shape context[9] = token.lex.shape
context[10] = token.ent_iob
context[11] = token.ent_type
cdef int fill_context(atom_t* context, State* state) except -1: cdef int fill_context(atom_t* context, State* state) except -1: