2016-02-15 16:40:28 +03:00
|
|
|
from thinc.neural.nn cimport NeuralNet
|
2016-01-29 05:58:55 +03:00
|
|
|
from thinc.extra.eg cimport Example
|
|
|
|
from thinc.structs cimport ExampleC
|
2015-11-06 19:24:30 +03:00
|
|
|
|
2015-08-27 10:16:11 +03:00
|
|
|
from .structs cimport TokenC
|
2015-08-26 20:19:21 +03:00
|
|
|
from .vocab cimport Vocab
|
2015-08-24 06:25:55 +03:00
|
|
|
|
|
|
|
|
2016-02-15 16:40:28 +03:00
|
|
|
cdef class TaggerNeuralNet(NeuralNet):
|
2016-01-29 05:58:55 +03:00
|
|
|
cdef void set_featuresC(self, ExampleC* eg, const TokenC* tokens, int i) except *
|
2015-11-06 19:24:30 +03:00
|
|
|
|
2016-02-15 16:40:28 +03:00
|
|
|
cdef class CharacterTagger(NeuralNet):
|
2016-02-24 20:20:47 +03:00
|
|
|
cdef readonly int depth
|
|
|
|
cdef readonly int hidden_width
|
|
|
|
cdef readonly int chars_width
|
|
|
|
cdef readonly int tags_width
|
|
|
|
cdef readonly float learn_rate
|
|
|
|
cdef readonly int left_window
|
|
|
|
cdef readonly int right_window
|
|
|
|
cdef readonly int tags_window
|
|
|
|
cdef readonly int chars_per_word
|
2016-02-15 16:40:28 +03:00
|
|
|
cdef void set_featuresC(self, ExampleC* eg, const TokenC* tokens, object strings, int i) except *
|
2015-11-06 19:24:30 +03:00
|
|
|
|
2015-08-24 06:25:55 +03:00
|
|
|
cdef class Tagger:
|
2015-08-26 20:19:21 +03:00
|
|
|
cdef readonly Vocab vocab
|
2016-02-15 16:40:28 +03:00
|
|
|
cdef readonly CharacterTagger model
|
2015-08-24 06:25:55 +03:00
|
|
|
cdef public dict freqs
|