aphp / edsnlp

Modular, fast NLP framework, compatible with Pytorch and spaCy, offering tailored support for French clinical notes.
https://aphp.github.io/edsnlp/
BSD 3-Clause "New" or "Revised" License
112 stars 29 forks source link

Pseudo negation pattern not catched #245

Closed julienduquesne closed 8 months ago

julienduquesne commented 8 months ago

Description

In the sentence "Le résultat ne permet pas d'exclure un SMD", SMD shouldn't be flagged negative

How to reproduce the bug

import spacy

nlp = spacy.blank("eds")
nlp.add_pipe("eds.sentences")
# Dummy matcher
nlp.add_pipe(
    "eds.matcher",
    config=dict(terms=dict(smd="SMD")),
)
nlp.add_pipe("eds.negation")

text = "Le résultat ne permet pas d'exclure un SMD"

doc = nlp(text)
doc.ents[0]._.negation

returns True

Your Environment

Proposed solution:

Add all combinations of "ne permet pas de" + negation verbs to pseudo patterns (I can do a PR if ok)

percevalw commented 8 months ago

Thank you for reporting this, I've taken the liberty to fix this in #249 and have put you as a co-author to the relevant commit.

julienduquesne commented 8 months ago

Thank you for reporting this, I've taken the liberty to fix this in #249 and have put you as a co-author to the relevant commit.

Thank you !