From 53d00a037183c780b9d42ff60bb0d033fb7dde80 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 1 Jun 2017 03:04:36 -0500 Subject: [PATCH] Move weight serialization to Thinc --- spacy/pipeline.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index a4d307e64..8e75bf292 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -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)