This is the project of Medical distillation for dialog2note task.
This repository represent a code for paper Enhancing Medical Dialogue Summarization: A MediExtract Distillation Framework at BIBM-2024.
🤗 ModelCard: https://huggingface.co/Xiaolihai/flan-t5-large_MeDistill
conda env create -f environment.yml
cd ./evaluate
conda env create -n eval python=3.9 -y
pip install -r requirements.txt
--from_pretrained: google/t5-v1_1-small, google/t5-v1_1-base, google/t5-v1_1-large, google/t5-v1_1-xxl
--dataset: medqa_d2n, medqa_n2d
--alpha: Task weight for multi-task training. Loss = alpha * label_prediction_loss + (1 - alpha) * rationale_generation_loss
--model_type:
standard: Standard finetuningtask_prefix: Distilling step-by-steppeft: PEFT methods--peft_type:
lora: lora tuningadalora: adalora prompt tuningmultitask: multitask prompt tuningprefix: prefix tuning--parallelize: Model parallelism
sh ./script/stf_ds.sh
sh ./script/distill_ft_ds.sh
sh ./script/adpt_ft_ds.sh
sh ./evaluate/distill_inf.sh
sh ./evaluate/adpt_inf.sh
For convinience of comparison, we adopt the evaluation methods from MEDQA 2023 challenge
python eval_sum_medqa23.py --task taskA --fn_eval_data "./test2/10000/generated_predictions_df.csv"
This work could be cited as follows:
@INPROCEEDINGS{xiaoxiao2024enhancing,
author = { Liu, Xiaoxiao and Huang, Mengqing and Rusnachenko, Nicolay and Ive, Julia and Chang, Jian and Zhang, Jian Jun },
booktitle = { 2024 IEEE International Conference on Bioinformatics and Biomedicine (BIBM) },
title = {{ Enhancing Medical Dialogue Summarization: A MediExtract Distillation Framework }},
year = {2024},
volume = {},
ISSN = {},
pages = {6466-6473},
doi = {10.1109/BIBM62325.2024.10822640},
url = {https://doi.ieeecomputersociety.org/10.1109/BIBM62325.2024.10822640},
publisher = {IEEE Computer Society},
address = {Los Alamitos, CA, USA},
month =Dec
}
The original Distilling step-by-step project:
@article{hsieh2023distilling,
title={Distilling step-by-step! outperforming larger language models with less training data and smaller model sizes},
author={Hsieh, Cheng-Yu and Li, Chun-Liang and Yeh, Chih-Kuan and Nakhost, Hootan and Fujii, Yasuhisa and Ratner, Alexander and Krishna, Ranjay and Lee, Chen-Yu and Pfister, Tomas},
journal={arXiv preprint arXiv:2305.02301},
year={2023}
}
This is the project of Medical distillation for dialog2note task.
This repository represent a code for paper Enhancing Medical Dialogue Summarization: A MediExtract Distillation Framework at BIBM-2024.
🤗 ModelCard: https://huggingface.co/Xiaolihai/flan-t5-large_MeDistill
conda env create -f environment.yml
cd ./evaluate
conda env create -n eval python=3.9 -y
pip install -r requirements.txt
--from_pretrained: google/t5-v1_1-small, google/t5-v1_1-base, google/t5-v1_1-large, google/t5-v1_1-xxl
--dataset: medqa_d2n, medqa_n2d
--alpha: Task weight for multi-task training. Loss = alpha * label_prediction_loss + (1 - alpha) * rationale_generation_loss
--model_type:
standard: Standard finetuningtask_prefix: Distilling step-by-steppeft: PEFT methods--peft_type:
lora: lora tuningadalora: adalora prompt tuningmultitask: multitask prompt tuningprefix: prefix tuning--parallelize: Model parallelism
sh ./script/stf_ds.sh
sh ./script/distill_ft_ds.sh
sh ./script/adpt_ft_ds.sh
sh ./evaluate/distill_inf.sh
sh ./evaluate/adpt_inf.sh
For convinience of comparison, we adopt the evaluation methods from MEDQA 2023 challenge
python eval_sum_medqa23.py --task taskA --fn_eval_data "./test2/10000/generated_predictions_df.csv"
This work could be cited as follows:
@INPROCEEDINGS{xiaoxiao2024enhancing,
author = { Liu, Xiaoxiao and Huang, Mengqing and Rusnachenko, Nicolay and Ive, Julia and Chang, Jian and Zhang, Jian Jun },
booktitle = { 2024 IEEE International Conference on Bioinformatics and Biomedicine (BIBM) },
title = {{ Enhancing Medical Dialogue Summarization: A MediExtract Distillation Framework }},
year = {2024},
volume = {},
ISSN = {},
pages = {6466-6473},
doi = {10.1109/BIBM62325.2024.10822640},
url = {https://doi.ieeecomputersociety.org/10.1109/BIBM62325.2024.10822640},
publisher = {IEEE Computer Society},
address = {Los Alamitos, CA, USA},
month =Dec
}
The original Distilling step-by-step project:
@article{hsieh2023distilling,
title={Distilling step-by-step! outperforming larger language models with less training data and smaller model sizes},
author={Hsieh, Cheng-Yu and Li, Chun-Liang and Yeh, Chih-Kuan and Nakhost, Hootan and Fujii, Yasuhisa and Ratner, Alexander and Krishna, Ranjay and Lee, Chen-Yu and Pfister, Tomas},
journal={arXiv preprint arXiv:2305.02301},
year={2023}
}