From 404682369986262ee6975e7341a2ec01c8151c7c Mon Sep 17 00:00:00 2001 From: ines Date: Tue, 30 Jan 2018 16:29:07 +0100 Subject: [PATCH] Only check component in factories if string (see #1911) --- spacy/language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 1a60b2542..ae62f918a 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -239,7 +239,7 @@ class Language(object): if not hasattr(component, '__call__'): msg = ("Not a valid pipeline component. Expected callable, but " "got {}. ".format(repr(component))) - if component in self.factories: + if isinstance(component, basestring_) and component in self.factories: msg += ("If you meant to add a built-in component, use " "create_pipe: nlp.add_pipe(nlp.create_pipe('{}'))" .format(component))