negspacy
negspacy copied to clipboard
Tagging 'possible' terms
Is your feature request related to a problem? Please describe. An additional functionality of tagging terms as 'possible': It's a feature in one of the original negex implementations as well as in pyConTextNLP. Also, some important negation corpora include such annotation (i.e. speculated/possible terms).
Describe the solution you'd like An example could like this:
doc = nlp("breast cancer may be ruled out")
for e in doc.ents:
print(e.text, e._.negex)
Output:
breast cancer possible
- Obviously, this would require adjusting the return value of
e._.negexto be type of i.e. string instead of bool. - This implementation could help when considering the logic behind this feature. In case, anyone wanna run this negex with
possibletagging enabled, check this issue here. - The "possible" pre and post triggers ([PREP] and [POSP]) can be also added easily from the the same implementation's
negex_triggers.txtfile.
Describe alternatives you've considered None other than using this mentioned negex code separately (combined with spacy, without negspacy).
Additional context I can refer to the README as well as negex.py files in here. I imagine, step 2. is the only one that would require more work and having good understanding of negspacy.