Skip to main content

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

Project description

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
concepts = {
    "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.load_concepts(concepts)

# 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.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clinlp-0.8.1.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

clinlp-0.8.1-py3-none-any.whl (48.5 kB view details)

Uploaded Python 3

File details

Details for the file clinlp-0.8.1.tar.gz.

File metadata

  • Download URL: clinlp-0.8.1.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1022-azure

File hashes

Hashes for clinlp-0.8.1.tar.gz
Algorithm Hash digest
SHA256 1058f979ec19ab43c2831ee1b149886cbde0aa777a75460a3b23301719e4abd1
MD5 dd50caa224c84636d893cd155aa07083
BLAKE2b-256 ce2680c95882f023cd48f441e7d5945630d5ba68f31ef8651415579594b1c3b1

See more details on using hashes here.

File details

Details for the file clinlp-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: clinlp-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 48.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1022-azure

File hashes

Hashes for clinlp-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f3ce12b5204c6e0db5d67d9eacfe3ae2cb03db2bb88e90fef4d1b76a34b97bc
MD5 6615ef55f3240ba5eb70a498b8ae684a
BLAKE2b-256 cf89f262456ddef8ac51db5fdd83aa393864bd0dce90c0736f5d6ae55fcdaac7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page