Skip to content

Commit

Permalink
fix json sheet bugs2
Browse files Browse the repository at this point in the history
  • Loading branch information
rayguan97 committed Nov 13, 2023
1 parent e286d13 commit b6508da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion HallusionBench.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion tsv_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def get_image_file_location(root, row):
tsv_file = csv.reader(file, delimiter="\t")
flag = 0
for line in tsv_file:
if line[0] not in ["VD", "VS"]:
# if line[0] not in ["VD", "VS"]:
# if line[0] in ["NOTE", "category"]:
if "VD" not in line[0] and "VS" not in line[0]:
continue
data_dict = {}
try:
Expand Down
5 changes: 4 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ def check_same_by_chatgpt(data, output_entry, gpt_model="gpt-4", load_json=False
for sample in tqdm(data):
if "same" not in sample.keys():
key = "_".join([sample["category"], sample["subcategory"], str(sample["set_id"]), str(sample["question_id"])])
response2 = orig_response[key]
try:
response2 = orig_response[key]
except:
from IPython import embed;embed()
prompt = 'Imagine you are an intelligent teacher. Thoroughly read the two responses to two different questions. Assess the consistency of the information provided within those two responses. '
prompt += 'You do not know the specific questions, but you can asssess the consistency among the two responses by checking for logical conflicts if both responses are correct. '
prompt += 'If response1 does not conflict with response2, please generate “same”. Otherwise, generate "different". \n\n response1:'
Expand Down

0 comments on commit b6508da

Please sign in to comment.