Views
No views yet
Leveraging Large Language Models to Predict Unplanned ICU Readmissions from Electronic Health RecordsHoda Helmy, Ahmed Ibrahim, Maryam Arabi, Aamenah Sattar, and Ahmed SeragNatural Language Processing Journal (2025)
1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftConfig, PeftModel
3
4peft_model_id = "serag-ai/ICU-APOLLO-EXP"
5
6config = PeftConfig.from_pretrained(peft_model_id)
7
8model = AutoModelForCausalLM.from_pretrained(
9 config.base_model_name_or_path
10)
11
12model = PeftModel.from_pretrained(
13 model,
14 peft_model_id
15)
16
17tokenizer = AutoTokenizer.from_pretrained(
18 config.base_model_name_or_path
19)1prompt = """
2Patient Summary:
3
4Age: 72
5Gender: Male
6Heart Rate: 118 bpm
7White Blood Cell Count: Elevated
8Mechanical Ventilation: Yes
9
10Predict ICU readmission risk.
11"""
12
13inputs = tokenizer(prompt, return_tensors="pt")
14
15outputs = model.generate(
16 **inputs,
17 max_new_tokens=128
18)
19
20print(tokenizer.decode(outputs[0], skip_special_tokens=True))1@article{HELMY2025100182,
2title = {Leveraging large language models to predict unplanned ICU readmissions from electronic health records},
3journal = {Natural Language Processing Journal},
4volume = {13},
5pages = {100182},
6year = {2025},
7issn = {2949-7191},
8doi = {10.1016/j.nlp.2025.100182},
9url = {https://www.sciencedirect.com/science/article/pii/S2949719125000585},
10author = {Hoda Helmy and Ahmed Ibrahim and Maryam Arabi and Aamenah Sattar and Ahmed Serag}
11}