SwatGarg commited on
Commit
8a6b4cf
1 Parent(s): 5cf948a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -177,5 +177,23 @@ with response_container:
177
  if st.session_state['generated']:
178
  for i in range(len(st.session_state['generated'])):
179
  message(st.session_state['past'][i], is_user=True, key=str(i) + '_user')
180
- message(st.session_state["generated"][i], key=str(i))
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  if st.session_state['generated']:
178
  for i in range(len(st.session_state['generated'])):
179
  message(st.session_state['past'][i], is_user=True, key=str(i) + '_user')
180
+ message(st.session_state["generated"][i], key=str(I))
181
 
182
+
183
+ with st.sidebar.expander("Behind the Scene", expanded=section_visible):
184
+ st.subheader("What AI is doing:")
185
+ # Use the values stored in session state
186
+ st.write(
187
+ f"- Detected User Tone: {st.session_state.user_sentiment} ({st.session_state.mood_trend.capitalize()}{st.session_state.mood_trend_symbol})"
188
+ )
189
+
190
+ # Display Q-table
191
+ st.dataframe(display_q_table(chatbot.q_values, states, actions))
192
+ st.write("-----------------------")
193
+ st.write(
194
+ f"- Above q-table is continuously updated after each interaction with the user. If the user's mood increases, AI gets a reward. Else, AI gets a punishment."
195
+ )
196
+ st.write(f"- Question retrieved from: {selected_retriever_option}")
197
+ st.write(
198
+ f"- If the user feels negative, moderately negative, or neutral, at the end of the AI response, it adds a mental health condition related question. The question is retrieved from DB. The categories of questions are limited to Depression, Anxiety, ADHD, Social Media Addiction, Social Isolation, and Cyberbullying which are most associated with FOMO related to excessive social media usage."
199
+ )