Change name variable for clarity
Browse files
gqa.py
CHANGED
@@ -55,9 +55,9 @@ class Gqa(datasets.GeneratorBasedBuilder):
|
|
55 |
def _info(self):
|
56 |
features = datasets.Features(
|
57 |
{
|
58 |
-
"
|
59 |
-
"img_id": datasets.Value("string"),
|
60 |
"question_id": datasets.Value("int32"),
|
|
|
61 |
"label": datasets.Value("int32"),
|
62 |
}
|
63 |
)
|
@@ -90,10 +90,10 @@ class Gqa(datasets.GeneratorBasedBuilder):
|
|
90 |
gqa = json.load(f)
|
91 |
for id_, d in enumerate(gqa):
|
92 |
img_id = os.path.join(img_dir, d["img_id"] + ".jpg")
|
93 |
-
label = self.ans2label[next(iter(d["label"]
|
94 |
yield id_, {
|
95 |
-
"
|
96 |
-
"img_id": img_id,
|
97 |
-
"label": label,
|
98 |
"question_id": d["question_id"],
|
|
|
|
|
99 |
}
|
|
|
55 |
def _info(self):
|
56 |
features = datasets.Features(
|
57 |
{
|
58 |
+
"question": datasets.Value("string"),
|
|
|
59 |
"question_id": datasets.Value("int32"),
|
60 |
+
"image_id": datasets.Value("string"),
|
61 |
"label": datasets.Value("int32"),
|
62 |
}
|
63 |
)
|
|
|
90 |
gqa = json.load(f)
|
91 |
for id_, d in enumerate(gqa):
|
92 |
img_id = os.path.join(img_dir, d["img_id"] + ".jpg")
|
93 |
+
label = self.ans2label[next(iter(d["label"]))]
|
94 |
yield id_, {
|
95 |
+
"question": d["sent"],
|
|
|
|
|
96 |
"question_id": d["question_id"],
|
97 |
+
"image_id": img_id,
|
98 |
+
"label": label,
|
99 |
}
|