mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
* Clear buffered python tokens when modifying the Tokens object. Need to clean this up, and modify via a method on Tokens.
This commit is contained in:
parent
be5536d239
commit
5c3513583d
|
@ -274,9 +274,11 @@ cdef class EnPosTagger:
|
|||
scores = self.model.score(context)
|
||||
tokens.data[i].tag = arg_max(scores, self.model.n_classes)
|
||||
self.set_morph(i, tokens.data)
|
||||
|
||||
# TODO: Clean this up.
|
||||
tokens._tag_strings = tuple(self.tag_names)
|
||||
assert tokens._tag_strings, self.tag_names
|
||||
tokens.is_tagged = True
|
||||
tokens._py_tokens = [None] * tokens.length
|
||||
|
||||
def train(self, Tokens tokens, object gold_tag_strs):
|
||||
cdef int i
|
||||
|
|
|
@ -87,6 +87,8 @@ cdef class GreedyParser:
|
|||
dep_strings[id_] = label
|
||||
tokens._dep_strings = tuple(dep_strings)
|
||||
tokens.is_parsed = True
|
||||
# TODO: Clean this up.
|
||||
tokens._py_tokens = [None] * tokens.length
|
||||
return 0
|
||||
|
||||
def train_sent(self, Tokens tokens, list gold_heads, list gold_labels,
|
||||
|
|
Loading…
Reference in New Issue
Block a user