kaikaidai commited on
Commit
e78f2d8
1 Parent(s): 58f5f61

Update example_metrics.py

Browse files
Files changed (1) hide show
  1. example_metrics.py +23 -39
example_metrics.py CHANGED
@@ -6,16 +6,12 @@ EXAMPLE_METRICS = {
6
  Score:
7
  A score of 0 means the response contains no contradictions to the ground truth.
8
  A score of 1 means the response contains contradictions to the ground truth.\n
9
- Here is the data:
10
- [BEGIN DATA]
11
- ***
12
  [User Query]: {{input}}
13
- ***
14
  [Ground Truth Response]: {{ground_truth}}
15
- ***
16
- [Response]: {{response}}
17
- ***
18
- [END DATA]""",
19
  "input": """Lichens are symbiotic organisms made of green algae and fungi. What do the green algae supply to the fungi in this symbiotic relationship?
20
  A) Carbon dioxide
21
  B) Food
@@ -33,16 +29,12 @@ A score of 2 means the response includes some relevant information but is mostly
33
  A score of 3 means the response is somewhat relevant with a balanced mix of relevant and irrelevant information.
34
  A score of 4 means the response is mostly relevant, containing only minor irrelevant details.
35
  A score of 5 means the response is entirely relevant, perfectly aligning with the ground truth response without any irrelevant information.\n
36
- Here is the data:
37
- [BEGIN DATA]
38
- ***
39
  [User Query]: {{input}}
40
- ***
41
  [Ground Truth Response]: {{ground_truth}}
42
- ***
43
- [Response]: {{response}}
44
- ***
45
- [END DATA]""",
46
  # Example from Prometheus
47
  "input": "In a city, there are three different colored houses - red, blue, and yellow. The city council has made a rule that no two same colored houses can be adjacent to each other. A query is raised by the city planner who is designing the layout of the houses. The query is, 'Can you help me design a layout where I can place these houses without violating the rule of the city council?' The user didn't provide information about the total number of houses, the layout structure, or the proportion of house colors.",
48
  "ground_truth": "In order to provide an accurate layout design, I'll need a bit more information. Could you please specify how many houses in total are to be placed in the city? Also, it would be helpful to know the ratio of the different colored houses. Are there equal numbers of red, blue, and yellow houses, or does one color predominate? Furthermore, understanding the layout structure you have in mind is also important. Is it a linear layout, a circular one, a block-based one, or some other structure? Once I have these details, I'll be able to provide a more precise and useful answer.",
@@ -56,16 +48,12 @@ A score of 2 means the response includes only a few of the key facts and details
56
  A score of 3 means the response captures a moderate amount of the key facts and details from the ground truth.
57
  A score of 4 means the response includes most of the key facts and details from the ground truth.
58
  A score of 5 means the response perfectly captures all key facts and details from the ground truth without omission.\n
59
- Here is the data:
60
- [BEGIN DATA]
61
- ***
62
  [User Query]: {{input}}
63
- ***
64
  [Ground Truth Response]: {{ground_truth}}
65
- ***
66
- [Response]: {{response}}
67
- ***
68
- [END DATA]""",
69
  # Example from Prometheus
70
  "input": """There's a thing that's bothering me. It's related to a kind of fruit, but not really the usual ones we eat. It's sweet, crunchy, and a lot of people like it, but it's not something you'd normally find in a grocery store. What kind of fruit am I talking about?""",
71
  "ground_truth": """Based on your description, it seems like you might be referring to the 'honeycrisp apple'. While it is a type of fruit and is known for its sweetness and crunchiness, it's not as commonly found in grocery stores as other fruit varieties due to its specific growing requirements and seasonality. Its unique taste and texture make it a favorite among many people. However, it's important to note that there could potentially be other fruits that also fit the given description, as taste and texture can vary significantly among fruit varieties.""",
@@ -75,16 +63,14 @@ Here is the data:
75
  "prompt": """You are assessing a chat bot response to a user's input based on the logical coherence of the response.\n
76
  Score:
77
  A score of 1 means the response is illogical, contains internal contradictions, or has significant jumps in reasoning that make it hard to follow.
 
78
  A score of 3 means the response follows some logical flow but has minor inconsistencies or gaps in reasoning.
 
79
  A score of 5 means the response is completely logically coherent, with clear connections between ideas and a natural progression of thought.\n
80
- Here is the data:
81
- [BEGIN DATA]
82
- ***
83
  [User Query]: {{input}}
84
- ***
85
- [Response]: {{response}}
86
- ***
87
- [END DATA]""",
88
  # Example from RewardBench
89
  "input": "How did US states get their names?",
90
  "response": "US states got their names for a variety of reasons. Many are named after early explorers, leaders, or patriots. Some are named after geographical features, such as mountains or rivers. Others are named after plants or animals that are native to the state. Some are even named after historical figures or characters from literature or mythology.",
@@ -93,18 +79,16 @@ Here is the data:
93
  "prompt": """You are assessing a chat bot response to a user's input based on the faithfulness of the response to the context retrieved.\n
94
  Score:
95
  A score of 1 means that the response contains statements that directly contradict the context or are entirely unsupported by it.
 
96
  A score of 3 means that the response contains some statements that are not directly supported by the context.
 
97
  A score of 5 means that the response is fully grounded in the context, with all statements accurately reflecting the provided information.\n
98
- Here is the data:
99
- [BEGIN DATA]
100
- ***
101
  [User Query]: {{input}}
102
- ***
103
  [Retrieved Context]: {{context}}
104
- ***
105
- [Response]: {{response}}
106
- ***
107
- [END DATA]""",
108
  # Example from RAGTruth
109
  "input": "How to prepare to get an ultrasound?",
110
  "context": """Passage 1: 1 If you are just interested in checking the gender, you can go as early as 17 weeks. 2 Any earlier, and the results may not be accurate, leading to an extra coat of paint for your bedroom. 3 To get good pictures, 3D ultrasounds are best performed between 20 and 32 weeks, and the best pictures are between 24 and 30 weeks.""",
 
6
  Score:
7
  A score of 0 means the response contains no contradictions to the ground truth.
8
  A score of 1 means the response contains contradictions to the ground truth.\n
9
+
 
 
10
  [User Query]: {{input}}
11
+
12
  [Ground Truth Response]: {{ground_truth}}
13
+
14
+ [Response]: {{response}}""",
 
 
15
  "input": """Lichens are symbiotic organisms made of green algae and fungi. What do the green algae supply to the fungi in this symbiotic relationship?
16
  A) Carbon dioxide
17
  B) Food
 
29
  A score of 3 means the response is somewhat relevant with a balanced mix of relevant and irrelevant information.
30
  A score of 4 means the response is mostly relevant, containing only minor irrelevant details.
31
  A score of 5 means the response is entirely relevant, perfectly aligning with the ground truth response without any irrelevant information.\n
32
+
 
 
33
  [User Query]: {{input}}
34
+
35
  [Ground Truth Response]: {{ground_truth}}
36
+
37
+ [Response]: {{response}}""",
 
 
38
  # Example from Prometheus
39
  "input": "In a city, there are three different colored houses - red, blue, and yellow. The city council has made a rule that no two same colored houses can be adjacent to each other. A query is raised by the city planner who is designing the layout of the houses. The query is, 'Can you help me design a layout where I can place these houses without violating the rule of the city council?' The user didn't provide information about the total number of houses, the layout structure, or the proportion of house colors.",
40
  "ground_truth": "In order to provide an accurate layout design, I'll need a bit more information. Could you please specify how many houses in total are to be placed in the city? Also, it would be helpful to know the ratio of the different colored houses. Are there equal numbers of red, blue, and yellow houses, or does one color predominate? Furthermore, understanding the layout structure you have in mind is also important. Is it a linear layout, a circular one, a block-based one, or some other structure? Once I have these details, I'll be able to provide a more precise and useful answer.",
 
48
  A score of 3 means the response captures a moderate amount of the key facts and details from the ground truth.
49
  A score of 4 means the response includes most of the key facts and details from the ground truth.
50
  A score of 5 means the response perfectly captures all key facts and details from the ground truth without omission.\n
51
+
 
 
52
  [User Query]: {{input}}
53
+
54
  [Ground Truth Response]: {{ground_truth}}
55
+
56
+ [Response]: {{response}}""",
 
 
57
  # Example from Prometheus
58
  "input": """There's a thing that's bothering me. It's related to a kind of fruit, but not really the usual ones we eat. It's sweet, crunchy, and a lot of people like it, but it's not something you'd normally find in a grocery store. What kind of fruit am I talking about?""",
59
  "ground_truth": """Based on your description, it seems like you might be referring to the 'honeycrisp apple'. While it is a type of fruit and is known for its sweetness and crunchiness, it's not as commonly found in grocery stores as other fruit varieties due to its specific growing requirements and seasonality. Its unique taste and texture make it a favorite among many people. However, it's important to note that there could potentially be other fruits that also fit the given description, as taste and texture can vary significantly among fruit varieties.""",
 
63
  "prompt": """You are assessing a chat bot response to a user's input based on the logical coherence of the response.\n
64
  Score:
65
  A score of 1 means the response is illogical, contains internal contradictions, or has significant jumps in reasoning that make it hard to follow.
66
+ A score of 2 means the response has minimal logical flow, contains inconsistencies, and shows only slight signs of rationality.
67
  A score of 3 means the response follows some logical flow but has minor inconsistencies or gaps in reasoning.
68
+ A score of 4 means the response has a strong logical flow, is consistent with all provided information, and demonstrates clear rationality with only very minor errors.
69
  A score of 5 means the response is completely logically coherent, with clear connections between ideas and a natural progression of thought.\n
70
+
 
 
71
  [User Query]: {{input}}
72
+
73
+ [Response]: {{response}}""",
 
 
74
  # Example from RewardBench
75
  "input": "How did US states get their names?",
76
  "response": "US states got their names for a variety of reasons. Many are named after early explorers, leaders, or patriots. Some are named after geographical features, such as mountains or rivers. Others are named after plants or animals that are native to the state. Some are even named after historical figures or characters from literature or mythology.",
 
79
  "prompt": """You are assessing a chat bot response to a user's input based on the faithfulness of the response to the context retrieved.\n
80
  Score:
81
  A score of 1 means that the response contains statements that directly contradict the context or are entirely unsupported by it.
82
+ A score of 2 means that the response includes some information from the context, but contains significant ungrounded claims or misinterpretations.
83
  A score of 3 means that the response contains some statements that are not directly supported by the context.
84
+ A score of 4 means that the response closely aligns with the context, with only rare and minor deviations.
85
  A score of 5 means that the response is fully grounded in the context, with all statements accurately reflecting the provided information.\n
86
+
 
 
87
  [User Query]: {{input}}
88
+
89
  [Retrieved Context]: {{context}}
90
+
91
+ [Response]: {{response}}""",
 
 
92
  # Example from RAGTruth
93
  "input": "How to prepare to get an ultrasound?",
94
  "context": """Passage 1: 1 If you are just interested in checking the gender, you can go as early as 17 weeks. 2 Any earlier, and the results may not be accurate, leading to an extra coat of paint for your bedroom. 3 To get good pictures, 3D ultrasounds are best performed between 20 and 32 weeks, and the best pictures are between 24 and 30 weeks.""",