manan's picture
Update app.py
2ef0a3b
raw
history blame
No virus
1.65 kB
import gradio as gr
import model
example_input_1 = "Family-history-of-MI-OR-Family-history-of-myocardial-infarction"
example_input_2 = """HPI: 17yo M presents with palpitations. Patient reports 3-4 months of intermittent episodes of "heart beating/pounding out of my chest." 2 days ago during a soccer game had an episode, but this time had chest pressure and felt as if he were going to pass out (did not lose conciousness). Of note patient endorses abusing adderall, primarily to study (1-3 times per week). Before recent soccer game, took adderrall night before and morning of game. Denies shortness of breath, diaphoresis, fevers, chills, headache, fatigue, changes in sleep, changes in vision/hearing, abdominal paun, changes in bowel or urinary habits.
PMHx: none
Rx: uses friends adderrall
FHx: mom with "thyroid disease," dad with recent heart attcak
All: none
Immunizations: up to date
SHx: Freshmen in college. Endorses 3-4 drinks 3 nights / week (on weekends), denies tabacco, endorses trying marijuana. Sexually active with girlfriend x 1 year, uses condoms"""
example = [[example_input_1, example_input_2]]
input_1 = gr.inputs.Textbox(lines=1, placeholder='Feature Text', default="", label=None, optional=False)
input_2 = gr.inputs.Textbox(lines=5, placeholder='Patient History', default="", label=None, optional=False)
output_1 = gr.outputs.Textbox(type="auto", label=None)
iface = gr.Interface(
model.get_predictions,
inputs=[input_1, input_2],
outputs=[output_1],
examples=example,
title='Identify Key Phrases in Patient Notes from Medical Licensing Exams',
theme='dark', # 'dark'
)
iface.launch()