Welcome to the Pointer Generator Network (PGN) for PET report summarization implementation. This model is included in our paper and sets a baseline for deriving impressions based on PET findings and relevant background information.
PGN is based on a bidirectional-LSTM with a copy mechanism to address the out-of-vocabulary (OOV) issue. The architecture has been modified by Zhang et al. in their work regarding radiology report summarization.
convert_json.py: Converts spreadsheets into JSON files.prepare_vocab.py: Prepares our corpus by mapping individual words to their pretrained word embeddings.train.py: The script for model training.eval.py: The script for impression generation.compute_rough_score.py: Computes ROUGE metrics (ROUGE-1, ROUGE-2, ROUGE-3, and ROUGE-L) of generated impressions with original clinical impressions as reference.saved_models/01/best_model.pt: The model we have trained on 30k+ PET reports (PET/CT whole-body, PET/MR whole-body, PET/CT myocardial, etc.) from our UW Hospital and its partner medical centers.
Prepare Dataset and Vocabulary:
python prepare_vocab.py dataset/PET-CT dataset/vocab --glove_dir dataset/glove --wv_file radglove.800M.100d.txt --wv_dim 100 --lowerInitial Training:
python train.py --id 01 --data_dir dataset/PET-CT --max_dec_len 512 --background --num_epoch 30 --batch_size 25Inference / Impression Generation:
python eval.py saved_models/01 --model best_model.pt --data_dir dataset/PET-CT --dataset test --gold saved_predictions/01/test_ref.txt --out saved_predictions/01/test_pred.txtThe code was adapted from the original implementation.
For any inquiries or feedback, feel free to raise an issue or contribute via pull requests!