Move weight serialization to Thinc

This commit is contained in:
Matthew Honnibal 2017-06-01 03:04:36 -05:00
parent ae8010b526
commit 53d00a0371

View File

@ -279,8 +279,9 @@ class NeuralTagger(object):
else:
new_tag_map[tag] = {POS: X}
cdef Vocab vocab = self.vocab
vocab.morphology = Morphology(vocab.strings, new_tag_map,
vocab.morphology.lemmatizer)
if new_tag_map:
vocab.morphology = Morphology(vocab.strings, new_tag_map,
vocab.morphology.lemmatizer)
token_vector_width = pipeline[0].model.nO
if self.model is True:
self.model = self.Model(self.vocab.morphology.n_tags, token_vector_width)