tarrasyed19472007 commited on
Commit
5b26654
·
verified ·
1 Parent(s): 06186fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py CHANGED
@@ -171,4 +171,28 @@ def main():
171
  suggestions = get_well_being_suggestions(emotion)
172
 
173
  # Display text suggestions
 
 
 
 
 
 
 
 
 
 
 
 
 
174
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  suggestions = get_well_being_suggestions(emotion)
172
 
173
  # Display text suggestions
174
+ st.write(suggestions["text"])
175
+
176
+ # Display links
177
+ if suggestions["links"]:
178
+ st.write("Useful Resources:")
179
+ for link in suggestions["links"]:
180
+ st.markdown(f"[{link}]({link})", unsafe_allow_html=True)
181
+
182
+ # Display video links
183
+ if suggestions["videos"]:
184
+ st.write("Relaxation Videos:")
185
+ for video in suggestions["videos"]:
186
+ st.markdown(f"[Watch here]({video})", unsafe_allow_html=True)
187
 
188
+ # Add a button for a summary
189
+ if st.button('Summary'):
190
+ st.write(f"Emotion detected: {emotion.capitalize()}. Here are your well-being suggestions to enhance your mood.")
191
+ st.write("Explore the links and videos to improve your emotional health!")
192
+
193
+ except Exception as e:
194
+ st.error(f"Error predicting emotion: {str(e)}")
195
+
196
+ # Run the Streamlit app
197
+ if __name__ == "__main__":
198
+ main()