From c27c82d5f9704a45ada92092a3fe7462992ec42b Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 8 Nov 2017 13:08:48 +0100 Subject: [PATCH] Fix serialization --- spacy/pipeline.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index daa08931e..3890e2422 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -533,7 +533,7 @@ class Tagger(Pipe): serialize['model'] = self.model.to_bytes serialize['vocab'] = self.vocab.to_bytes - tag_map = OrderedDict(sorted(self.vocab.morphology.item())) + tag_map = OrderedDict(sorted(self.vocab.morphology.tag_map.items())) serialize['tag_map'] = lambda: msgpack.dumps( tag_map, use_bin_type=True, encoding='utf8') return util.to_bytes(serialize, exclude) @@ -566,7 +566,7 @@ class Tagger(Pipe): def to_disk(self, path, **exclude): self.cfg['pretrained_dims'] = self.vocab.vectors.data.shape[1] - tag_map = OrderedDict(sorted(self.vocab.morphology.item())) + tag_map = OrderedDict(sorted(self.vocab.morphology.tag_map.items())) serialize = OrderedDict(( ('vocab', lambda p: self.vocab.to_disk(p)), ('tag_map', lambda p: p.open('wb').write(msgpack.dumps(