Skip to content

KeyError when running run_truthfulness #42

Description

@gauravjain14

I checked the codah dataset and I don't see the res key in there. Also sharing a snapshot of the dataset.

KeyError: 'res'
'res'

Source Code Path -

def eval_internal_codah(self, data):

for item in codah_data:
            response = item['res']
            prediction = re.findall(r"\d+", response)[0] if re.findall(r"\d+", response) else "-1"
            predictions.append(prediction)

Item Keys dict_keys(['prompt', 'answer', 'source', 'question']), Values dict_values(['Choose the most appropriate answer from a set of candidate answers, using common sense as the criteria.\n Only return the number of your selected option without any reasons and explanations.\n Here are two examples:\n\n Question: The professional golfer went to the course to practice. He\n 0. putted well\n 1. practiced putting away the green cart\n 2. practiced basketball\n 3. shot a little birdie\n Answer: 0\n\n Question: The dog chased the rabbit. The rabbit\n 0. got a new identity\n 1. ate the dog\n 2. fled the country\n 3. died\n Answer: 3 \n\n Here is the question:\n Question: A liar puts on his pants. They\n 0: are chinos.\n 1: are on fire.\n 2: wants to graduate in the spring.\n 3: are claustrophobic.\n Return only the number of your selected option without any other words including reasons and explanations, the format of the answer should be: Answer: [your answer].', 1, 'codah', 'A liar puts on his pants. They'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions