Project1Demo / README.md
dogoodson's picture
Update README.md
8814aea verified

A newer version of the Gradio SDK is available: 6.14.0

Upgrade
metadata
title: Patient Treatment Plan Summarizer
emoji: 👁
colorFrom: purple
colorTo: purple
sdk: gradio
sdk_version: 6.11.0
app_file: app.py
pinned: false
license: mit

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Overview

The goal of this application is to demonstrate how a healthcare clinic staff could quickly identify the outcome of each of the day's patient visits.

Using Gradio, a dropdown provides a sampling of 25 patient IDs (the maximum patients the clinic can see in one day).

A healthcare staff member can select a patient, see the motivation and summary from the record. If a synopsis of treatment is needed to quickly understand the treatment plan, optionally they can press a button to generate a synopsis of next-steps for this patient.

This generated summary answers questions like:

  • Is the patient taking medication for treatment?
  • Are they being admitted to the hospital?
  • Have they completed their treatment and follow-ups and therefore are back to normal?

DataSet

"AGBonnet/augmented-clinical-notes" is a DataSet of 30,000+ records. The dataset is available on HuggingFace containing medical notes from patient visits.

The columns in the dataset contain Patient IDs, motivation for the patient seeking healthcare, a transcript of the discussion, a summary of the discussion, and a treatment/discharge plan provided in JSON format.

Model

The model used is the microsoft/MediPhi-Clinical model with medical domain knowledge. Being domain-specific results in better at text-generation summarizing patient next-steps compared to generic models which struggle to comprehend medical terminology.

Code: generator = pipeline("text-generation", model="microsoft/MediPhi-Clinical", max_new_tokens=256, do_sample=True)

Task

The summarization pipeline is deprecated in HuggingFace as of transformers library version 5.0.0. The text-generation pipeline is used to effectively summarize the clinical notes in this dataset by providing the treatment plan from the dataset as context to the model. By prompting the model with instructions to generate patient instructions based on that context, it summarizes and clarifies the next-steps for the patient and the healtcare staff reading the record.

Limitations and Ethical Considerations

The summarization model does use public models and may have inherit biases. Additionally, the model may not generate a perfect representation of the treatment plan in its summarization. Therefore, healthcare staff must use this as an assistive device, not as the source of truth.