Skip to content

etienneguevel/BioMedics

Repository files navigation

Documentation Black Poetry DVC

EDS-Medic

EDS-Medic is a project used at APHP to extract drug prescriptions from clinical reports. It is built on top of edsnlp and spaCy.

Installation

pip install eds-medic

# To use with a GPU, you will need to specify your version of CUDA
pip install 'eds-medic[cuda110]'

Loading the model

import eds_medic

nlp = eds_medic.load()
# add components to the model and/or run it on documents

Training a model

We created a single workflow that:

  • Converts the datasets from JSONL or BRAT files to spaCy format
  • Trains the pipeline
  • Evaluates the pipeline using the test set
  • Packages the resulting model to make it pip-installable

To use it, you will need to supply:

  • A labelled dataset
  • A HuggingFace transformers model, or use camembert-base

In any case, you will need to modify the configuration to reflect these changes.

Entities and attributes

The default model is trained to recognize the following entities:

Entity Description
drug the drug name
class a active substance class
dose the dose of the drug
frequency a frequency for the drug intake
criteria a criteria for the drug intake
duration how long the prescription is valid
route the route of the drug intake

And extract the following attributes:

Attribute Description Entities
ent._.event_type the event type drug, class, date

Commands

Command Description
convert Convert data to spaCy's binary format
train Train the NER model
evaluate Evaluate the model and export metrics
package Package the trained model as a pip package
visualize-model Visualize the model's output interactively using Streamlit

Run the command with

spacy project run [command] [options]

Documentation

Visit the documentation for more information!

Acknowledgement

We would like to thank Assistance Publique – Hôpitaux de Paris and AP-HP Foundation for funding this project.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published