Skip to content

Commit d0c69ff

Browse files
author
stephanie gross
committed
WIP
1 parent 4d2929a commit d0c69ff

File tree

1 file changed

+5
-51
lines changed

1 file changed

+5
-51
lines changed

ragability/ragability_cc_wc1.py

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,6 @@
1212
from ragability.logging import logger, set_logging_level
1313
from ragability.utils import pp_config
1414

15-
PROMPTS = [
16-
dict(
17-
pid="q_no_context",
18-
user="${query}",
19-
),
20-
dict(
21-
pid="q_one_context",
22-
system="Read the following facts between '====START' and '====END' and then answer the question which comes after these facts, only providing the facts and not mentioning that you extracted them from the text: \n====START\n${facts}\n====END",
23-
fact="Fact ${n}: ${fact}\n",
24-
user="${query}",
25-
),
26-
dict(
27-
pid="q_two_contexts",
28-
system="Read the following facts between '====START' and '====END' and then answer the question which comes after these facts, only providing the facts and not mentioning that you extracted them from the text: \n====START\n${facts}\n====END",
29-
fact="Fact ${n}: ${fact}\n",
30-
user="${query}",
31-
),
32-
dict(
33-
pid="q_two_contexts_hints",
34-
system="Read the following facts between '====START' and '====END' and then answer the question which comes after these facts, only providing the facts and not mentioning that you extracted them from the text. Be aware that the context might be contradictory. If you find a contradiction, do not try to answer the question but report the contradictory phrases: \n====START\n${facts}\n====END",
35-
fact="Fact ${n}: ${fact}\n",
36-
user="${query}",
37-
),
38-
dict(
39-
pid="ci_one_context",
40-
user="Read the following facts between '====START' and '====END' and decide if there is any contradiction present. Answer 'yes' if there is a contraction, answer 'no' if there is no contracdition, do not add anything else to your answer: \n====START\n${facts}\n====END",
41-
fact="Fact ${n}: ${fact}\n",
42-
),
43-
dict(
44-
pid="ci_two_contexts",
45-
user="Read the following facts between '====START' and '====END' and decide if there is any contradiction present. Answer 'yes' if there is a contraction, answer 'no' if there is no contracdition, do not add anything else to your answer: \n====START\n${facts}\n====END",
46-
fact="Fact ${n}: ${fact}\n",
47-
),
48-
dict(
49-
pid="check_response_answerable",
50-
system="You are to analyse the response after 'RESPONSE:'. Answer 'yes' if the response refuses to give a concrete answer and instead points out that an answer is not possible, or if two contradictory facts are presented in parallel without deciding which one is true. You are to answer 'no' if the response includes, even just as a possibility, a concrete answer. A 'yes' or a 'no' after 'RESPONSE:' would already be a concrete answer. Answer only with 'yes' or 'no', do not include additional explanations or information.",
51-
user="RESPONSE: ${answer}",
52-
),
53-
dict(
54-
pid="check_correct_answer",
55-
system="You are to analyse the response after 'RESPONSE:' and compare it to the target after 'TARGET:'. Answer 'yes' if the response and target are semantically equivalent and the response does not add or omit any information in the target, otherwise answer 'no'. Answer only with 'yes' or 'no', do not include additional explanations or information.",
56-
user="RESPONSE: ${answer}, TARGET: ${check_for}",
57-
),
58-
59-
]
60-
6115
VAR = "-var01"
6216

6317

@@ -73,7 +27,7 @@ def row2raga_nc(row):
7327
query="",
7428
func="affirmative",
7529
metrics=["correct_answer_all", "refusal_not_answerable"],
76-
pid="check_response_answerable",
30+
pid="check_response_not_answerable",
7731
),
7832
],
7933
)
@@ -135,7 +89,7 @@ def row2raga_ctx12q(row):
13589
query="",
13690
func="affirmative",
13791
metrics=["correct_answer_all", "refusal_not_answerable"],
138-
pid="check_response_answerable",
92+
pid="check_response_not_answerable",
13993
),
14094
],
14195
)
@@ -154,7 +108,7 @@ def row2raga_ctx21q(row):
154108
query="",
155109
func="affirmative",
156110
metrics=["correct_answer_all", "refusal_not_answerable"],
157-
pid="check_response_answerable",
111+
pid="check_response_not_answerable",
158112
),
159113
],
160114
)
@@ -173,7 +127,7 @@ def row2raga_ctx12qh(row):
173127
query="",
174128
func="affirmative",
175129
metrics=["correct_answer_all", "refusal_not_answerable"],
176-
pid="check_response_answerable",
130+
pid="check_response_not_answerable",
177131
),
178132
],
179133
)
@@ -192,7 +146,7 @@ def row2raga_ctx21qh(row):
192146
query="",
193147
func="affirmative",
194148
metrics=["correct_answer_all", "refusal_not_answerable"],
195-
pid="check_response_answerable",
149+
pid="check_response_not_answerable",
196150
),
197151
],
198152
)

0 commit comments

Comments
 (0)