Python 3 is required. The models have been tested using python 3.8.5
-
Clone repo:
git clone git@github.com:Rutgerdj/mortalityPrediction.git cd mortalityPrediction/ -
Setup environment:
python3 -m virtualenv .env source .env/bin/activate pip install -r requirements.txt -
Download the biobert pretrained (files) and extract them to a folder on your pc.
-
Convert the downloaded Tensorflow checkpoint to a Pytorch model:
# make sure the environment is still active source .env/bin/activate cd <path_to_downloaded_bert_files> # convert checkpoint to pytorch model transformers-cli convert --model_type bert \ --tf_checkpoint biobert_model.ckpt \ --config bert_config.json \ --pytorch_dump_output pytorch_model.bin
-
Rename files
cd <path_to_downloaded_bert_files> # bert_config.json -> config.json # biobert_model.ckpt* -> model.ckpt* mv bert_config.json config.json rename -v 's/biobert_model/model/' *
-
Change the
"biobert_path"value inconfig.pyto the folder where you placed the biobert files. -
Run the model:
python train.py
These are the results of the first tests:

