diff --git a/spacy/en/pos.pyx b/spacy/en/pos.pyx index f882e3f28..fd6d468a9 100644 --- a/spacy/en/pos.pyx +++ b/spacy/en/pos.pyx @@ -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 diff --git a/spacy/syntax/parser.pyx b/spacy/syntax/parser.pyx index 0f96e46d9..33e4af179 100644 --- a/spacy/syntax/parser.pyx +++ b/spacy/syntax/parser.pyx @@ -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,