Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion task_eval/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def eval_question_answering(qas, eval_key='prediction', metric='f1'):
if type(line[eval_key]) == list:
answer = line['answer']
else:
answer = str(line['answer'])
answer = str(line['answer']) if line['category'] != 5 else 'Not mentioned in the conversation'
if line['category'] == 3:
answer = answer.split(';')[0].strip()

Expand Down
8 changes: 4 additions & 4 deletions task_eval/gpt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ def get_gpt_answers(in_data, out_data, prediction_key, args):
elif qa['category'] == 5:
question = qa['question'] + " Select the correct answer: (a) {} (b) {}. "
if random.random() < 0.5:
question = question.format('Not mentioned in the conversation', qa['answer'])
answer = {'a': 'Not mentioned in the conversation', 'b': qa['answer']}
question = question.format('Not mentioned in the conversation', qa['adversarial_answer'])
answer = {'a': 'Not mentioned in the conversation', 'b': qa['adversarial_answer']}
else:
question = question.format(qa['answer'], 'Not mentioned in the conversation')
answer = {'b': 'Not mentioned in the conversation', 'a': qa['answer']}
question = question.format(qa['adversarial_answer'], 'Not mentioned in the conversation')
answer = {'b': 'Not mentioned in the conversation', 'a': qa['adversarial_answer']}

cat_5_idxs.append(len(questions))
questions.append(question)
Expand Down