Git Product home page Git Product logo

mimic-phenotype-classification's Introduction

mimic-phenotype-classification

This repository contains the code for a downstream classification task related to models trained using https://github.com/amin-nejad/mimic-text-generation. The task is a multilabel classification problem predicting the phenotypes exhibited by a curated subset of patients from MIMIC-III as per https://github.com/sebastianGehrmann/phenotyping.

Follow the steps below:

  1. Install the environment
conda env create -f environment.yml
  1. Run the files sequentially. This assumes you have already run the text generation models and generated synthetic data
  2. You may find it useful to run the training script as follows:
nohup python 02_train.py > train.out &
  1. You must install BioBERT separately as instructed below

BioBERT

In order to be able to use BioBERT, follow these instructions:

  1. Download the BioBERT v1.1 (+ PubMed 1M) model (or any other model) from the BioBERT repo
  2. Extract the downloaded file, e.g. with tar -xvzf biobert_v1.1_pubmed.tar.gz
  3. Convert the BioBERT model TensorFlow checkpoint to a PyTorch and PyTorch-Transformers compatible one: pytorch_transformers bert biobert_v1.1_pubmed/model.ckpt-1000000 biobert_v1.1_pubmed/bert_config.json biobert_v1.1_pubmed/pytorch_model.bin
  4. Rename config mv biobert_v1.1_pubmed/bert_config.json biobert_v1.1_pubmed/config.json
  5. Rename folder mv biobert_v1.1_pubmed/ biobert/

If everything has worked, this python code snippet shouldn't give any errors:

from pytorch_transformers import BertModel
model = BertModel.from_pretrained('biobert')

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.