Skip to content

Getting started

EDS-NLP provides a set of spaCy components that are used to extract information from clinical notes written in French.

If it's your first time with spaCy, we recommend you familiarise yourself with some of their key concepts by looking at the "spaCy 101" page.

Quick start

Installation

You can install EDS-NLP via pip:

fast →pip install edsnlpSuccessfully installed!

restart ↻

We recommend pinning the library version in your projects, or use a strict package manager like Poetry.

pip install edsnlp==0.8.0

A first pipeline

Once you've installed the library, let's begin with a very simple example that extracts mentions of COVID19 in a text, and detects whether they are negated.

import spacy

nlp = spacy.blank("fr")  # 

terms = dict(
    covid=["covid", "coronavirus"],  # 
)

# Sentencizer component, needed for negation detection
nlp.add_pipe("eds.sentences")  # 
# Matcher component
nlp.add_pipe("eds.matcher", config=dict(terms=terms))  # 
# Negation detection
nlp.add_pipe("eds.negation")

# Process your text in one call !
doc = nlp("Le patient est atteint de covid")

doc.ents  # 
# Out: (covid,)

doc.ents[0]._.negation  # 
# Out: False

This example is complete, it should run as-is. Check out the spaCy 101 page if you're not familiar with spaCy.

Available pipeline components

Pipeline Description
eds.normalizer Non-destructive input text normalisation
eds.sentences Better sentence boundary detection
eds.matcher A simple yet powerful entity extractor
eds.terminology A simple yet powerful terminology matcher
eds.contextual-matcher A conditional entity extractor
eds.endlines An unsupervised model to classify each end line
Pipeline Description
eds.negation Rule-based negation detection
eds.family Rule-based family context detection
eds.hypothesis Rule-based speculation detection
eds.reported_speech Rule-based reported speech detection
eds.history Rule-based medical history detection
Pipeline Description
eds.dates Date extraction and normalisation
eds.consultation_dates Identify consultation dates
eds.measurements Measure extraction and normalisation
eds.sections Section detection
eds.reason Rule-based hospitalisation reason detection
eds.tables Tables detection
Pipeline Description
eds.covid A COVID mentions detector
eds.charlson A Charlson score extractor
eds.sofa A SOFA score extractor
eds.emergency.priority A priority score extractor
eds.emergency.ccmu A CCMU score extractor
eds.emergency.gemsa A GEMSA score extractor
eds.TNM A TNM score extractor
eds.cim10 A CIM10 terminology matcher
eds.drugs A Drug mentions extractor
eds.adicap A ADICAP codes extractor
eds.umls A UMLS terminology matcher
Pipeline Description
eds.nested-ner Nested and overlapping named entity recogntion
eds.span-qualifier A trainable component for multi-class multi-label span qualification

Disclaimer

The performances of an extraction pipeline may depend on the population and documents that are considered.

Contributing to EDS-NLP

We welcome contributions ! Fork the project and propose a pull request. Take a look at the dedicated page for detail.

Citation

If you use EDS-NLP, please cite us as below.

@misc{edsnlp,
  author = {Dura, Basile and Wajsburt, Perceval and Petit-Jean, Thomas and Cohen, Ariel and Jean, Charline and Bey, Romain},
  doi    = {10.5281/zenodo.6424993},
  title  = {EDS-NLP: efficient information extraction from French clinical notes},
  url    = {http://aphp.github.io/edsnlp}
}