fix img path + take off logging
Browse files- SNLI-VE.py +1 -5
SNLI-VE.py
CHANGED
|
@@ -80,9 +80,7 @@ class SNLIVE(datasets.GeneratorBasedBuilder):
|
|
| 80 |
|
| 81 |
|
| 82 |
DEFAULT_CONFIG_NAME = "Default"
|
| 83 |
-
logger.warning("HER0")
|
| 84 |
def _info(self):
|
| 85 |
-
logger.warning("HERE1")
|
| 86 |
return datasets.DatasetInfo(
|
| 87 |
description=_DESCRIPTION,
|
| 88 |
features=_FEATURES,
|
|
@@ -92,7 +90,6 @@ class SNLIVE(datasets.GeneratorBasedBuilder):
|
|
| 92 |
)
|
| 93 |
|
| 94 |
def _split_generators(self, dl_manager):
|
| 95 |
-
logger.warning("HERE2")
|
| 96 |
urls = {
|
| 97 |
"Default": {
|
| 98 |
"train": os.path.join(_SNLI_VE_URL_BASE, _SNLI_VE_SPLITS["train"]),
|
|
@@ -132,7 +129,6 @@ class SNLIVE(datasets.GeneratorBasedBuilder):
|
|
| 132 |
|
| 133 |
def _generate_examples(self, snli_ve_annotation_path, images_path):
|
| 134 |
counter = 0
|
| 135 |
-
logger.warning("HERE3")
|
| 136 |
print(snli_ve_annotation_path)
|
| 137 |
with open(snli_ve_annotation_path, 'r') as json_file:
|
| 138 |
for elem in json_file:
|
|
@@ -140,7 +136,7 @@ class SNLIVE(datasets.GeneratorBasedBuilder):
|
|
| 140 |
img_filename = str(elem["Flickr30K_ID"]) + ".jpg"
|
| 141 |
assert os.path.exists(os.path.join(images_path, img_filename))
|
| 142 |
record = {
|
| 143 |
-
"image": img_filename,
|
| 144 |
"filename": img_filename,
|
| 145 |
"premise": elem["sentence1"],
|
| 146 |
"hypothesis": elem["sentence2"],
|
|
|
|
| 80 |
|
| 81 |
|
| 82 |
DEFAULT_CONFIG_NAME = "Default"
|
|
|
|
| 83 |
def _info(self):
|
|
|
|
| 84 |
return datasets.DatasetInfo(
|
| 85 |
description=_DESCRIPTION,
|
| 86 |
features=_FEATURES,
|
|
|
|
| 90 |
)
|
| 91 |
|
| 92 |
def _split_generators(self, dl_manager):
|
|
|
|
| 93 |
urls = {
|
| 94 |
"Default": {
|
| 95 |
"train": os.path.join(_SNLI_VE_URL_BASE, _SNLI_VE_SPLITS["train"]),
|
|
|
|
| 129 |
|
| 130 |
def _generate_examples(self, snli_ve_annotation_path, images_path):
|
| 131 |
counter = 0
|
|
|
|
| 132 |
print(snli_ve_annotation_path)
|
| 133 |
with open(snli_ve_annotation_path, 'r') as json_file:
|
| 134 |
for elem in json_file:
|
|
|
|
| 136 |
img_filename = str(elem["Flickr30K_ID"]) + ".jpg"
|
| 137 |
assert os.path.exists(os.path.join(images_path, img_filename))
|
| 138 |
record = {
|
| 139 |
+
"image": os.path.join(images_path, img_filename),
|
| 140 |
"filename": img_filename,
|
| 141 |
"premise": elem["sentence1"],
|
| 142 |
"hypothesis": elem["sentence2"],
|