openbookQA
Note
ID: catalog.cards.openbookQA | Type: TaskCard
{
"loader": {
"path": "openbookqa",
"type": "load_hf"
},
"preprocess_steps": [
{
"fields": {
"numbering": [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z"
],
"topic": "general continuation"
},
"type": "add_fields"
},
{
"field_to_field": {
"choices/label": "numbering",
"choices/text": "text"
},
"type": "rename_fields",
"use_query": true
},
{
"index_of": "answerKey",
"search_in": "numbering",
"to_field": "index",
"type": "index_of"
},
{
"field_to_field": {
"index": "_index",
"numbering": "_numbering",
"question_stem": "sentence1",
"text": "_text",
"topic": "topic"
},
"type": "rename_fields"
},
{
"field": "_numbering",
"index": "_index",
"to_field": "number",
"type": "take_by_field"
},
{
"field": "_text",
"index": "_index",
"to_field": "answer",
"type": "take_by_field"
},
{
"fields": [
"_numbering",
"_text"
],
"to_field": "choices",
"type": "zip_field_values"
},
{
"field": "choices/*",
"process_every_value": true,
"separator": ". ",
"to_field": "choices_list",
"type": "join_str",
"use_query": true
},
{
"field": "choices_list",
"index": "_index",
"to_field": "number_and_answer",
"type": "take_by_field"
},
{
"field": "choices/*/0",
"separator": ",",
"to_field": "numbers",
"type": "join_str",
"use_query": true
},
{
"add": [
""
],
"field": "choices_list",
"to_field": "choices_list",
"type": "add_constant"
},
{
"field": "choices_list",
"separator": "\n",
"to_field": "choices",
"type": "join_str"
},
{
"field_to_field": {
"number": "label"
},
"type": "rename_fields"
}
],
"task": {
"inputs": [
"choices",
"sentence1",
"numbers",
"topic"
],
"metrics": [
"metrics.accuracy"
],
"outputs": [
"label"
],
"type": "form_task"
},
"templates": "templates.qa.multiple_choice.original.all",
"type": "task_card"
}