Giter VIP home page Giter VIP logo

rare-icd's Introduction

Rare Codes Count: Mining Inter-code Relations for Long-tail Clinical Text Classification

Requirement

conda env create -f environment.yaml

Data

Arrange the data files in MIMIC-III, and train-dev-test split files from caml-mimic, as below:

Rare-ICD/
|
|--codes/
|
|--results/                              * Results and log files will be generated here                                  
|
|--mimicdata/                            * Put the downloaded MIMIC-III dataset here.
     |                                  
     |--NOTEEVENTS.csv                   * Collect from MIMIC-III.
     |
     |--DIAGNOSES_ICD.csv                * Collect from MIMIC-III.
     |
     |--PROCEDURES_ICD.csv               * Collect from MIMIC-III.
     |
     |--D_ICD_DIAGNOSES.csv              * Collect from MIMIC-III.
     |
     |--D_ICD_PROCEDURES.csv             * Collect from MIMIC-III.
     |
     |--ICD9_descriptions (Already given)
     |
     |--caml/                            * Train-dev-test split from caml-mimic.
     |    |
     |    |--train_50_hadm_ids.csv
     |    |
     |    |--dev_50_hadm_ids.csv
     |    |
     |    |--test_50_hadm_ids.csv
     |    |
     |    |--train_full_hadm_ids.csv
     |    |
     |    |--dev_full_hadm_ids.csv
     |    |
     |    |--test_full_hadm_ids.csv
     |
     |--generated_data/                   * The preprocessing codes will generate some files here.

Adjacency Matrix

  1. Download the adj files.

  2. Put the adj.zip under /mimicdata.

  3. unzip the file.

unzip adj.zip

rm -rf adj.zip

Reproduction

  1. Preprocess MIMIC-III data.
cd codes

python preprocess.py
  1. Run the code.

Example:

CUDA_VISIBLE_DEVICES=1 python main.py \
--folder_path '../mimicdata/generated_data/' \
--make_sentence True \
--hidden_size 512 --name run_demo --data_setting 50 \
--rnn_layer 1 --max_len 4000 --learning_rate 0.001 \
--adj 'path-to-adj'

Time Cost

We provide the training log examples of all our models, including the baseline as well, where the time for different stages are stamped for calculating the time cost for training and inference.

rare-icd's People

Contributors

jiaminchen-1031 avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.