Spaces:
Sleeping
Sleeping
Zekun Wu
commited on
Commit
•
333848e
1
Parent(s):
95a60e3
add
Browse files
app.py
CHANGED
@@ -205,7 +205,7 @@ def main_app():
|
|
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 |
st.success("Feedback submitted successfully!")
|
211 |
|
@@ -341,28 +341,28 @@ def sidebar_components():
|
|
341 |
|
342 |
st.sidebar.markdown(response)
|
343 |
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
|
367 |
|
368 |
|
|
|
205 |
|
206 |
feedback = st.text_input("Provide additional feedback on the response:")
|
207 |
|
208 |
+
if st.button('Submit Report 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 |
st.success("Feedback submitted successfully!")
|
211 |
|
|
|
341 |
|
342 |
st.sidebar.markdown(response)
|
343 |
|
344 |
+
st.markdown("Provide feedback on the response:")
|
345 |
+
|
346 |
+
# Feedback criteria
|
347 |
+
st.sidebar.markdown("## Feedback Criteria")
|
348 |
+
criteria = {
|
349 |
+
"Faithfulness": "Are all claims made in the answer inferred from the given context, i.e., not hallucinated?",
|
350 |
+
"Answer Relevancy": "Is the answer relevant to the question?",
|
351 |
+
"Context Relevancy": "Is the context relevant to the question?",
|
352 |
+
"Correctness": "Is the answer factually correct, based on the context?",
|
353 |
+
"Clarity": "Is the answer explained clearly without the extensive jargon of the original document?",
|
354 |
+
"Completeness": "Is the question answered fully, with all parts and subquestions being addressed?",
|
355 |
+
}
|
356 |
+
ratings = {}
|
357 |
+
for criterion, description in criteria.items():
|
358 |
+
ratings[criterion] = st.sidebar.slider(f"{criterion}: {description}", 0, 10, 5)
|
359 |
+
|
360 |
+
# Ask for feedback
|
361 |
+
feedback = st.sidebar.text_input("Provide additional feedback on the response:")
|
362 |
+
|
363 |
+
if st.sidebar.button('Submit Coach Feedback'):
|
364 |
+
store_feedback(user_input, response, feedback, str(ratings), "wu981526092/feedback_coach")
|
365 |
+
st.sidebar.success("Feedback submitted successfully!")
|
366 |
|
367 |
|
368 |
|