roopalgarg commited on
Commit
49d6246
1 Parent(s): f0d9e03
Files changed (1) hide show
  1. imageinwords.py +5 -5
imageinwords.py CHANGED
@@ -129,27 +129,27 @@ class ImageInWords(datasets.GeneratorBasedBuilder):
129
  case "LocNar_Eval":
130
  return self._generate_examples_locnar_eval(filepath)
131
 
132
- def _generate_examples_iiw_400(filepath):
133
  with open(filepath) as fp:
134
  for json_line in fp:
135
  json_obj = json.loads(json_line.strip())
136
  json_obj["image/thumbnail_url"] = _DOCCI_AAR_THUMBNAIL_URL_PATTERN.substitute(IMAGE_KEY=json_obj["image/key"])
137
  yield json_obj["image/key"], json_obj
138
 
139
- def _generate_examples_dci_test(filepath):
140
  with open(filepath) as fp:
141
  for json_line in fp:
142
  json_obj = json.loads(json_line.strip())
143
  yield json_obj["image"], json_obj
144
 
145
- def _generate_examples_docci_test(filepath):
146
  with open(filepath) as fp:
147
  for json_line in fp:
148
  json_obj = json.loads(json_line.strip())
149
  json_obj["image/thumbnail_url"] = _DOCCI_AAR_THUMBNAIL_URL_PATTERN.substitute(IMAGE_KEY=json_obj["image"])
150
  yield json_obj["image"], json_obj
151
 
152
- def _generate_examples_cm_3600(filepath):
153
  with open(filepath) as fp:
154
  for json_line in fp:
155
  json_obj = json.loads(json_line.strip())
@@ -158,7 +158,7 @@ class ImageInWords(datasets.GeneratorBasedBuilder):
158
  yield json_obj["image/key"], json_obj
159
 
160
 
161
- def _generate_examples_locnar_eval(filepath):
162
  with open(filepath) as fp:
163
  for json_line in fp:
164
  json_obj = json.loads(json_line.strip())
 
129
  case "LocNar_Eval":
130
  return self._generate_examples_locnar_eval(filepath)
131
 
132
+ def _generate_examples_iiw_400(self, filepath):
133
  with open(filepath) as fp:
134
  for json_line in fp:
135
  json_obj = json.loads(json_line.strip())
136
  json_obj["image/thumbnail_url"] = _DOCCI_AAR_THUMBNAIL_URL_PATTERN.substitute(IMAGE_KEY=json_obj["image/key"])
137
  yield json_obj["image/key"], json_obj
138
 
139
+ def _generate_examples_dci_test(self, filepath):
140
  with open(filepath) as fp:
141
  for json_line in fp:
142
  json_obj = json.loads(json_line.strip())
143
  yield json_obj["image"], json_obj
144
 
145
+ def _generate_examples_docci_test(self, filepath):
146
  with open(filepath) as fp:
147
  for json_line in fp:
148
  json_obj = json.loads(json_line.strip())
149
  json_obj["image/thumbnail_url"] = _DOCCI_AAR_THUMBNAIL_URL_PATTERN.substitute(IMAGE_KEY=json_obj["image"])
150
  yield json_obj["image"], json_obj
151
 
152
+ def _generate_examples_cm_3600(self, filepath):
153
  with open(filepath) as fp:
154
  for json_line in fp:
155
  json_obj = json.loads(json_line.strip())
 
158
  yield json_obj["image/key"], json_obj
159
 
160
 
161
+ def _generate_examples_locnar_eval(self, filepath):
162
  with open(filepath) as fp:
163
  for json_line in fp:
164
  json_obj = json.loads(json_line.strip())