File size: 604 Bytes
a77f041
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67da809
a77f041
 
922a2e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from chatbot.chatbot import chatbot_response

def respond(discharge_summary, risk_score, question):
    return chatbot_response(
        question=question,
        note=discharge_summary,
        risk_score=float(risk_score)
    )

demo = gr.Interface(
    fn=respond,
    inputs=[
        gr.Textbox(label="Discharge Summary", lines=12),
        gr.Slider(0, 1, value=0.65, label="Predicted Readmission Risk"),
        gr.Textbox(label="Ask a question")
    ],
    outputs=gr.Textbox(label="Assistant Response"),
    title="Clinical Readmission Assistant"
)

demo.launch(share=True)