2014-11-04 13:37:59 +00:00
|
|
|
from cymem.cymem cimport Pool
|
|
|
|
|
|
|
|
from thinc.learner cimport LinearModel
|
|
|
|
from thinc.features cimport Extractor
|
|
|
|
from thinc.typedefs cimport atom_t, feat_t, weight_t, class_t
|
|
|
|
|
2014-11-05 09:45:29 +00:00
|
|
|
from .typedefs cimport hash_t
|
|
|
|
from .context cimport Slots
|
2014-11-04 13:37:59 +00:00
|
|
|
from .tokens cimport Tokens
|
|
|
|
|
|
|
|
|
2014-11-04 16:42:14 +00:00
|
|
|
cpdef enum TagType:
|
2014-11-04 13:37:59 +00:00
|
|
|
POS
|
|
|
|
ENTITY
|
|
|
|
SENSE
|
|
|
|
|
|
|
|
|
|
|
|
cdef class Tagger:
|
|
|
|
cpdef int set_tags(self, Tokens tokens) except -1
|
|
|
|
cpdef class_t predict(self, int i, Tokens tokens) except 0
|
2014-11-09 04:18:33 +00:00
|
|
|
cpdef int tell_answer(self, list gold) except -1
|
2014-11-04 13:37:59 +00:00
|
|
|
|
|
|
|
cpdef readonly Pool mem
|
|
|
|
cpdef readonly Extractor extractor
|
|
|
|
cpdef readonly LinearModel model
|
|
|
|
|
|
|
|
cpdef readonly TagType tag_type
|
|
|
|
cpdef readonly list tag_names
|
|
|
|
|
|
|
|
cdef class_t _guess
|
2014-11-09 04:43:07 +00:00
|
|
|
cdef atom_t* _context
|
2014-11-04 13:37:59 +00:00
|
|
|
cdef feat_t* _feats
|
|
|
|
cdef weight_t* _values
|
|
|
|
cdef weight_t* _scores
|