Zekun Wu commited on
Commit
63782e9
1 Parent(s): 3b8b9ac
Files changed (1) hide show
  1. app.py +13 -22
app.py CHANGED
@@ -188,7 +188,7 @@ def main_app():
188
  # Ask for feedback
189
  st.markdown(st.session_state['analysis'])
190
 
191
- feedback_report = st.text_input("Provide your feedback on the response:")
192
 
193
  criteria = {
194
  "Faithfulness": "Are all claims made in the answer inferred from the given context, i.e., not hallucinated?",
@@ -199,18 +199,14 @@ def main_app():
199
  "Completeness": "Is the question answered fully, with all parts and subquestions being addressed?",
200
  }
201
 
202
- ratings_report = {}
203
-
204
  for criterion, description in criteria.items():
205
- col1, col2 = st.columns([1, 3])
206
- with col1:
207
- st.write(criterion)
208
- with col2:
209
- ratings_report[criterion] = st.slider(description, 0, 10, 5)
210
- #rating = st.slider("Rate the response:", 0, 10, 5)
211
 
212
  if st.button('Submit Feedback'):
213
- store_feedback(str(generate_prompt_from_profile(profile, version=st.session_state['version'])), st.session_state['analysis'], feedback_report, str(ratings_report), "wu981526092/feedback_report")
214
 
215
 
216
 
@@ -346,8 +342,7 @@ def sidebar_components():
346
  # Display the response
347
  st.sidebar.markdown(response)
348
 
349
- # Ask for feedback
350
- feedback_coach = st.sidebar.text_input("Provide your feedback on the response:")
351
 
352
  # Feedback criteria
353
  st.sidebar.markdown("## Feedback Criteria")
@@ -359,21 +354,17 @@ def sidebar_components():
359
  "Clarity": "Is the answer explained clearly without the extensive jargon of the original document?",
360
  "Completeness": "Is the question answered fully, with all parts and subquestions being addressed?",
361
  }
362
- ratings_coach = {}
363
- # for criterion, description in criteria.items():
364
- # ratings[criterion] = st.sidebar.slider(f"{criterion}: {description}", 0, 10, 5)
365
-
366
  for criterion, description in criteria.items():
367
- col1, col2 = st.sidebar.columns([1, 3])
368
- with col1:
369
- st.write(criterion)
370
- with col2:
371
- ratings_coach[criterion] = st.sidebar.slider(description, 0, 10, 5)
372
 
373
  #rating = st.sidebar.slider("Rate the response:", 0, 10, 5)
374
 
375
  if st.sidebar.button('Submit Feedback'):
376
- store_feedback(user_input, response, feedback_coach, str(ratings_coach), "wu981526092/feedback_coach")
377
  st.sidebar.success("Feedback submitted successfully!")
378
 
379
 
 
188
  # Ask for feedback
189
  st.markdown(st.session_state['analysis'])
190
 
191
+ st.markdown("Provide feedback on the report:")
192
 
193
  criteria = {
194
  "Faithfulness": "Are all claims made in the answer inferred from the given context, i.e., not hallucinated?",
 
199
  "Completeness": "Is the question answered fully, with all parts and subquestions being addressed?",
200
  }
201
 
202
+ ratings = {}
 
203
  for criterion, description in criteria.items():
204
+ ratings[criterion] = st.slider(f"{criterion}: {description}", 0, 10, 5)
205
+
206
+ feedback = st.text_input("Provide additional feedback on the response:")
 
 
 
207
 
208
  if st.button('Submit Feedback'):
209
+ store_feedback(str(generate_prompt_from_profile(profile, version=st.session_state['version'])), st.session_state['analysis'], feedback, str(ratings), "wu981526092/feedback_report")
210
 
211
 
212
 
 
342
  # Display the response
343
  st.sidebar.markdown(response)
344
 
345
+ st.markdown("Provide feedback on the response:")
 
346
 
347
  # Feedback criteria
348
  st.sidebar.markdown("## Feedback Criteria")
 
354
  "Clarity": "Is the answer explained clearly without the extensive jargon of the original document?",
355
  "Completeness": "Is the question answered fully, with all parts and subquestions being addressed?",
356
  }
357
+ ratings = {}
 
 
 
358
  for criterion, description in criteria.items():
359
+ ratings[criterion] = st.sidebar.slider(f"{criterion}: {description}", 0, 10, 5)
360
+
361
+ # Ask for feedback
362
+ feedback = st.sidebar.text_input("Provide additional feedback on the response:")
 
363
 
364
  #rating = st.sidebar.slider("Rate the response:", 0, 10, 5)
365
 
366
  if st.sidebar.button('Submit Feedback'):
367
+ store_feedback(user_input, response, feedback, str(ratings), "wu981526092/feedback_coach")
368
  st.sidebar.success("Feedback submitted successfully!")
369
 
370