Only check component in factories if string (see #1911)

This commit is contained in:
ines 2018-01-30 16:29:07 +01:00
parent ce10d320c4
commit 4046823699
1 changed files with 1 additions and 1 deletions

View File

@ -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))