Skip to main content

Preprocessing scripts for the DRAGON benchmark

Project description

DRAGON Preprocessing

This repository contains the preprocessing scripts for the DRAGON challenge.

If you are using this codebase or some part of it, please cite the following article: PENDING

BibTeX:

PENDING

Installation

dragon_prep can be pip-installed:

pip install dragon_prep

Alternatively, it can be installed from source:

git clone https://github.com/DIAGNijmegen/dragon_prep
cd dragon_prep
pip install -e .

The Docker can be built after cloning the repository. The anonymisation code is not included due to privacy concerns, so you have to uncomment copying and installing the diag-radiology-report-anonymizer. The unmodified version is included to reflect the exact code used to prepare the DRAGON challenge resources.

git clone https://github.com/DIAGNijmegen/dragon_prep
cd dragon_prep
nano Dockerfile  # uncomment copying and installing the diag-radiology-report-anonymizer
./build.sh

If ran successfully, this results in the Docker container named dragon_prep:latest.

Resources

The preprocessing scripts for the synthetic datasets can be found in src/dragon_prep and are the script called Task1xx_Example_yy.py. The preprocessing scripts for the datasets used in the test leaderboard for the DRAGON challenge can be found in src/dragon_prep and are the script called Task0xx_yy.py. The datasets for the validation leaderboard are derived from the development data, using the src/dragon_prep/make_debug_splits.py script. For the DRAGON challenge, all datasets were preprocessed using the preprocess.sh script.

Usage

The synthetic datasets can be generated with any number of samples.

After installing the dragon_prep module:

python src/dragon_prep/Task101_Example_sl_bin_clf.py \
    --output_dir=./output \
    --num_examples={set any number you like}

Or, using the Docker container:

docker run --rm -it \
    -v /path/to/store/data:/output \
    dragon_prep:latest python /opt/app/dragon_prep/src/dragon_prep/Task101_Example_sl_bin_clf.py \
        --num_examples={set any number you like}


# ... same for Task102_Example_sl_mc_clf.py, Task104_Example_ml_bin_clf.py, Task105_Example_ml_mc_clf.py, Task106_Example_sl_reg.py, Task107_Example_ml_reg.py, Task108_Example_sl_ner.py, Task109_Example_ml_ner.py
# for Task103_Example_mednli.py, setting the number of examples is not supported

The preprocessing scripts for the tasks in the DRAGON benchmark are included for transparancy and to provide building blocks to process your own data. To run the end-to-end script using your own data, you can turn off the anonymisation functionality:

prepare_for_anon(df=df, output_dir=output_dir, task_name=task_name, tag_phi=False, apply_hips=False)

Managed By

Diagnostic Image Analysis Group, Radboud University Medical Center, Nijmegen, The Netherlands

Contact Information

Joeran Bosma: Joeran.Bosma@radboudumc.nl

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

dragon_prep-0.2.7.tar.gz (53.4 kB view details)

Uploaded Source

Built Distribution

dragon_prep-0.2.7-py3-none-any.whl (111.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dragon_prep-0.2.7.tar.gz
  • Upload date:
  • Size: 53.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for dragon_prep-0.2.7.tar.gz
Algorithm Hash digest
SHA256 080a70a0ebcf735ba903227ef3bd0c4bcdfb51fe838f5da51b07741925612ae8
MD5 bbe3a9d944f2a2d5c0bf17643b90c4a6
BLAKE2b-256 375ffb0e8312d68b2a42a346ef81bae77570af7aeb413cb9d267ec052506d071

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dragon_prep-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 111.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for dragon_prep-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bc1f2d4c8d9d4f36013ec4792a9c957d1648207f24c8bad1de49e36ee1db4d14
MD5 97280690ca3f7b5884e7e8a7ab02655c
BLAKE2b-256 5dc6808589818e2cdeacbfa107965fe1ebbe53297fcb73be5e3af7bc26c6c2b4

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