BoltUI / symptom_checker.py
SuriRaja's picture
Upload 19 files
2d7f104 verified
raw
history blame contribute delete
960 Bytes
import gradio as gr
def mock_diagnosis(symptoms, age, gender):
# Placeholder logic
if "fever" in symptoms.lower():
return "🩺 Likely Diagnosis: Viral Infection\n📋 Suggested: General Physician\n⚠️ Urgency: Low"
elif "pain" in symptoms.lower():
return "🩺 Likely Diagnosis: Musculoskeletal issue\n📋 Suggested: Orthopedic\n⚠️ Urgency: Medium"
return "🩺 Diagnosis not clear\n📋 Suggested: General Checkup"
def gradio_interface():
with gr.Blocks() as demo:
gr.Markdown("## 🧠 Symptom Checker")
with gr.Row():
symptoms = gr.Textbox(label="Describe your symptoms")
age = gr.Number(label="Age", value=30)
gender = gr.Radio(["Male", "Female", "Other"], label="Gender")
result = gr.Textbox(label="AI Diagnosis")
btn = gr.Button("Analyze")
btn.click(fn=mock_diagnosis, inputs=[symptoms, age, gender], outputs=result)
return demo