Files changed (1) hide show
  1. app.py +0 -107
app.py CHANGED
@@ -1,107 +0,0 @@
1
- import streamlit as st
2
-
3
- # Disease and Treatment Information Data
4
- diseases_info = {
5
- "flu": {
6
- "symptoms": ["fever", "cough", "sore throat", "body aches", "fatigue"],
7
- "treatment": "Rest, fluids, pain relievers, and anti-viral medications if prescribed.",
8
- },
9
- "headache": {
10
- "symptoms": ["head pain", "nausea", "sensitivity to light"],
11
- "treatment": "Rest, hydration, over-the-counter painkillers, and avoid triggers.",
12
- },
13
- "diabetes": {
14
- "symptoms": ["increased thirst", "frequent urination", "fatigue", "blurred vision"],
15
- "treatment": "Insulin therapy, lifestyle changes, and dietary management.",
16
- },
17
- "cold": {
18
- "symptoms": ["sore throat", "runny nose", "cough", "sneezing", "mild body aches"],
19
- "treatment": "Rest, hydration, decongestants, and over-the-counter pain relief.",
20
- },
21
- "asthma": {
22
- "symptoms": ["shortness of breath", "wheezing", "chest tightness", "coughing"],
23
- "treatment": "Inhalers, bronchodilators, corticosteroids, and avoiding triggers.",
24
- },
25
- "pneumonia": {
26
- "symptoms": ["cough with mucus", "fever", "shortness of breath", "chest pain"],
27
- "treatment": "Antibiotics for bacterial pneumonia, rest, fluids, and pain relievers.",
28
- },
29
- "hypertension": {
30
- "symptoms": ["headaches", "dizziness", "shortness of breath", "nosebleeds"],
31
- "treatment": "Medications like beta-blockers, ACE inhibitors, lifestyle changes including exercise and diet.",
32
- },
33
- "anxiety": {
34
- "symptoms": ["excessive worry", "restlessness", "fatigue", "difficulty concentrating", "irritability"],
35
- "treatment": "Cognitive-behavioral therapy (CBT), medications like SSRIs, relaxation techniques.",
36
- },
37
- "depression": {
38
- "symptoms": ["persistent sadness", "loss of interest", "fatigue", "changes in appetite or sleep patterns"],
39
- "treatment": "Antidepressants, therapy (CBT), exercise, and social support.",
40
- },
41
- "arthritis": {
42
- "symptoms": ["joint pain", "swelling", "stiffness", "reduced range of motion"],
43
- "treatment": "Pain relievers, anti-inflammatory drugs, physical therapy, and joint protection.",
44
- },
45
- "covid-19": {
46
- "symptoms": ["fever", "dry cough", "fatigue", "loss of taste or smell", "shortness of breath"],
47
- "treatment": "Rest, fluids, over-the-counter medications, and antiviral drugs if prescribed.",
48
- },
49
- "blood cancer": {
50
- "symptoms": ["weightloss", "hiarfall", "weakness", "bedrest"],
51
- "treatment": " over-the-counter medications, and antiviral drugs if prescribed.",
52
- },
53
- }
54
-
55
-
56
- # Function to display disease info
57
- def display_disease_info(disease_name):
58
- disease_name = disease_name.lower().replace(" ", "_")
59
- if disease_name in diseases_info:
60
- disease = diseases_info[disease_name]
61
- result = f"\n**Disease:** {disease_name.replace('_', ' ').title()}"
62
- result += f"\n**Symptoms:** {', '.join(disease['symptoms'])}"
63
- result += f"\n**Treatment:** {disease['treatment']}"
64
- return result
65
- else:
66
- return "\nSorry, no information available for this disease."
67
-
68
- # Function to handle the chat bot
69
- def chat_bot(user_input):
70
- if 'cha hal aa' in user_input.lower():
71
- if 'are you healthcare app' in user_input.lower():
72
- return "na rai mazak na kar maa app"
73
- return "Khair aa, tu budha!"
74
- elif 'exit' in user_input.lower():
75
- return "Goodbye!"
76
- else:
77
- return "I'm not sure how to respond to that. Type 'exit' to end the chat."
78
-
79
- # Streamlit App Interface
80
- def main():
81
- # Title of the app
82
- st.title("Disease Information and Chat Bot")
83
-
84
- # Disease Input
85
- disease_name = st.text_input("Enter Disease Name", "")
86
- if disease_name:
87
- st.subheader("Disease Information")
88
- disease_info = display_disease_info(disease_name)
89
- st.text_area("Disease Info", disease_info, height=150)
90
-
91
- # Chat Bot Section
92
- st.subheader("Chat with Bot")
93
- user_input = st.text_input("Enter a Message (e.g., How are you?)", "")
94
- if user_input:
95
- response = chat_bot(user_input)
96
- st.text_area("Chat Bot Response", response, height=100)
97
-
98
- # Add some helpful instructions
99
- st.markdown("""
100
- - **Enter a disease name** in the input box to get information about symptoms and treatments.
101
- - **Ask the chat bot** something like "How are you?" to interact with it.
102
- - Type "exit" to end the chat session.
103
- """)
104
-
105
- # Run the app
106
- if __name__ == "__main__":
107
- main()