Metadata-Version: 2.1
Name: edsnlp
Version: 0.8.0
Summary: A set of spaCy components to extract information from clinical notes written in French
Author-email: Data Science - DSN APHP <perceval.wajsburt-ext@aphp.fr>
License: Copyright 2021 Assistance Publique - Hôpitaux de Paris
        
        Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Source Code, https://github.com/aphp/edsnlp
Project-URL: Documentation, https://aphp.github.io/edsnlp
Project-URL: Demo, https://aphp.github.io/edsnlp/demo
Project-URL: Bug Tracker, https://github.com/aphp/edsnlp/issues
Requires-Python: >=3.7.1
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: decorator
Requires-Dist: loguru
Requires-Dist: pendulum (>=2.1.2)
Requires-Dist: pydantic (<2.0.0,>=1.8.2)
Requires-Dist: pysimstring (>=1.2.1)
Requires-Dist: regex
Requires-Dist: rich (>=12.0.0)
Requires-Dist: scikit-learn (>=1.0.0)
Requires-Dist: spacy (<4.0.0,>=3.1)
Requires-Dist: thinc (>=8.0.14)
Requires-Dist: tqdm
Requires-Dist: umls-downloader (>=0.1.1)
Requires-Dist: typing-extensions (<4.6.0)
Requires-Dist: numpy (<1.23.2,>=1.15.0) ; python_version < "3.8"
Requires-Dist: pandas (<2.0.0,>=1.1.0) ; python_version < "3.8"
Requires-Dist: numpy (>=1.15.0) ; python_version >= "3.8"
Requires-Dist: pandas (<2.0.0,>=1.4.0) ; python_version >= "3.8"
Provides-Extra: dev
Requires-Dist: black (<23.0.0,>=22.3.0) ; extra == 'dev'
Requires-Dist: fastapi ; extra == 'dev'
Requires-Dist: flake8 (==3.9.2) ; extra == 'dev'
Requires-Dist: pyspark ; extra == 'dev'
Requires-Dist: pytest (<8.0.0,>=7.1.0) ; extra == 'dev'
Requires-Dist: pytest-cov (<4.0.0,>=3.0.0) ; extra == 'dev'
Requires-Dist: pytest-html (<4.0.0,>=3.1.1) ; extra == 'dev'
Requires-Dist: torch (<1.13.0,>=1.0.0) ; extra == 'dev'
Requires-Dist: pre-commit (>=2.0.0) ; (python_version < "3.8") and extra == 'dev'
Requires-Dist: koalas (>=1.8.1) ; (python_version <= "3.10") and extra == 'dev'
Requires-Dist: pre-commit (>=2.21.0) ; (python_version >= "3.8") and extra == 'dev'
Provides-Extra: docs
Requires-Dist: mike (==1.1.2) ; extra == 'docs'
Requires-Dist: mkdocs-autorefs (~=0.4.1) ; extra == 'docs'
Requires-Dist: mkdocs-bibtex (==2.8.5) ; extra == 'docs'
Requires-Dist: mkdocs-charts-plugin (==0.0.8) ; extra == 'docs'
Requires-Dist: mkdocs-img2fig-plugin (==0.9.3) ; extra == 'docs'
Requires-Dist: mkdocs-material (~=9.1.0) ; extra == 'docs'
Requires-Dist: mkdocs-section-index (==0.3.4) ; extra == 'docs'
Requires-Dist: mkdocstrings (~=0.21.2) ; extra == 'docs'
Requires-Dist: mkdocstrings-python (~=0.10.1) ; extra == 'docs'
Provides-Extra: setup
Requires-Dist: mlconjug3 (<3.9.0) ; extra == 'setup'
Requires-Dist: typer ; extra == 'setup'

![Tests](https://img.shields.io/github/actions/workflow/status/aphp/edsnlp/tests.yml?branch=master&label=tests&style=flat-square)
[![Documentation](https://img.shields.io/github/actions/workflow/status/aphp/edsnlp/documentation.yml?branch=master&label=docs&style=flat-square)](https://aphp.github.io/edsnlp/latest/)
[![PyPI](https://img.shields.io/pypi/v/edsnlp?color=blue&style=flat-square)](https://pypi.org/project/edsnlp/)
[![Demo](https://img.shields.io/badge/demo%20%F0%9F%9A%80-streamit-grean?style=flat-square)](https://aphp.github.io/edsnlp/demo/)
[![Codecov](https://img.shields.io/codecov/c/github/aphp/edsnlp?logo=codecov&style=flat-square)](https://codecov.io/gh/aphp/edsnlp)
[![DOI](https://zenodo.org/badge/467585436.svg)](https://zenodo.org/badge/latestdoi/467585436)

# EDS-NLP

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

Check out the interactive [demo](https://aphp.github.io/edsnlp/demo/)!

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](https://aphp.github.io/edsnlp/latest/tutorials/spacy101/)" page in the documentation.

## Quick start

### Installation

You can install EDS-NLP via `pip`:

```shell
pip install edsnlp
```

We recommend pinning the library version in your projects, or use a strict package manager like [Poetry](https://python-poetry.org/).

```shell
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.

```python
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
```

## Documentation

Go to the [documentation](https://aphp.github.io/edsnlp) for more information.

## 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](https://aphp.github.io/edsnlp/latest/contributing/) for detail.

## Citation

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

```bibtex
@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}
}
```

## Acknowledgement

We would like to thank [Assistance Publique – Hôpitaux de Paris](https://www.aphp.fr/), [AP-HP Foundation](https://fondationrechercheaphp.fr/) and [Inria](https://www.inria.fr) for funding this project.
