mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Fix subsequent pipe detection in EntityRuler
Fix subsequent pipe detection to detect the position of the current object by comparing the component itself rather than from the factory name.
This commit is contained in:
parent
b87793a89a
commit
6c221d4841
|
@ -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 :]
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user