Skip to main content

CleanNote: preprocessing and harmonization of medical notes

Project description

CleanNote

English Français

CI codecov PyPI version License: MIT


English

Back to top

CleanNote analyzes raw medical notes and transforms them into concise, structured documents focused on symptoms, medical conclusions, and treatments, enabling easier analysis and clinical research.

This solution was developed during a research internship at the **** laboratory, and is currently demonstrated using the AGBonnet/Augmented-clinical-notes dataset together with the mistralai/Mistral-7B-Instruct-v0.3 model.

This work was supervised by three people:

  • Ms. ****, company supervisor and associate professor, who proposed the topic of the preprocessing pipeline,

  • Ms. ****, school supervisor and associate professor, who guided me on frugality aspects and formatting,

  • Mr. ****, PhD student, who provided support on identifying adapted solutions and domain knowledge.


Installation

Back to top

First, make sure you are inside your Python virtual environment (e.g. venv).
To install the latest available version (see the PyPI badge above):

 pip install -U cleanote

If you want to install a specific version (for example 0.2.1):

 pip install -U cleanote==0.2.1

The latest released version is always displayed in the PyPI badge at the top of this README.


Usage

Back to top

After installation, you can using CleanNote with just few lines of code:

from cleanote.dataset import Dataset
from cleanote.model import Model
from cleanote.pipeline import Pipeline

# Load a dataset
data = Dataset(name="AGBonnet/Augmented-clinical-notes", split="train", field="full_note", limit=1)

# Load a model
model = Model(name="mistralai/Mistral-7B-Instruct-v0.3", max_new_tokens=512)

# Create pipeline
pipe = Pipeline(dataset=data, model_h=model)

# Run pipeline
out = pipe.apply()

# Display result
print(out.data.head())

# Download the dataset homogenized
xls = pipe.to_excel()  
print(f"Excel file saved to : {xls}")

Literature

Back to top

  • Identification de profils patients à partir de notes cliniques non structurées.
    Corentin Laval, Catherine Combes, Rémi Eyraud, Virginie Fresse.
    PFIA 2025.

Français

Haut de page

CleanNote analyse des notes médicales brutes et les transforme en documents concis et structurés, centrés sur les symptômes, les conclusions médicales et les traitements, afin de faciliter leur analyse et la recherche clinique.

Cette solution a été développée dans le cadre d’un stage de recherche au laboratoire **** , et est actuellement démontrée à l’aide du jeu de données AGBonnet/Augmented-clinical-notes ainsi que du modèle mistralai/Mistral-7B-Instruct-v0.3.

Ce travail a été supervisé par trois personnes :

  • Mme ****, tutrice entreprise et maîtresse de conférences, qui a proposé le sujet du pipeline de prétraitement,

  • Mme ****, tutrice école et maîtresse de conférences, qui m’a encadré sur les aspects de frugalité et de mise en forme,

  • M. ****, doctorant, qui m’a accompagné sur l’identification des solutions adaptées et l’apport de connaissances du domaine.


Installation

Haut de page

Tout d’abord, assurez-vous d’être dans votre environnement virtuel Python (par ex. venv).
Pour installer la dernière version disponible (voir le badge PyPI ci-dessus) :

 pip install -U cleanote

Si vous souhaitez installer une version spécifique (par exemple 0.2.1):

 pip install -U cleanote==0.2.1

La dernière version publiée est toujours affichée dans le badge PyPI en haut de ce README.


Utilisation

Haut de page

Après installation, vous pouvez utiliser CleanNote en seulement quelques lignes de code :

from cleanote.dataset import Dataset
from cleanote.model import Model
from cleanote.pipeline import Pipeline

# Charger un jeu de données
data = Dataset(name="AGBonnet/Augmented-clinical-notes", split="train", field="full_note", limit=1)

# Charger un modèle
model = Model(name="mistralai/Mistral-7B-Instruct-v0.3", max_new_tokens=512)

# Créer le pipeline
pipe = Pipeline(dataset=data, model_h=model)

# Lancer le pipeline
out = pipe.apply()

# Afficher le résultat
print(out.data.head())

# Exporter le jeu de données homogénéisé
xls = pipe.to_excel()  
print(f"Fichier Excel sauvegardé : {xls}")

Références

Haut de page

  • Identification de profils patients à partir de notes cliniques non structurées.
    Corentin Laval, Catherine Combes, Rémi Eyraud, Virginie Fresse.
    PFIA 2025.

License

This project is licensed under the MIT License.

Project details


Release history Release notifications | RSS feed

This version

0.2.7

Download files

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

Source Distribution

cleanote-0.2.7.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cleanote-0.2.7-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file cleanote-0.2.7.tar.gz.

File metadata

  • Download URL: cleanote-0.2.7.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cleanote-0.2.7.tar.gz
Algorithm Hash digest
SHA256 94cb2bddd04762f5dd2a46dedacdd17c3d3b52f962bb71b7c426b58cae976ae2
MD5 ef8b4a5ff510386fab89671b061943b7
BLAKE2b-256 148e2a7e4e56d885aecc772ad03d570fafd1e307e6c4818936c973f1bf1952e2

See more details on using hashes here.

File details

Details for the file cleanote-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: cleanote-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cleanote-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6e91635c10d7e0335e31efae0e4f1e5d1f6197bca839b74b7bf9c54330e9a0b2
MD5 4b54fc74fe87eb861d832fb7b384590d
BLAKE2b-256 91d77dd3fbd08c27c63a96b99e281f49f13a1942e443217bd03fb1249c28f2e0

See more details on using hashes here.

Supported by

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