Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,19 @@ def get_health_advice(query):
|
|
| 5 |
"fever": "π‘οΈ For fever, take Paracetamol, rest well, and stay hydrated.",
|
| 6 |
"cold": "π€§ Use steam inhalation, warm fluids, and over-the-counter cold medicine.",
|
| 7 |
"headache": "π Try Ibuprofen, stay in a quiet place, and drink plenty of water.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
|
|
|
|
|
|
| 9 |
for keyword in responses:
|
| 10 |
if keyword in query.lower():
|
| 11 |
return responses[keyword]
|
|
@@ -63,7 +75,7 @@ with gr.Blocks(css="""
|
|
| 63 |
}
|
| 64 |
""") as demo:
|
| 65 |
|
| 66 |
-
gr.Markdown("## π©Ί
|
| 67 |
gr.Markdown("### Your AI Health Assistant β Ask any health-related question")
|
| 68 |
|
| 69 |
with gr.Row():
|
|
@@ -77,7 +89,7 @@ with gr.Blocks(css="""
|
|
| 77 |
submit_btn = gr.Button("Get Advice", elem_classes="submit-btn")
|
| 78 |
with gr.Column():
|
| 79 |
output = gr.Textbox(
|
| 80 |
-
label="
|
| 81 |
lines=3,
|
| 82 |
interactive=False,
|
| 83 |
elem_classes="response-box"
|
|
|
|
| 5 |
"fever": "π‘οΈ For fever, take Paracetamol, rest well, and stay hydrated.",
|
| 6 |
"cold": "π€§ Use steam inhalation, warm fluids, and over-the-counter cold medicine.",
|
| 7 |
"headache": "π Try Ibuprofen, stay in a quiet place, and drink plenty of water.",
|
| 8 |
+
"cough": "π€§ For cough, try honey and ginger tea, or use a cough suppressant if needed.",
|
| 9 |
+
"stomach ache": "π΅ Drink chamomile tea or take an antacid to soothe the stomach.",
|
| 10 |
+
"sore throat": "π§΄ Gargle with warm salt water, and try throat lozenges or warm tea.",
|
| 11 |
+
"fatigue": "π€ Rest well, stay hydrated, and eat a balanced diet to replenish energy.",
|
| 12 |
+
"nausea": "π₯ Ginger tea or peppermint can help with nausea, and avoid heavy foods.",
|
| 13 |
+
"dizziness": "π§ββοΈ If feeling dizzy, sit down, hydrate, and avoid sudden movements. Seek medical attention if it persists.",
|
| 14 |
+
"back pain": "πͺ Stretch and use a hot pack on the back. Over-the-counter pain relievers may help.",
|
| 15 |
+
"allergy": "π€§ For mild allergies, take antihistamines or use nasal sprays for relief.",
|
| 16 |
+
"hair fall": "πββοΈ For hair fall, try a balanced diet, use mild shampoos, and consider consulting a dermatologist. Regular scalp massage and reducing stress may help as well.",
|
| 17 |
+
"diabetes": "π For diabetes, maintain a balanced diet with low sugar intake, exercise regularly, monitor blood sugar levels, and follow your doctor's advice for medication."
|
| 18 |
}
|
| 19 |
+
|
| 20 |
+
# Check if the query contains any of the conditions listed in responses
|
| 21 |
for keyword in responses:
|
| 22 |
if keyword in query.lower():
|
| 23 |
return responses[keyword]
|
|
|
|
| 75 |
}
|
| 76 |
""") as demo:
|
| 77 |
|
| 78 |
+
gr.Markdown("## π©Ί HealthMate")
|
| 79 |
gr.Markdown("### Your AI Health Assistant β Ask any health-related question")
|
| 80 |
|
| 81 |
with gr.Row():
|
|
|
|
| 89 |
submit_btn = gr.Button("Get Advice", elem_classes="submit-btn")
|
| 90 |
with gr.Column():
|
| 91 |
output = gr.Textbox(
|
| 92 |
+
label="HealthMate Advice:",
|
| 93 |
lines=3,
|
| 94 |
interactive=False,
|
| 95 |
elem_classes="response-box"
|