Update README.md
Browse filesThe code breaks because it is trying to assign the new key `original_answer` to `outputs` which is a list. Instead the original answer can be written to the first element of the outputs list.
README.md
CHANGED
@@ -1182,7 +1182,7 @@ triviaqa_map = {}
|
|
1182 |
def add_missing_data(x, trivia_qa_subset, triviaqa_map):
|
1183 |
i = triviaqa_map[x['id']]
|
1184 |
x['input'] = trivia_qa_subset[i]['question']
|
1185 |
-
x['output']['original_answer'] = trivia_qa_subset[i]['answer']['value']
|
1186 |
return x
|
1187 |
|
1188 |
for k in ['train', 'validation', 'test']:
|
|
|
1182 |
def add_missing_data(x, trivia_qa_subset, triviaqa_map):
|
1183 |
i = triviaqa_map[x['id']]
|
1184 |
x['input'] = trivia_qa_subset[i]['question']
|
1185 |
+
x['output'][0]['original_answer'] = trivia_qa_subset[i]['answer']['value']
|
1186 |
return x
|
1187 |
|
1188 |
for k in ['train', 'validation', 'test']:
|