Skip to content

Commit d363b53

Browse files
authored
Merge pull request #94 from sbintuitions/feature/add-piqa
PIQAを追加
2 parents 573ae8a + 5679c47 commit d363b53

File tree

1 file changed

+46
-0
lines changed
  • flexeval/preset_configs/EvalSetup/en_multiple_choice

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
The PIQA dataset introduces the task of physical commonsense reasoning and a corresponding benchmark dataset
3+
4+
References:
5+
6+
* [Hugging Face Dataset](https://huggingface.co/datasets/ybisk/piqa)
7+
* [PIQA: Reasoning about Physical Commonsense in Natural Language](https://ojs.aaai.org/index.php/AAAI/article/view/6239)
8+
*/
9+
10+
local dataset_base_args = {
11+
path: 'ybisk/piqa',
12+
choices_templates: ['{{ sol1 }}', '{{ sol2 }}'],
13+
answer_index_template: '{{ label }}',
14+
whitespace_before_choices: true,
15+
dataset_kwargs: { trust_remote_code: true },
16+
};
17+
18+
{
19+
class_path: 'MultipleChoice',
20+
init_args: {
21+
eval_dataset: {
22+
class_path: 'HFMultipleChoiceDataset',
23+
init_args: dataset_base_args { split: 'validation' },
24+
},
25+
few_shot_generator: {
26+
class_path: 'RandomFewShotGenerator',
27+
init_args: {
28+
dataset: {
29+
class_path: 'HFMultipleChoiceDataset',
30+
init_args: dataset_base_args { split: 'train' },
31+
},
32+
num_shots: 4,
33+
},
34+
},
35+
prompt_template: {
36+
class_path: 'Jinja2PromptTemplate',
37+
init_args: {
38+
template: |||
39+
{% for item in few_shot_data %}
40+
{{ item.goal }}{{ item.choices[item.answer_index] }}
41+
{% endfor %}
42+
||| + '{{ goal }}',
43+
},
44+
},
45+
},
46+
}

0 commit comments

Comments
 (0)