- Big thanks to lcreteig for pull request 20, which allows a user to update the extension name, thus being able to use multiple instances of negspacy in a pipeline:
python
negex = Negex(nlp, extension_name="myownname")
- Small modifications to make it easier to users to add or remove patterns on the fly:
python
nlp = spacy.load("en_core_web_sm")
negex = Negex(nlp)
patterns = negex.get_patterns()
negex.add_patterns(
pseudo_negations=["my favorite pattern"],
termination=["these are", "great patterns"],
preceding_negations=["wow a negation"],
following_negations=["extra negation"],
)
negex.remove_patterns(termination = "but", preceding_negations=["wow a negation"])