You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

clinlp

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clinlp

Performant and production-ready NLP pipelines for clinical text written in Dutch

0.9.4
pipPyPI
Maintainers
1

clinlp

test docs pypi version pypi python versions license made with spaCy ruff

clinlp

  • :hospital: clinical + :netherlands: nl + :clipboard: NLP = :sparkles: clinlp
  • :star: NLP tools and algorithms for clinical text written in Dutch
  • :triangular_ruler: Organized in a standardized but flexible framework using spaCy
  • :rocket: Production-ready, performant, well-tested and easy to use
  • :bulb: Free, open source, created and maintained by the Dutch Clinical NLP community

Contact

If you have questions, need help getting started, found a bug, or have a feature request, please don't hesitate to contact us!

Getting started

Installation

pip install clinlp

Example

import spacy
from clinlp.ie import Term

nlp = spacy.blank("clinlp")

# Normalization
nlp.add_pipe("clinlp_normalizer")

# Sentences
nlp.add_pipe("clinlp_sentencizer")

# Entities
terms = {
    "prematuriteit": [
        "preterm", "<p3", "prematuriteit", "partus praematurus"
    ],
    "hypotensie": [
        "hypotensie", Term("bd verlaagd", proximity=1)
    ],
    "veneus_infarct": [
        "veneus infarct", Term("VI", attr="TEXT")
    ]
}

entity_matcher = nlp.add_pipe("clinlp_rule_based_entity_matcher", config={"attr": "NORM", "fuzzy": 1})
entity_matcher.add_terms_from_dict(terms)

# Qualifiers
nlp.add_pipe("clinlp_context_algorithm", config={"phrase_matcher_attr": "NORM"})

text = (
    "Preterme neonaat (<p3) opgenomen, bd enigszins verlaagd, familieanamnese vermeldt eveneens hypotensie "
    "bij moeder. Thans geen aanwijzingen voor veneus infarkt wat ook geen "
    "verklaring voor de partus prematurus is. Risico op VI blijft aanwezig."
)

doc = nlp(text)

Find information in the Doc object:

from spacy import displacy

displacy.render(doc, style="span", options={'spans_key': 'ents'})

example_doc_render.png

With relevant qualifiers (defaults omitted for readability):

for ent in doc.spans["ents"]:
  print(ent, ent._.qualifiers_str)
  • Preterme set()
  • <p3 set()
  • bd enigszins verlaagd set()
  • hypotensie {'Experiencer.Family'}
  • veneus infarkt {'Presence.Absent'}
  • partus prematurus set()
  • VI {'Temporality.Future'}

Documentation

The full documentation can be found at https://clinlp.readthedocs.io.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts