You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Evaluates reasonableness score for QA scenario
4
+
model:
5
+
api: chat
6
+
configuration:
7
+
type: azure_openai
8
+
azure_deployment: ${env:AZURE_DEPLOYMENT}
9
+
api_key: ${env:AZURE_OPENAI_API_KEY}
10
+
azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT}
11
+
parameters:
12
+
temperature: 0.0
13
+
max_tokens: 100
14
+
top_p: 1.0
15
+
presence_penalty: 0
16
+
frequency_penalty: 0
17
+
seed: 0
18
+
response_format:
19
+
type: text
20
+
21
+
22
+
inputs:
23
+
question:
24
+
type: string
25
+
answer:
26
+
type: string
27
+
truth:
28
+
type: string
29
+
---
30
+
system:
31
+
You are an AI assistant. You will be given the definition of an evaluation metric for assessing the quality of an answer in a question-answering task. Your job is to compute an accurate evaluation score using the provided evaluation metric.
32
+
user:
33
+
You are an expert specialized in quality and safety evaluation of responses from intelligent assistant systems to user queries. Given some inputs, your objective is to measure whether the generated answer is complete or not, in reference to the ground truth. The metric is based on the prompt template below, where an answer is considered complete if it doesn't miss a statement from the ground truth.
34
+
35
+
Use the following steps to respond to inputs.
36
+
37
+
Step 1: Extract all statements from TRUTH. If truth is an empty string, skip all remaining steps and output {"REASON": "No missing statements found.", "SCORE": 5}.
38
+
39
+
Step 2: Extract all statements from ANSWER.
40
+
41
+
Step 3: Pay extra attention to statements that involve numbers, dates, or proper nouns. Reason step-by-step and identify whether ANSWER misses any of the statements in TRUTH. Output those missing statements in REASON.
42
+
43
+
Step 4: Rate the completeness of ANSWER between one to five stars using the following scale:
44
+
45
+
One star: ANSWER is missing all of the statements in TRUTH.
46
+
47
+
Two stars: ANSWER has some statements, but it is missing all the critical statements necessary to answer the question.
48
+
49
+
Three stars: ANSWER has some statements, but it is missing some critical statements necessary to answer the question.
50
+
51
+
Four stars: ANSWER has most of the statements, but it is missing few statements which are not important to answer the question.
52
+
53
+
Five stars: ANSWER has all of the statements in the TRUTH.
54
+
55
+
Please assign a rating between 1 and 5 based on the completeness the response. Output the rating in SCORE.
56
+
57
+
Independent Examples:
58
+
## Example Task #1 Input:
59
+
{"QUESTION": "What color does TrailBlaze Hiking Pants come in?", "ANSWER": "Khaki", "TRUTH": "Khaki"}
60
+
## Example Task #1 Output:
61
+
{"REASON": "No missing statements found.", "SCORE": 5}
62
+
## Example Task #2 Input:
63
+
{"QUESTION": "What color does TrailBlaze Hiking Pants come in?", "ANSWER": "Red", "TRUTH": "Khaki"}
{"QUESTION": "How many TrailMaster X4 Tents did John Smith bought?", "ANSWER": "1", "TRUTH": "2"}
72
+
## Example Task #4 Output:
73
+
{"REASON": "missing statements: \n1. 2 tents were purchased by John Smith.", "SCORE": 1}
74
+
## Example Task #5 Input:
75
+
{"QUESTION": "How water-proof are TrailBlazeMaster pants?", "ANSWER": "They are perfectly water-proof in all weather conditions", "TRUTH": "They are mostly water-proof except for rare, extreme weather conditions like hurricanes."}
76
+
## Example Task #5 Output:
77
+
{"REASON": "missing statements: \n1. Rare, extreme weather conditions like hurricanes would make TrailBlazeMaster pants not water-proof.", "SCORE": 4}
78
+
## Example Task #6 Input:
79
+
{"QUESTION": "How water-proof are TrailBlazeMaster pants?", "ANSWER": "They are perfectly water-proof in all weather conditions", "TRUTH": "They are slightly water-proof."}
80
+
## Example Task #6 Output:
81
+
{"REASON": "missing statements: \n1. TrailBlazeMaster pants are only slightly water-proof.", "SCORE": 2}
82
+
## Example Task #7 Input:
83
+
{"QUESTION": "Is a Belgium a country?", "ANSWER": "Sorry I cannot assist with that.", "TRUTH": "Sorry, I cannot answer any questions unrelated to sports gear."}
84
+
## Example Task #7 Output:
85
+
{"REASON": "No missing statements found.", "SCORE": 5}
86
+
## Example Task #8 Input:
87
+
{"QUESTION": "Is a Belgium a country?", "ANSWER": "Sorry I cannot provide answers unrelated to sports/gear", "TRUTH": ""}
88
+
## Example Task #8 Output:
89
+
{"REASON": "No missing statements found.", "SCORE": 5}
description: Friendliness Evaluator to measure warmth and approachability of answers.
4
+
model:
5
+
api: chat
6
+
configuration:
7
+
type: azure_openai
8
+
azure_deployment: gpt-4
9
+
api_key: ${env:AZURE_OPENAI_API_KEY}
10
+
azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT}
11
+
parameters:
12
+
temperature: 0.1
13
+
response_format: { "type": "text" }
14
+
inputs:
15
+
response:
16
+
type: string
17
+
outputs:
18
+
score:
19
+
type: int
20
+
explanation:
21
+
type: string
22
+
---
23
+
24
+
system:
25
+
Friendliness assesses the warmth and approachability of the answer. Rate the friendliness of the response between one to five stars using the following scale:
26
+
27
+
One star: the answer is unfriendly or hostile
28
+
29
+
Two stars: the answer is mostly unfriendly
30
+
31
+
Three stars: the answer is neutral
32
+
33
+
Four stars: the answer is mostly friendly
34
+
35
+
Five stars: the answer is very friendly
36
+
37
+
Please assign a rating between 1 and 5 based on the tone and demeanor of the response.
38
+
39
+
**Example 1**
40
+
generated_query: I just dont feel like helping you! Your questions are getting very annoying.
41
+
output:
42
+
{"score": 1, "explanation": "The response is not warm and is resisting to be providing helpful information."}
43
+
**Example 2**
44
+
generated_query: I'm sorry this watch is not working for you. Very happy to assist you with a replacement.
45
+
output:
46
+
{"score": 5, "explanation": "The response is warm and empathetic, offering a resolution with care."}
0 commit comments