Spaces:
Sleeping
Sleeping
TTsamurai
commited on
Commit
·
67628e8
1
Parent(s):
4b4fe08
implement round specific evaluation
Browse files
_static/html/evaluation_instruction.html
CHANGED
|
@@ -8,13 +8,10 @@
|
|
| 8 |
<li><strong>Reason:</strong> Write down the reason for your choice in the free text box labeled "The reason of your choice".</li>
|
| 9 |
<li><strong>Evaluation Criteria:</strong> After making your decision, please evaluate the system in the following aspects:
|
| 10 |
<ul>
|
| 11 |
-
<li><strong>
|
| 12 |
-
<li><strong>
|
| 13 |
-
<li><strong>Knowledgeable:</strong> How knowledgeable do you feel after interacting with the financial advisor? Answer from 1 to 100.</li>
|
| 14 |
-
<li><strong>Helpful:</strong> How helpful do you find the financial advisor? Answer from 1 to 100.</li>
|
| 15 |
</ul>
|
| 16 |
</li>
|
| 17 |
-
<li>After completing all the evaluation criteria, <strong>click the "Send: Evaluation" button</strong> to submit your responses.</li>
|
| 18 |
</ol>
|
| 19 |
-
<p style="font-size: 16px; color: #34495e;">Thank you for your participation in this evaluation process!</p>
|
| 20 |
</div>
|
|
|
|
| 8 |
<li><strong>Reason:</strong> Write down the reason for your choice in the free text box labeled "The reason of your choice".</li>
|
| 9 |
<li><strong>Evaluation Criteria:</strong> After making your decision, please evaluate the system in the following aspects:
|
| 10 |
<ul>
|
| 11 |
+
<li><strong>Likelihood of Purchase:</strong> Rate the likelihood of purchase, with 1 being very low and 7 being very high.</li>
|
| 12 |
+
<li><strong>Confidence in Your Decision:</strong> Rate the confidence of your decision, with 1 being very low and 7 being very high.</li>
|
|
|
|
|
|
|
| 13 |
</ul>
|
| 14 |
</li>
|
| 15 |
+
<li>After completing all the evaluation criteria, <strong>click the "Send: Evaluation" button</strong> to submit your responses. <strong>Once you submit, you cannot resubmit, so please review your answers carefully before submitting.</strong></li>
|
| 16 |
</ol>
|
|
|
|
| 17 |
</div>
|
app.py
CHANGED
|
@@ -258,7 +258,9 @@ def add_user_profile_to_system_instruction(
|
|
| 258 |
# print(f"Preference Summary:{summ}")
|
| 259 |
system_instruction += f"\nUser Profile collected in the previous conversations: {user_preference_elicitation_data['summary_history']}\n"
|
| 260 |
else:
|
| 261 |
-
system_instruction +=
|
|
|
|
|
|
|
| 262 |
return system_instruction
|
| 263 |
|
| 264 |
|
|
@@ -300,38 +302,13 @@ def create_demo():
|
|
| 300 |
lines=5,
|
| 301 |
)
|
| 302 |
with gr.Row():
|
| 303 |
-
|
| 304 |
-
label="
|
| 305 |
-
minimum=1,
|
| 306 |
-
maximum=100,
|
| 307 |
-
value=50,
|
| 308 |
-
info="How much do you trust the financial advisor? Answer from 1 to 100. A score of 100 means you have complete trust in the financial advisor, while a score of 1 means you have no trust at all.",
|
| 309 |
-
step=1,
|
| 310 |
-
)
|
| 311 |
-
satisfaction = gr.Slider(
|
| 312 |
-
label="Satisfaction",
|
| 313 |
-
minimum=1,
|
| 314 |
-
maximum=100,
|
| 315 |
-
value=50,
|
| 316 |
-
info="How satisfied are you with the financial advisor? Answer from 1 to 100. A score of 100 means you are completely satisfied, while a score of 1 means you are not satisfied at all.",
|
| 317 |
-
step=1,
|
| 318 |
)
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
label="
|
| 322 |
-
|
| 323 |
-
maximum=100,
|
| 324 |
-
value=50,
|
| 325 |
-
info="How knowledgeable do you feel after interacting with the financial advisor? Answer from 1 to 100. A score of 100 means you feel very knowledgeable, while a score of 1 means you feel not knowledgeable at all.",
|
| 326 |
-
step=1,
|
| 327 |
-
)
|
| 328 |
-
helpful = gr.Slider(
|
| 329 |
-
label="Helpful",
|
| 330 |
-
minimum=1,
|
| 331 |
-
maximum=100,
|
| 332 |
-
value=50,
|
| 333 |
-
info="How helpful do you find the financial advisor? Answer from 1 to 100. A score of 100 means you find the financial advisor very helpful, while a score of 1 means you find the financial advisor not helpful at all.",
|
| 334 |
-
step=1,
|
| 335 |
)
|
| 336 |
evaluation_send_button = gr.Button(value="Send: Evaluation")
|
| 337 |
return {
|
|
@@ -344,10 +321,8 @@ def create_demo():
|
|
| 344 |
"msg": msg,
|
| 345 |
"dropdown": dropdown,
|
| 346 |
"reason": reason,
|
| 347 |
-
"
|
| 348 |
-
"
|
| 349 |
-
"knowledgeable": knowledgeable,
|
| 350 |
-
"helpful": helpful,
|
| 351 |
"evaluation_send_button": evaluation_send_button,
|
| 352 |
"general_instruction": general_instruction,
|
| 353 |
"round_instruction": round_instruction,
|
|
@@ -419,10 +394,8 @@ def create_demo():
|
|
| 419 |
msg,
|
| 420 |
dropdown,
|
| 421 |
reason,
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
knowledgeable,
|
| 425 |
-
helpful,
|
| 426 |
evaluation_send_button,
|
| 427 |
) = (
|
| 428 |
tabs["comp"],
|
|
@@ -434,10 +407,8 @@ def create_demo():
|
|
| 434 |
tabs["msg"],
|
| 435 |
tabs["dropdown"],
|
| 436 |
tabs["reason"],
|
| 437 |
-
tabs["
|
| 438 |
-
tabs["
|
| 439 |
-
tabs["knowledgeable"],
|
| 440 |
-
tabs["helpful"],
|
| 441 |
tabs["evaluation_send_button"],
|
| 442 |
)
|
| 443 |
system_instruction = ""
|
|
@@ -510,16 +481,14 @@ def create_demo():
|
|
| 510 |
[tab_session, chatbot],
|
| 511 |
)
|
| 512 |
evaluation_send_button.click(
|
| 513 |
-
lambda user_id, comp, tab_session, dropdown, reason,
|
| 514 |
user_id,
|
| 515 |
tab_session,
|
| 516 |
{
|
| 517 |
"selection": dropdown,
|
| 518 |
"reason": reason,
|
| 519 |
-
"
|
| 520 |
-
"
|
| 521 |
-
"knowledgeable": knowledgeable,
|
| 522 |
-
"helpful": helpful,
|
| 523 |
},
|
| 524 |
comp,
|
| 525 |
evaluation_send_button,
|
|
@@ -530,13 +499,11 @@ def create_demo():
|
|
| 530 |
tab_session,
|
| 531 |
dropdown,
|
| 532 |
reason,
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
knowledgeable,
|
| 536 |
-
helpful,
|
| 537 |
evaluation_send_button,
|
| 538 |
],
|
| 539 |
-
[tab_session, dropdown, reason,
|
| 540 |
)
|
| 541 |
|
| 542 |
def click_control_preference_stage(tabs, user_id, user_preference_elicitation_session):
|
|
@@ -925,10 +892,8 @@ def create_demo():
|
|
| 925 |
tab_data,
|
| 926 |
evals["selection"],
|
| 927 |
evals["reason"],
|
| 928 |
-
evals["
|
| 929 |
-
evals["
|
| 930 |
-
evals["knowledgeable"],
|
| 931 |
-
evals["helpful"],
|
| 932 |
evaluation_send_button,
|
| 933 |
)
|
| 934 |
|
|
|
|
| 258 |
# print(f"Preference Summary:{summ}")
|
| 259 |
system_instruction += f"\nUser Profile collected in the previous conversations: {user_preference_elicitation_data['summary_history']}\n"
|
| 260 |
else:
|
| 261 |
+
system_instruction += (
|
| 262 |
+
f"\nUser Profile collected in the previous conversations: {user_preference_elicitation_data['history']}\n"
|
| 263 |
+
)
|
| 264 |
return system_instruction
|
| 265 |
|
| 266 |
|
|
|
|
| 302 |
lines=5,
|
| 303 |
)
|
| 304 |
with gr.Row():
|
| 305 |
+
likelihood = gr.Radio(
|
| 306 |
+
[1, 2, 3, 4, 5, 6, 7], label="Likelihood of Purchase (1 = Very Low, 7 = Very High)", show_label=True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
)
|
| 308 |
+
confidence = gr.Radio(
|
| 309 |
+
[1, 2, 3, 4, 5, 6, 7],
|
| 310 |
+
label="Confidence in Your Decision (1 = Very Low, 7 = Very High)",
|
| 311 |
+
show_label=True,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
)
|
| 313 |
evaluation_send_button = gr.Button(value="Send: Evaluation")
|
| 314 |
return {
|
|
|
|
| 321 |
"msg": msg,
|
| 322 |
"dropdown": dropdown,
|
| 323 |
"reason": reason,
|
| 324 |
+
"likelihood": likelihood,
|
| 325 |
+
"confidence": confidence,
|
|
|
|
|
|
|
| 326 |
"evaluation_send_button": evaluation_send_button,
|
| 327 |
"general_instruction": general_instruction,
|
| 328 |
"round_instruction": round_instruction,
|
|
|
|
| 394 |
msg,
|
| 395 |
dropdown,
|
| 396 |
reason,
|
| 397 |
+
likelihood,
|
| 398 |
+
confidence,
|
|
|
|
|
|
|
| 399 |
evaluation_send_button,
|
| 400 |
) = (
|
| 401 |
tabs["comp"],
|
|
|
|
| 407 |
tabs["msg"],
|
| 408 |
tabs["dropdown"],
|
| 409 |
tabs["reason"],
|
| 410 |
+
tabs["likelihood"],
|
| 411 |
+
tabs["confidence"],
|
|
|
|
|
|
|
| 412 |
tabs["evaluation_send_button"],
|
| 413 |
)
|
| 414 |
system_instruction = ""
|
|
|
|
| 481 |
[tab_session, chatbot],
|
| 482 |
)
|
| 483 |
evaluation_send_button.click(
|
| 484 |
+
lambda user_id, comp, tab_session, dropdown, reason, likelihood, confidence, evaluation_send_button: respond_evaluation(
|
| 485 |
user_id,
|
| 486 |
tab_session,
|
| 487 |
{
|
| 488 |
"selection": dropdown,
|
| 489 |
"reason": reason,
|
| 490 |
+
"likelihood": likelihood,
|
| 491 |
+
"confidence": confidence,
|
|
|
|
|
|
|
| 492 |
},
|
| 493 |
comp,
|
| 494 |
evaluation_send_button,
|
|
|
|
| 499 |
tab_session,
|
| 500 |
dropdown,
|
| 501 |
reason,
|
| 502 |
+
likelihood,
|
| 503 |
+
confidence,
|
|
|
|
|
|
|
| 504 |
evaluation_send_button,
|
| 505 |
],
|
| 506 |
+
[tab_session, dropdown, reason, likelihood, confidence, evaluation_send_button],
|
| 507 |
)
|
| 508 |
|
| 509 |
def click_control_preference_stage(tabs, user_id, user_preference_elicitation_session):
|
|
|
|
| 892 |
tab_data,
|
| 893 |
evals["selection"],
|
| 894 |
evals["reason"],
|
| 895 |
+
evals["likelihood"],
|
| 896 |
+
evals["confidence"],
|
|
|
|
|
|
|
| 897 |
evaluation_send_button,
|
| 898 |
)
|
| 899 |
|
user_feedback/round_evaluation_a7d67f45-e195-4752-9702-d9cafd065fd8.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"user_id": "demo_1_1", "uuid": "a7d67f45-e195-4752-9702-d9cafd065fd8", "timestamp": "2024-10-17 18:23:18", "type": "round_evaluation", "value": {"selection": null, "reason": "", "likelihood": 7, "confidence": null, "company": "Amazon.com, Inc."}}
|