yonatanbitton
commited on
Commit
·
ad72872
1
Parent(s):
418b053
Update vasr.py
Browse files
vasr.py
CHANGED
@@ -44,6 +44,8 @@ class Vasr(datasets.GeneratorBasedBuilder):
|
|
44 |
datasets.BuilderConfig(name="v1", version=VERSION, description="vasr gold test dataset"),
|
45 |
]
|
46 |
DATASET_KEYS = ["A", "A'", "B", "B'", 'candidates', 'label', "A_str", "A'_str", "B_str", "B'_str"]
|
|
|
|
|
47 |
|
48 |
def _info(self):
|
49 |
features = datasets.Features(
|
@@ -112,8 +114,12 @@ class Vasr(datasets.GeneratorBasedBuilder):
|
|
112 |
r_dict["A'_str"] = r_dict['B_img']
|
113 |
r_dict["B_str"] = r_dict['C_img']
|
114 |
r_dict["B'_str"] = r_dict['D_img']
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
|
|
117 |
r_dict["A"] = r_dict['A_img']
|
118 |
r_dict["A'"] = r_dict['B_img']
|
119 |
r_dict["B"] = r_dict['C_img']
|
|
|
44 |
datasets.BuilderConfig(name="v1", version=VERSION, description="vasr gold test dataset"),
|
45 |
]
|
46 |
DATASET_KEYS = ["A", "A'", "B", "B'", 'candidates', 'label', "A_str", "A'_str", "B_str", "B'_str"]
|
47 |
+
HIDDEN_LABEL = '? (hidden)'
|
48 |
+
QMARK_IMG = 'qmark.png'
|
49 |
|
50 |
def _info(self):
|
51 |
features = datasets.Features(
|
|
|
114 |
r_dict["A'_str"] = r_dict['B_img']
|
115 |
r_dict["B_str"] = r_dict['C_img']
|
116 |
r_dict["B'_str"] = r_dict['D_img']
|
117 |
+
img_list = ['A_img', 'B_img', 'C_img', 'D_img']
|
118 |
+
for img in :
|
119 |
+
if r_dict[img] == self.HIDDEN_LABEL:
|
120 |
+
r_dict[img] = os.path.join(images_dir, "vasr_images", QMARK_IMG)
|
121 |
+
else:
|
122 |
+
r_dict[img] = os.path.join(images_dir, "vasr_images", r_dict[img])
|
123 |
r_dict["A"] = r_dict['A_img']
|
124 |
r_dict["A'"] = r_dict['B_img']
|
125 |
r_dict["B"] = r_dict['C_img']
|