Parishri07's picture
Update app.py
a77f041 verified
Raw
History Blame
709 Bytes
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",
description="Decision-support chatbot for explaining readmission risk"
)
demo.launch(server_name="0.0.0.0", server_port=7860)