jenojp/negspacy: v0.1.8 pattern modification enhancements, ability to use multiple negspacy instances in a pipeline
Jeno Pizarro, Leon C. Reteig · Zenodo (CERN European Organization for Nuclear Research) · 2020
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: negex = Negex(nlp, extension_name="myownname") Small modifications to make it easier to users to add or remove patterns on the fly: 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"])