mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
* Fiddle with const correctness and comments
This commit is contained in:
parent
b031c7c430
commit
c20dd79748
|
@ -9,7 +9,7 @@ from .tokens cimport Tokens
|
||||||
|
|
||||||
|
|
||||||
cdef class Tagger:
|
cdef class Tagger:
|
||||||
cdef class_t predict(self, atom_t* context, object golds=*) except *
|
cdef class_t predict(self, const atom_t* context, object golds=*) except *
|
||||||
|
|
||||||
cpdef readonly Pool mem
|
cpdef readonly Pool mem
|
||||||
cpdef readonly Extractor extractor
|
cpdef readonly Extractor extractor
|
||||||
|
|
|
@ -26,8 +26,8 @@ def setup_model_dir(tag_names, tag_counts, templates, model_dir):
|
||||||
|
|
||||||
|
|
||||||
cdef class Tagger:
|
cdef class Tagger:
|
||||||
"""Assign part-of-speech, named entity or supersense tags, using greedy
|
"""Predict some type of tag, using greedy decoding. The tagger reads its
|
||||||
decoding. The tagger reads its model and configuration from disk.
|
model and configuration from disk.
|
||||||
"""
|
"""
|
||||||
def __init__(self, model_dir):
|
def __init__(self, model_dir):
|
||||||
self.mem = Pool()
|
self.mem = Pool()
|
||||||
|
@ -40,7 +40,7 @@ cdef class Tagger:
|
||||||
if path.exists(path.join(model_dir, 'model')):
|
if path.exists(path.join(model_dir, 'model')):
|
||||||
self.model.load(path.join(model_dir, 'model'))
|
self.model.load(path.join(model_dir, 'model'))
|
||||||
|
|
||||||
cdef class_t predict(self, atom_t* context, object golds=None) except *:
|
cdef class_t predict(self, const atom_t* context, object golds=None) except *:
|
||||||
"""Predict the tag of tokens[i]. The tagger remembers the features and
|
"""Predict the tag of tokens[i]. The tagger remembers the features and
|
||||||
prediction, in case you later call tell_answer.
|
prediction, in case you later call tell_answer.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user