Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,10 @@ import streamlit as st
|
|
3 |
import pandas as pd
|
4 |
import matplotlib.pyplot as plt
|
5 |
import seaborn as sns
|
6 |
-
import requests
|
7 |
-
from googleapiclient.discovery import build
|
8 |
-
from google.oauth2.credentials import Credentials
|
9 |
from groq import Groq
|
10 |
|
11 |
# Groq API Key (replace with your actual API key)
|
12 |
-
groq_api_key = "
|
13 |
|
14 |
# Initialize Groq client
|
15 |
client = Groq(api_key=groq_api_key)
|
@@ -75,70 +72,69 @@ def main():
|
|
75 |
This app helps identify areas of concern in students' well-being and provides personalized advice based on their responses.
|
76 |
""")
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
st.write("No articles available at the moment.")
|
142 |
|
143 |
if __name__ == "__main__":
|
144 |
main()
|
|
|
3 |
import pandas as pd
|
4 |
import matplotlib.pyplot as plt
|
5 |
import seaborn as sns
|
|
|
|
|
|
|
6 |
from groq import Groq
|
7 |
|
8 |
# Groq API Key (replace with your actual API key)
|
9 |
+
groq_api_key = "your_groq_api_key"
|
10 |
|
11 |
# Initialize Groq client
|
12 |
client = Groq(api_key=groq_api_key)
|
|
|
72 |
This app helps identify areas of concern in students' well-being and provides personalized advice based on their responses.
|
73 |
""")
|
74 |
|
75 |
+
# Dynamic Data Input
|
76 |
+
st.markdown("## π Enter Your Data")
|
77 |
+
st.write("Please fill out the form below to receive personalized well-being advice.")
|
78 |
+
|
79 |
+
# Dynamic form for user input
|
80 |
+
anxiety_level = st.slider("Anxiety Level (1 to 10)", 1, 10, 5)
|
81 |
+
self_esteem = st.slider("Self-esteem (1 to 10)", 1, 10, 5)
|
82 |
+
mental_health_history = st.selectbox("Mental Health History", ["None", "Minor Issues", "Moderate Issues", "Severe Issues"])
|
83 |
+
depression = st.slider("Depression Level (1 to 10)", 1, 10, 5)
|
84 |
+
headache = st.slider("Headache Level (1 to 10)", 1, 10, 5)
|
85 |
+
blood_pressure = st.slider("Blood Pressure (1 to 10)", 1, 10, 5)
|
86 |
+
sleep_quality = st.slider("Sleep Quality (1 to 10)", 1, 10, 5)
|
87 |
+
breathing_problem = st.selectbox("Breathing Problem", ["None", "Mild", "Severe"])
|
88 |
+
noise_level = st.slider("Noise Level (1 to 10)", 1, 10, 5)
|
89 |
+
living_conditions = st.slider("Living Conditions (1 to 10)", 1, 10, 5)
|
90 |
+
safety = st.slider("Safety (1 to 10)", 1, 10, 5)
|
91 |
+
basic_needs = st.slider("Basic Needs Satisfaction (1 to 10)", 1, 10, 5)
|
92 |
+
academic_performance = st.slider("Academic Performance (1 to 10)", 1, 10, 5)
|
93 |
+
study_load = st.slider("Study Load (1 to 10)", 1, 10, 5)
|
94 |
+
teacher_student_relationship = st.slider("Teacher-Student Relationship (1 to 10)", 1, 10, 5)
|
95 |
+
future_career_concerns = st.slider("Future Career Concerns (1 to 10)", 1, 10, 5)
|
96 |
+
social_support = st.slider("Social Support (1 to 10)", 1, 10, 5)
|
97 |
+
peer_pressure = st.slider("Peer Pressure (1 to 10)", 1, 10, 5)
|
98 |
+
extracurricular_activities = st.slider("Extracurricular Activities (1 to 10)", 1, 10, 5)
|
99 |
+
bullying = st.slider("Bullying Level (1 to 10)", 1, 10, 5)
|
100 |
+
stress_level = st.slider("Stress Level (0 - Low, 1 - Moderate, 2 - High)", 0, 2, 1)
|
101 |
+
|
102 |
+
user_data = {
|
103 |
+
"anxiety_level": anxiety_level,
|
104 |
+
"self_esteem": self_esteem,
|
105 |
+
"mental_health_history": mental_health_history,
|
106 |
+
"depression": depression,
|
107 |
+
"headache": headache,
|
108 |
+
"blood_pressure": blood_pressure,
|
109 |
+
"sleep_quality": sleep_quality,
|
110 |
+
"breathing_problem": breathing_problem,
|
111 |
+
"noise_level": noise_level,
|
112 |
+
"living_conditions": living_conditions,
|
113 |
+
"safety": safety,
|
114 |
+
"basic_needs": basic_needs,
|
115 |
+
"academic_performance": academic_performance,
|
116 |
+
"study_load": study_load,
|
117 |
+
"teacher_student_relationship": teacher_student_relationship,
|
118 |
+
"future_career_concerns": future_career_concerns,
|
119 |
+
"social_support": social_support,
|
120 |
+
"peer_pressure": peer_pressure,
|
121 |
+
"extracurricular_activities": extracurricular_activities,
|
122 |
+
"bullying": bullying,
|
123 |
+
"stress_level": stress_level
|
124 |
+
}
|
125 |
+
|
126 |
+
st.write(f"### Selected User Data: {user_data}")
|
127 |
+
|
128 |
+
# Provide personalized advice
|
129 |
+
st.subheader("π Health Advice Based on Your Input")
|
130 |
+
advice = get_personalized_advice(user_data)
|
131 |
+
if advice:
|
132 |
+
st.write(advice)
|
133 |
+
else:
|
134 |
+
st.warning("No advice available at the moment.")
|
135 |
+
|
136 |
+
# Include graphs (if relevant data exists)
|
137 |
+
plot_graphs(pd.DataFrame([user_data])) # Placeholder for any data visualization logic
|
|
|
138 |
|
139 |
if __name__ == "__main__":
|
140 |
main()
|