Zekun Wu
commited on
Commit
·
3b8b9ac
1
Parent(s):
3681940
add
Browse files
app.py
CHANGED
@@ -188,7 +188,7 @@ def main_app():
|
|
188 |
# Ask for feedback
|
189 |
st.markdown(st.session_state['analysis'])
|
190 |
|
191 |
-
|
192 |
|
193 |
criteria = {
|
194 |
"Faithfulness": "Are all claims made in the answer inferred from the given context, i.e., not hallucinated?",
|
@@ -199,18 +199,18 @@ def main_app():
|
|
199 |
"Completeness": "Is the question answered fully, with all parts and subquestions being addressed?",
|
200 |
}
|
201 |
|
202 |
-
|
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 |
-
|
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'],
|
214 |
|
215 |
|
216 |
|
@@ -347,7 +347,7 @@ def sidebar_components():
|
|
347 |
st.sidebar.markdown(response)
|
348 |
|
349 |
# Ask for feedback
|
350 |
-
|
351 |
|
352 |
# Feedback criteria
|
353 |
st.sidebar.markdown("## Feedback Criteria")
|
@@ -359,7 +359,7 @@ 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 |
-
|
363 |
# for criterion, description in criteria.items():
|
364 |
# ratings[criterion] = st.sidebar.slider(f"{criterion}: {description}", 0, 10, 5)
|
365 |
|
@@ -368,12 +368,12 @@ def sidebar_components():
|
|
368 |
with col1:
|
369 |
st.write(criterion)
|
370 |
with col2:
|
371 |
-
|
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,
|
377 |
st.sidebar.success("Feedback submitted successfully!")
|
378 |
|
379 |
|
|
|
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 |
"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 |
|
|
|
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 |
"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 |
|
|
|
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 |
|