Views
No views yet
t5-small model from Hugging Face, specifically tailored for the clinical summarization of FHIR Document Reference Clinical Notes.t5-small model were fine-tuned to retain most of the pre-trained knowledge while adapting it for better clinical summarization.1from transformers import T5ForConditionalGeneration, T5Tokenizer
2
3model = T5ForConditionalGeneration.from_pretrained("GeorgiaTech/t5-small-finetuned")
4tokenizer = T5Tokenizer.from_pretrained("GeorgiaTech/t5-small-finetuned")
5
6def summarize(text):
7 input_text = "summarize: " + text
8 input_ids = tokenizer.encode(input_text, return_tensors="pt")
9 summary_ids = model.generate(input_ids)
10 summary = tokenizer.decode(summary_ids[0])
11 return summary
12
13# Example
14text = "Your clinical note here..."
15print(summarize(text))
16
17# Acknowledgements
18A big thanks to the creators of the original t5-small model and the Hugging Face community. Also, gratitude to tools like Synthea that enabled the creation of high-quality synthetic datasets for fine-tuning purposes.
19
20# License
21This model is licensed under the Apache-2.0 License, the same as the original T5 model.