edsnlp icon indicating copy to clipboard operation
edsnlp copied to clipboard

Discussion: Improve the Contextual Matcher

Open aricohen93 opened this issue 3 years ago • 0 comments

Draft

Starting example:

When looking for ADICAP codes, some notes showed multiples codes:

"adicap : OHGSA7B1, OHGSA7B3"

Using he ContextualMatcher as of today, only the last code will be retrieved.

Proposition

Maybe a replace option in the assing dictionary might be useful:

  • One assign key can have the replace option.
  • In this case, those assigned spans will become the new entity.ies
  • Other assigned value will be "transfered" to those entities. We might see the case were multiple assign values (from the same key) have to be transfered. In this case:
    • Either all values are transfered as a list
    • Or a single one is transfered (controlled via a parameter like reduce_mode)

Examples

"Le patient a un diabète insulinorequérent de type I et II"

No replace, no expand, reduce_mode=None

replace expand reduce_mode
False False False

| Entity | Assign value | |diabète| type=[I, II] |

aricohen93 avatar Aug 31 '22 15:08 aricohen93