diff --git a/spacy/pipeline/entityruler.py b/spacy/pipeline/entityruler.py index 2abff62f1..3385da049 100644 --- a/spacy/pipeline/entityruler.py +++ b/spacy/pipeline/entityruler.py @@ -198,7 +198,11 @@ class EntityRuler(object): # disable the nlp components after this one in case they hadn't been initialized / deserialised yet try: - current_index = self.nlp.pipe_names.index(self.name) + current_index = -1 + for i, (name, pipe) in enumerate(self.nlp.pipeline): + if self == pipe: + current_index = i + break subsequent_pipes = [ pipe for pipe in self.nlp.pipe_names[current_index + 1 :] ]