2014-12-08 10:12:15 +00:00
|
|
|
from libc.stdint cimport uint8_t
|
|
|
|
|
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-12-08 10:12:15 +00:00
|
|
|
from preshed.maps cimport PreshMapArray
|
|
|
|
|
2014-11-05 09:45:29 +00:00
|
|
|
from .typedefs cimport hash_t
|
2014-12-08 10:12:15 +00:00
|
|
|
from .tokens cimport Tokens, Morphology
|
|
|
|
|
|
|
|
|
|
|
|
# Google universal tag set
|
|
|
|
cdef enum univ_tag_t:
|
|
|
|
NO_TAG
|
|
|
|
ADJ
|
|
|
|
ADV
|
|
|
|
ADP
|
|
|
|
CONJ
|
|
|
|
DET
|
|
|
|
NOUN
|
|
|
|
NUM
|
|
|
|
PRON
|
|
|
|
PRT
|
|
|
|
VERB
|
|
|
|
X
|
|
|
|
PUNCT
|
|
|
|
EOL
|
|
|
|
N_UNIV_TAGS
|
|
|
|
|
|
|
|
|
|
|
|
cdef struct PosTag:
|
|
|
|
Morphology morph
|
|
|
|
int id
|
|
|
|
univ_tag_t pos
|
2014-11-04 13:37:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
cdef class Tagger:
|
2014-12-07 13:03:55 +00:00
|
|
|
cdef class_t predict(self, const atom_t* context, object golds=*) except *
|
2014-11-04 13:37:59 +00:00
|
|
|
|
|
|
|
cpdef readonly Pool mem
|
|
|
|
cpdef readonly Extractor extractor
|
|
|
|
cpdef readonly LinearModel model
|
|
|
|
|
|
|
|
cpdef readonly list tag_names
|
2014-12-08 10:12:15 +00:00
|
|
|
cdef PosTag* tags
|
2014-12-07 11:07:16 +00:00
|
|
|
cdef dict tagdict
|