Currently it is not possible to add a second instance of NegEx to a spaCy pipeline, as this would simply overwrite the registered "negex" extension from the first instance:
My use case is similar: I also wanted to detect other context-based modifiers (e.g. speculations), while keeping them separate from the detected negations. This works now for my use case, and the default behavior is unchanged. But I'm not sure this is exactly what you had in mind, or whether you'd like to add this to negspacy at all, so please feel free to disregard or (request me to) make further changes.
Currently it is not possible to add a second instance of NegEx to a spaCy pipeline, as this would simply overwrite the registered "negex" extension from the first instance:
This PR makes it possible to set the name of the extension (while keeping the default of "negex"). This solution was proposed here: https://github.com/jenojp/negspacy/issues/17#issuecomment-661018290.
My use case is similar: I also wanted to detect other context-based modifiers (e.g. speculations), while keeping them separate from the detected negations. This works now for my use case, and the default behavior is unchanged. But I'm not sure this is exactly what you had in mind, or whether you'd like to add this to negspacy at all, so please feel free to disregard or (request me to) make further changes.