umcu / clinlp

A Python library for performing NLP on clinical text written in Dutch
GNU General Public License v3.0
33 stars 0 forks source link

Allow for concept overlap #78

Closed bramiozo closed 1 month ago

bramiozo commented 2 months ago

Maybe possible to allow for concept overlap? Ostensibly it is just the following

In clinlp.entity

class EntityMatcher:
  def __init__(... , allow_overlap: Optional[bool] = _defaults_clinlp_ner["overlap"])
          self.term_args = {... "overlap": allow_overlap}
  ...

  def __call__()
          if self.term_args['overlap']==False:
            ents = self._resolve_ents_overlap(ents)
bramiozo commented 2 months ago

@vmenger, deze tackle ik tegelijk met dit/deze issue: https://github.com/umcu/clinlp/issues/67

vmenger commented 2 months ago

@bramiozo That line _resolve_ents_overlap is there by the way to make sure spaCy does not raise any errors when overlap occurs, because entities are not allowed to overlap in spaCy. If we want overlap (I think we maybe do), we would need to start using spans rather than entities. We can also work together on it if you like

See also: #65 and #36