From 2489dcaccf6fe4551a05804d982408d2899ce70f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 19 Sep 2017 23:42:12 +0200 Subject: [PATCH] Fix serialization of parser --- spacy/syntax/nn_parser.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 532a69b36..52e677390 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -307,6 +307,8 @@ cdef class Parser: cfg['beam_width'] = util.env_opt('beam_width', 1) if 'beam_density' not in cfg: cfg['beam_density'] = util.env_opt('beam_density', 0.0) + if 'pretrained_dims' not in cfg: + cfg['pretrained_dims'] = self.vocab.vectors.data.shape[1] self.cfg = cfg if 'actions' in self.cfg: for action, labels in self.cfg.get('actions', {}).items():