From 7d5c720fc30dff05f2f0da813de088e3f5238778 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 15 Feb 2018 23:50:21 +0100 Subject: [PATCH] Fix multitask objective when no pipeline provided --- spacy/syntax/nn_parser.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index f192e3b96..a4647c159 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -835,7 +835,8 @@ cdef class Parser: sgd = self.create_optimizer() self.model[1].begin_training( self.model[1].ops.allocate((5, cfg['token_vector_width']))) - self.init_multitask_objectives(gold_tuples, pipeline, sgd=sgd, **cfg) + if pipeline is not None: + self.init_multitask_objectives(gold_tuples, pipeline, sgd=sgd, **cfg) link_vectors_to_models(self.vocab) else: if sgd is None: