-
Notifications
You must be signed in to change notification settings - Fork 23
/
detect_instruct.py
39 lines (33 loc) · 2.13 KB
/
detect_instruct.py
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
code_instruct ="""I will now give you two programs. I will enclose the two questions with curly braces \{\}.
Please help me determine if the following two programs address the same problem.
Disregarding their implementation methods, please consider only their objectives, inputs, and outputs.
If they are, please answer 'True', otherwise answer 'False'. Do not respond with anything else.
"""
strong_math_instruct ="""I will now give you two questions. I will enclose the two questions with curly braces \{\}.
Please help me determine if the following two questions are the same.
Disregard the names, numbers, and minor changes in word order that appear within.
If they are, please answer 'True', otherwise answer 'False'. Do not respond with anything else.
"""
math_instruct ="""I will now give you two questions. I will enclose the two questions with curly braces \{\}.
Please help me determine if the following two questions are the same.
Disregard the names and minor changes in word order that appear within.
If they are, please answer 'True', otherwise answer 'False'. Do not respond with anything else.
If their question prompts are very similar and, without considering the solution process, they produce the same answer, we consider them to be the same question.
"""
knowledge_instruct ="""I will now give you two questions. I will enclose the two questions with curly braces \{\}.
Please help me determine if the following two questions are the same.
Disregard the names and minor changes in word order that appear within.
If they are, please answer 'True', otherwise answer 'False'. Do not respond with anything else.
If their question prompts are very similar and, without considering the solution process, they produce the same answer, we consider them to be the same question.
"""
def datatype_to_instruct(data_type):
if data_type == "code":
return code_instruct
elif data_type == "number_substitution":
return strong_math_instruct
elif data_type == "math":
return math_instruct
elif data_type == "knowledge":
return knowledge_instruct
else:
raise Exception("Invalid data type: {}".format(data_type))