Abinaya Mahendiran
commited on
Commit
·
5cd48c5
1
Parent(s):
9b8a5a3
Fixed minor bug in data preparation script
Browse files- data_preparation.py +2 -1
data_preparation.py
CHANGED
|
@@ -27,12 +27,13 @@ def add_gem_id(data: dict, split: str) -> dict:
|
|
| 27 |
"""
|
| 28 |
gem_id = -1
|
| 29 |
generated_data = {"data": []}
|
|
|
|
| 30 |
for example in data:
|
| 31 |
-
temp_dict = {}
|
| 32 |
title = example["title"]
|
| 33 |
for paragraph in example["paragraphs"]:
|
| 34 |
context = paragraph["context"] # do not strip leading blank spaces GH-2585
|
| 35 |
for qa in paragraph["qas"]:
|
|
|
|
| 36 |
question = qa["question"]
|
| 37 |
qa_id = qa["id"]
|
| 38 |
answer_starts = [answer["answer_start"] for answer in qa["answers"]]
|
|
|
|
| 27 |
"""
|
| 28 |
gem_id = -1
|
| 29 |
generated_data = {"data": []}
|
| 30 |
+
id_list =[]
|
| 31 |
for example in data:
|
|
|
|
| 32 |
title = example["title"]
|
| 33 |
for paragraph in example["paragraphs"]:
|
| 34 |
context = paragraph["context"] # do not strip leading blank spaces GH-2585
|
| 35 |
for qa in paragraph["qas"]:
|
| 36 |
+
temp_dict = {}
|
| 37 |
question = qa["question"]
|
| 38 |
qa_id = qa["id"]
|
| 39 |
answer_starts = [answer["answer_start"] for answer in qa["answers"]]
|