From 4eef200bab12ac76e7e1e5ab47bdf0edae3f234e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 20 Apr 2017 17:02:44 +0200 Subject: [PATCH] Persist the actions within spacy.parser.cfg --- spacy/syntax/parser.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/syntax/parser.pyx b/spacy/syntax/parser.pyx index 0bc9cb4ef..4f240d75f 100644 --- a/spacy/syntax/parser.pyx +++ b/spacy/syntax/parser.pyx @@ -174,13 +174,14 @@ cdef class Parser: if TransitionSystem is None: TransitionSystem = self.TransitionSystem self.vocab = vocab - actions = TransitionSystem.get_actions(**cfg) - self.moves = TransitionSystem(vocab.strings, actions) + cfg['actions'] = TransitionSystem.get_actions(**cfg) + self.moves = TransitionSystem(vocab.strings, cfg['actions']) # TODO: Remove this when we no longer need to support old-style models if isinstance(cfg.get('features'), basestring): cfg['features'] = get_templates(cfg['features']) elif 'features' not in cfg: cfg['features'] = self.feature_templates + self.model = ParserModel(cfg['features']) self.model.l1_penalty = cfg.get('L1', 0.0) self.model.learn_rate = cfg.get('learn_rate', 0.001)