From 8f8f90b46b77d4fce06df6060e2f6d78fa548751 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 4 Jun 2017 20:18:54 -0500 Subject: [PATCH] Disable labeller if not parsing --- spacy/language.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index f4966b106..eefe3b9d4 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -303,7 +303,8 @@ class Language(object): >>> for docs, golds in epoch: >>> state = nlp.update(docs, golds, sgd=optimizer) """ - self.pipeline.append(NeuralLabeller(self.vocab)) + if self.parser: + self.pipeline.append(NeuralLabeller(self.vocab)) # Populate vocab for _, annots_brackets in get_gold_tuples(): for annots, _ in annots_brackets: