2014-11-10 05:28:56 +00:00
|
|
|
from cymem.cymem cimport Pool
|
|
|
|
from thinc.features cimport Extractor
|
|
|
|
from thinc.learner cimport LinearModel
|
|
|
|
from thinc.typedefs cimport *
|
|
|
|
|
|
|
|
from ..tokens cimport Tokens
|
|
|
|
from ..typedefs cimport *
|
|
|
|
|
2014-11-12 12:21:09 +00:00
|
|
|
from .structs cimport Move
|
|
|
|
from .annot cimport NERAnnotation
|
2014-11-10 05:28:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
cdef class NERParser:
|
|
|
|
cdef Pool mem
|
|
|
|
cdef Extractor extractor
|
|
|
|
cdef LinearModel model
|
2014-11-11 06:17:54 +00:00
|
|
|
cdef readonly list tag_names
|
2014-11-12 12:21:09 +00:00
|
|
|
cdef readonly list entity_types
|
2014-11-11 06:17:54 +00:00
|
|
|
cdef readonly int n_classes
|
2014-11-10 05:28:56 +00:00
|
|
|
|
|
|
|
cdef Move* _moves
|
|
|
|
cdef atom_t* _context
|
|
|
|
cdef feat_t* _feats
|
|
|
|
cdef weight_t* _values
|
|
|
|
cdef weight_t* _scores
|
|
|
|
|
|
|
|
|
2014-11-12 12:21:09 +00:00
|
|
|
cpdef list train(self, Tokens tokens, NERAnnotation annot)
|
|
|
|
cpdef list set_tags(self, Tokens tokens)
|