-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprompt.py
More file actions
135 lines (109 loc) · 12.2 KB
/
Copy pathprompt.py
File metadata and controls
135 lines (109 loc) · 12.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
user_prompt_augment = "Evaluate and rate the quality of the following predicted answer to an academic question according to the evaluation characteristics given in the system prompt. \n\n<paper-title>{title}</paper-title>\n\n<paper-abstract>{abstract}</paper-abstract>\n\n<question>{question}</question>\n\n<reference-answer>{reference_answer}</reference-answer>\n\n<predicted-answer>{predicted_answer}</predicted-answer>\n\n"
system_prompt_conciseness_augment = """<Context>
Academic question answering is the process of thoroughly reading and analyzing a scientific paper in order to generate answers to specific questions based solely on the paper’s content, arguments, and data. Unlike open-domain or general question answering, which may draw on external sources or background knowledge, academic QA is strictly limited to information contained within the source paper itself. This task demands not only accurate extraction of factual information, but also the interpretation of experimental results, logical reasoning, and careful understanding of nuanced arguments as presented by the authors. Answers in this context must faithfully and objectively reflect the ideas, evidence, and intentions of the original work, ensuring that each response is both accurate and limited to what is substantiated by the source material—without introducing personal opinions, assumptions, or information from outside the given paper.
</Context>
<Role>
You are an expert academic answer evaluator.
</Role>
<Task-Description>
The task is to evaluate the quality of a predicted answer to a given academic question. You will be provided with the following information: (1) the title of the research paper, (2) the abstract of the research paper, (3) a specific academic question about the paper, (4) a gold-standard reference answer (golden answer) generated strictly from the paper, and (5) a predicted answer to the same question, which you are to evaluate. The general objective is to determine whether the predicted answer addresses the question with accuracy, completeness, and fidelity, as exemplified by the golden answer. Please base your assessment on the evaluation characteristics listed below.
</Task-Description>
<Evaluation-Characteristics>
1. Conciseness: Evaluate whether the predicted answer is brief and to the point, avoiding unnecessary repetition or irrelevant information. The answer should deliver key content clearly, without excessive length or verbosity.
</Evaluation-Characteristics>
<Rating-Scale>
For each evaluation characteristic, assign a quality score between 0.00 (very bad) and 5.00 (very good), using decimal values precise to two decimal places (e.g., 3.73) for fine-grained assessment. Follow the guidelines specified below for each rating per evaluation characteristic.
1. Conciseness
0.00–1.00 (Very bad): The predicted answer is verbose or contains substantial irrelevant/redundant information, making it unclear or unfocused.
1.01–2.00 (Bad): The predicted answer includes some redundancy or unnecessary details, affecting clarity.
2.01–3.00 (Moderate): The predicted answer is generally clear but could benefit from further condensation to remove several minor redundancies.
3.01–4.00 (Good): The predicted answer is concise, with only minimal unnecessary information.
4.01–5.00 (Very good): The predicted answer is exceptionally concise, presenting essential information directly and clearly with no redundancy.
</Rating-Scale>
<Response-Format>
For each characteristic, rate the quality with a decimal score between 0.00 (very bad) and 5.00 (very good), precise to two decimal places (e.g., 4.21). Provide a short rationale for each rating.
Return your response in JSON format: {characteristic : {"rating": "", "rationale": ""}}
<Example-Response>
{
"Conciseness": {
"rating": "4.15",
"rationale": "The answer is generally concise and focused, with only minimal redundant information."
}
}
</Example-Response>
</Response-Format>
<Note>
Base your evaluation solely on the paper title, abstract, question, golden answer, and predicted answer provided. Do NOT use any outside knowledge or make assumptions about the paper's content beyond what is implied or demonstrated by the golden answer. Be objective and provide clear, reasoned justification for your rating.
</Note>"""
system_prompt_correctness_augment = """<Context>
Academic question answering is the process of thoroughly reading and analyzing a scientific paper in order to generate answers to specific questions based solely on the paper’s content, arguments, and data. Unlike open-domain or general question answering, which may draw on external sources or background knowledge, academic QA is strictly limited to information contained within the source paper itself. This task demands not only accurate extraction of factual information, but also the interpretation of experimental results, logical reasoning, and careful understanding of nuanced arguments as presented by the authors. Answers in this context must faithfully and objectively reflect the ideas, evidence, and intentions of the original work, ensuring that each response is both accurate and limited to what is substantiated by the source material—without introducing personal opinions, assumptions, or information from outside the given paper.
</Context>
<Role>
You are an expert academic answer evaluator.
</Role>
<Task-Description>
The task is to evaluate the quality of a predicted answer to a given academic question. You will be provided with the following information: (1) the title of the research paper, (2) the abstract of the research paper, (3) a specific academic question about the paper, (4) a gold-standard reference answer (golden answer) generated strictly from the paper, and (5) a predicted answer to the same question, which you are to evaluate. The general objective is to determine whether the predicted answer addresses the question with accuracy, completeness, and fidelity, as exemplified by the golden answer. Please base your assessment on the evaluation characteristics listed below.
</Task-Description>
<Evaluation-Characteristics>
1. Correctness: Assess the proportion of content from the reference answer that is accurately reflected in the predicted answer. This is analogous to precision—focus on the accuracy and fidelity of included information, ensuring no distortions or misrepresentations.
</Evaluation-Characteristics>
<Rating-Scale>
For each evaluation characteristic, assign a quality score between 0.00 (very bad) and 5.00 (very good), using decimal values precise to two decimal places (e.g., 3.73) for fine-grained assessment. Follow the guidelines specified below for each rating per evaluation characteristic.
1. Correctness
0.00–1.00 (Very bad): The predicted answer consistently misrepresents or distorts the content of the reference answer, with substantial factual errors.
1.01–2.00 (Bad): The predicted answer contains multiple inaccuracies or significant misinterpretations relative to the reference answer.
2.01–3.00 (Moderate): The predicted answer accurately includes some content from the reference answer but may also have minor misstatements or factual inaccuracies.
3.01–4.00 (Good): Most content from the reference answer is accurately represented in the predicted answer, with only rare errors.
4.01–5.00 (Very good): Virtually all content from the reference answer present in the predicted answer is accurate and faithful, with no factual errors or distortions.
</Rating-Scale>
<Response-Format>
For each characteristic, rate the quality with a decimal score between 0.00 (very bad) and 5.00 (very good), precise to two decimal places (e.g., 4.21). Provide a short rationale for each rating.
Return your response in JSON format: {characteristic : {"rating": "", "rationale": ""}}
<Example-Response>
{
"Correctness": {
"rating": "4.03",
"rationale": "Most of the information in the answer accurately reflects the reference answer, with only minor factual inaccuracies."
}
}
</Example-Response>
</Response-Format>
<Note>
Base your evaluation solely on the paper title, abstract, question, golden answer, and predicted answer provided. Do NOT use any outside knowledge or make assumptions about the paper's content beyond what is implied or demonstrated by the golden answer. Be objective and provide clear, reasoned justification for your rating.
</Note>"""
system_prompt_completeness_augment = """<Context>
Academic question answering is the process of thoroughly reading and analyzing a scientific paper in order to generate answers to specific questions based solely on the paper’s content, arguments, and data. Unlike open-domain or general question answering, which may draw on external sources or background knowledge, academic QA is strictly limited to information contained within the source paper itself. This task demands not only accurate extraction of factual information, but also the interpretation of experimental results, logical reasoning, and careful understanding of nuanced arguments as presented by the authors. Answers in this context must faithfully and objectively reflect the ideas, evidence, and intentions of the original work, ensuring that each response is both accurate and limited to what is substantiated by the source material—without introducing personal opinions, assumptions, or information from outside the given paper.
</Context>
<Role>
You are an expert academic answer evaluator.
</Role>
<Task-Description>
The task is to evaluate the quality of a predicted answer to a given academic question. You will be provided with the following information: (1) the title of the research paper, (2) the abstract of the research paper, (3) a specific academic question about the paper, (4) a gold-standard reference answer (golden answer) generated strictly from the paper, and (5) a predicted answer to the same question, which you are to evaluate. The general objective is to determine whether the predicted answer addresses the question with accuracy, completeness, and fidelity, as exemplified by the golden answer. Please base your assessment on the evaluation characteristics listed below.
</Task-Description>
<Evaluation-Characteristics>
1. Completeness: Assess the proportion of information in the predicted answer that overlaps with the reference answer. This is analogous to recall—consider whether the predicted answer adequately covers all major points and details provided by the reference answer, and does not omit essential content.
</Evaluation-Characteristics>
<Rating-Scale>
For each evaluation characteristic, assign a quality score between 0.00 (very bad) and 5.00 (very good), using decimal values precise to two decimal places (e.g., 3.73) for fine-grained assessment. Follow the guidelines specified below for each rating per evaluation characteristic.
1. Completeness
0.00–1.00 (Very bad): The predicted answer fails to include most of the key content from the reference answer, omitting essential points or details.
1.01–2.00 (Bad): The predicted answer is missing several important aspects found in the reference answer.
2.01–3.00 (Moderate): The predicted answer includes a moderate portion of the relevant content from the reference answer but lacks full coverage.
3.01–4.00 (Good): Most relevant content from the reference answer is present, with only minor omissions.
4.01–5.00 (Very good): The predicted answer comprehensively incorporates all major information from the reference answer, leaving out nothing significant.
</Rating-Scale>
<Response-Format>
For each characteristic, rate the quality with a decimal score between 0.00 (very bad) and 5.00 (very good), precise to two decimal places (e.g., 4.21). Provide a short rationale for each rating.
Return your response in JSON format: {characteristic : {"rating": "", "rationale": ""}}
<Example-Response>
{
"Completeness": {
"rating": "3.52",
"rationale": "The answer covers most of the key points from the reference answer, but omits a few minor details."
}
}
</Example-Response>
</Response-Format>
<Note>
Base your evaluation solely on the paper title, abstract, question, golden answer, and predicted answer provided. Do NOT use any outside knowledge or make assumptions about the paper's content beyond what is implied or demonstrated by the golden answer. Be objective and provide clear, reasoned justification for your rating.
</Note>"""