Create gen_api_answer.py
Browse files- gen_api_answer.py +51 -0
gen_api_answer.py
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ATLA_PROMPT = """You are tasked with evaluating a response based on a given instruction (which may contain an Input) and a scoring rubric that serve as the evaluation standard. Provide a comprehensive feedback on the response quality strictly adhering to the scoring rubric, without any general evaluation. Follow this with a score between 1 and 5, referring to the scoring rubric. Avoid generating any additional opening, closing, or explanations.
|
2 |
+
Here are some rules of the evaluation:
|
3 |
+
(1) You should prioritize evaluating whether the response satisfies the provided rubric. The basis of your score should depend exactly on the rubric. However, the response does not need to explicitly address points raised in the rubric. Rather, evaluate the response based on the criteria outlined in the rubric.
|
4 |
+
|
5 |
+
Your reply should strictly follow this format:
|
6 |
+
**Reasoning:** <Your feedback>
|
7 |
+
|
8 |
+
**Result:** <an integer between 1 and 5>
|
9 |
+
|
10 |
+
Here is the data:
|
11 |
+
|
12 |
+
Instruction:
|
13 |
+
```
|
14 |
+
{human_input}
|
15 |
+
```
|
16 |
+
|
17 |
+
Response:
|
18 |
+
```
|
19 |
+
{ai_response}
|
20 |
+
```
|
21 |
+
|
22 |
+
Score Rubrics:
|
23 |
+
{eval_criteria}"""
|
24 |
+
|
25 |
+
ATLA_PROMPT_WITH_REFERENCE = """You are tasked with evaluating a response based on a given instruction (which may contain an Input) and a scoring rubric and reference answer that serve as the evaluation standard. Provide a comprehensive feedback on the response quality strictly adhering to the scoring rubric, without any general evaluation. Follow this with a score between 1 and 5, referring to the scoring rubric. Avoid generating any additional opening, closing, or explanations.
|
26 |
+
|
27 |
+
Here are some rules of the evaluation:
|
28 |
+
(1) You should prioritize evaluating whether the response satisfies the provided rubric. The basis of your score should depend exactly on the rubric. However, the response does not need to explicitly address points raised in the rubric. Rather, evaluate the response based on the criteria outlined in the rubric.
|
29 |
+
|
30 |
+
Your reply should strictly follow this format:
|
31 |
+
**Reasoning:** <Your feedback>
|
32 |
+
|
33 |
+
**Result:** <an integer between 1 and 5>
|
34 |
+
|
35 |
+
Here is the data:
|
36 |
+
|
37 |
+
Instruction:
|
38 |
+
```
|
39 |
+
{human_input}
|
40 |
+
```
|
41 |
+
|
42 |
+
Response:
|
43 |
+
```
|
44 |
+
{ai_response}
|
45 |
+
```
|
46 |
+
|
47 |
+
Score Rubrics:
|
48 |
+
{eval_criteria}
|
49 |
+
|
50 |
+
Reference answer:
|
51 |
+
{ground_truth_input}"""
|