parquet-converter commited on
Commit
1aacd52
·
1 Parent(s): 2dfec17

Update parquet files

Browse files
.gitattributes DELETED
@@ -1,27 +0,0 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bin.* filter=lfs diff=lfs merge=lfs -text
5
- *.bz2 filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.model filter=lfs diff=lfs merge=lfs -text
12
- *.msgpack filter=lfs diff=lfs merge=lfs -text
13
- *.onnx filter=lfs diff=lfs merge=lfs -text
14
- *.ot filter=lfs diff=lfs merge=lfs -text
15
- *.parquet filter=lfs diff=lfs merge=lfs -text
16
- *.pb filter=lfs diff=lfs merge=lfs -text
17
- *.pt filter=lfs diff=lfs merge=lfs -text
18
- *.pth filter=lfs diff=lfs merge=lfs -text
19
- *.rar filter=lfs diff=lfs merge=lfs -text
20
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
- *.tar.* filter=lfs diff=lfs merge=lfs -text
22
- *.tflite filter=lfs diff=lfs merge=lfs -text
23
- *.tgz filter=lfs diff=lfs merge=lfs -text
24
- *.xz filter=lfs diff=lfs merge=lfs -text
25
- *.zip filter=lfs diff=lfs merge=lfs -text
26
- *.zstandard filter=lfs diff=lfs merge=lfs -text
27
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md DELETED
@@ -1,432 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - machine-generated
4
- language:
5
- - en
6
- language_creators:
7
- - found
8
- license:
9
- - unknown
10
- multilinguality:
11
- - monolingual
12
- pretty_name: CompGuessWhat?!
13
- size_categories:
14
- - 100K<n<1M
15
- source_datasets:
16
- - extended|other-guesswhat
17
- task_categories:
18
- - visual-question-answering
19
- task_ids:
20
- - visual-question-answering
21
- paperswithcode_id: compguesswhat
22
- dataset_info:
23
- - config_name: compguesswhat-original
24
- features:
25
- - name: id
26
- dtype: int32
27
- - name: target_id
28
- dtype: int32
29
- - name: timestamp
30
- dtype: string
31
- - name: status
32
- dtype: string
33
- - name: image
34
- struct:
35
- - name: id
36
- dtype: int32
37
- - name: file_name
38
- dtype: string
39
- - name: flickr_url
40
- dtype: string
41
- - name: coco_url
42
- dtype: string
43
- - name: height
44
- dtype: int32
45
- - name: width
46
- dtype: int32
47
- - name: visual_genome
48
- struct:
49
- - name: width
50
- dtype: int32
51
- - name: height
52
- dtype: int32
53
- - name: url
54
- dtype: string
55
- - name: coco_id
56
- dtype: int32
57
- - name: flickr_id
58
- dtype: string
59
- - name: image_id
60
- dtype: string
61
- - name: qas
62
- sequence:
63
- - name: question
64
- dtype: string
65
- - name: answer
66
- dtype: string
67
- - name: id
68
- dtype: int32
69
- - name: objects
70
- sequence:
71
- - name: id
72
- dtype: int32
73
- - name: bbox
74
- sequence: float32
75
- length: 4
76
- - name: category
77
- dtype: string
78
- - name: area
79
- dtype: float32
80
- - name: category_id
81
- dtype: int32
82
- - name: segment
83
- sequence:
84
- sequence: float32
85
- splits:
86
- - name: train
87
- num_bytes: 126548689
88
- num_examples: 46341
89
- - name: validation
90
- num_bytes: 26055261
91
- num_examples: 9738
92
- - name: test
93
- num_bytes: 25981593
94
- num_examples: 9621
95
- download_size: 107201655
96
- dataset_size: 178585543
97
- - config_name: compguesswhat-zero_shot
98
- features:
99
- - name: id
100
- dtype: int32
101
- - name: target_id
102
- dtype: string
103
- - name: status
104
- dtype: string
105
- - name: image
106
- struct:
107
- - name: id
108
- dtype: int32
109
- - name: file_name
110
- dtype: string
111
- - name: coco_url
112
- dtype: string
113
- - name: height
114
- dtype: int32
115
- - name: width
116
- dtype: int32
117
- - name: license
118
- dtype: int32
119
- - name: open_images_id
120
- dtype: string
121
- - name: date_captured
122
- dtype: string
123
- - name: objects
124
- sequence:
125
- - name: id
126
- dtype: string
127
- - name: bbox
128
- sequence: float32
129
- length: 4
130
- - name: category
131
- dtype: string
132
- - name: area
133
- dtype: float32
134
- - name: category_id
135
- dtype: int32
136
- - name: IsOccluded
137
- dtype: int32
138
- - name: IsTruncated
139
- dtype: int32
140
- - name: segment
141
- sequence:
142
- - name: MaskPath
143
- dtype: string
144
- - name: LabelName
145
- dtype: string
146
- - name: BoxID
147
- dtype: string
148
- - name: BoxXMin
149
- dtype: string
150
- - name: BoxXMax
151
- dtype: string
152
- - name: BoxYMin
153
- dtype: string
154
- - name: BoxYMax
155
- dtype: string
156
- - name: PredictedIoU
157
- dtype: string
158
- - name: Clicks
159
- dtype: string
160
- splits:
161
- - name: nd_valid
162
- num_bytes: 13557059
163
- num_examples: 5343
164
- - name: nd_test
165
- num_bytes: 36352201
166
- num_examples: 13836
167
- - name: od_valid
168
- num_bytes: 14093233
169
- num_examples: 5372
170
- - name: od_test
171
- num_bytes: 33049755
172
- num_examples: 13300
173
- download_size: 4845966
174
- dataset_size: 97052248
175
- ---
176
-
177
- # Dataset Card for "compguesswhat"
178
-
179
- ## Table of Contents
180
- - [Dataset Description](#dataset-description)
181
- - [Dataset Summary](#dataset-summary)
182
- - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
183
- - [Languages](#languages)
184
- - [Dataset Structure](#dataset-structure)
185
- - [Data Instances](#data-instances)
186
- - [Data Fields](#data-fields)
187
- - [Data Splits](#data-splits)
188
- - [Dataset Creation](#dataset-creation)
189
- - [Curation Rationale](#curation-rationale)
190
- - [Source Data](#source-data)
191
- - [Annotations](#annotations)
192
- - [Personal and Sensitive Information](#personal-and-sensitive-information)
193
- - [Considerations for Using the Data](#considerations-for-using-the-data)
194
- - [Social Impact of Dataset](#social-impact-of-dataset)
195
- - [Discussion of Biases](#discussion-of-biases)
196
- - [Other Known Limitations](#other-known-limitations)
197
- - [Additional Information](#additional-information)
198
- - [Dataset Curators](#dataset-curators)
199
- - [Licensing Information](#licensing-information)
200
- - [Citation Information](#citation-information)
201
- - [Contributions](#contributions)
202
-
203
- ## Dataset Description
204
-
205
- - **Homepage:** [https://compguesswhat.github.io/](https://compguesswhat.github.io/)
206
- - **Repository:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
207
- - **Paper:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
208
- - **Point of Contact:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
209
- - **Size of downloaded dataset files:** 106.86 MB
210
- - **Size of the generated dataset:** 258.55 MB
211
- - **Total amount of disk used:** 365.41 MB
212
-
213
- ### Dataset Summary
214
-
215
- CompGuessWhat?! is an instance of a multi-task framework for evaluating the quality of learned neural representations,
216
- in particular concerning attribute grounding. Use this dataset if you want to use the set of games whose reference
217
- scene is an image in VisualGenome. Visit the website for more details: https://compguesswhat.github.io
218
-
219
- ### Supported Tasks and Leaderboards
220
-
221
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
222
-
223
- ### Languages
224
-
225
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
226
-
227
- ## Dataset Structure
228
-
229
- ### Data Instances
230
-
231
- #### compguesswhat-original
232
-
233
- - **Size of downloaded dataset files:** 102.24 MB
234
- - **Size of the generated dataset:** 166.29 MB
235
- - **Total amount of disk used:** 268.53 MB
236
-
237
- An example of 'validation' looks as follows.
238
- ```
239
- This example was too long and was cropped:
240
-
241
- {
242
- "id": 2424,
243
- "image": "{\"coco_url\": \"http://mscoco.org/images/270512\", \"file_name\": \"COCO_train2014_000000270512.jpg\", \"flickr_url\": \"http://farm6.stat...",
244
- "objects": "{\"area\": [1723.5133056640625, 4838.5361328125, 287.44476318359375, 44918.7109375, 3688.09375, 522.1935424804688], \"bbox\": [[5.61...",
245
- "qas": {
246
- "answer": ["Yes", "No", "No", "Yes"],
247
- "id": [4983, 4996, 5006, 5017],
248
- "question": ["Is it in the foreground?", "Does it have wings?", "Is it a person?", "Is it a vehicle?"]
249
- },
250
- "status": "success",
251
- "target_id": 1197044,
252
- "timestamp": "2016-07-08 15:07:38"
253
- }
254
- ```
255
-
256
- #### compguesswhat-zero_shot
257
-
258
- - **Size of downloaded dataset files:** 4.62 MB
259
- - **Size of the generated dataset:** 92.26 MB
260
- - **Total amount of disk used:** 96.88 MB
261
-
262
- An example of 'nd_valid' looks as follows.
263
- ```
264
- This example was too long and was cropped:
265
-
266
- {
267
- "id": 0,
268
- "image": {
269
- "coco_url": "https://s3.amazonaws.com/nocaps/val/004e21eb2e686f40.jpg",
270
- "date_captured": "2018-11-06 11:04:33",
271
- "file_name": "004e21eb2e686f40.jpg",
272
- "height": 1024,
273
- "id": 6,
274
- "license": 0,
275
- "open_images_id": "004e21eb2e686f40",
276
- "width": 768
277
- },
278
- "objects": "{\"IsOccluded\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"IsTruncated\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"area\": [3...",
279
- "status": "incomplete",
280
- "target_id": "004e21eb2e686f40_30"
281
- }
282
- ```
283
-
284
- ### Data Fields
285
-
286
- The data fields are the same among all splits.
287
-
288
- #### compguesswhat-original
289
- - `id`: a `int32` feature.
290
- - `target_id`: a `int32` feature.
291
- - `timestamp`: a `string` feature.
292
- - `status`: a `string` feature.
293
- - `id`: a `int32` feature.
294
- - `file_name`: a `string` feature.
295
- - `flickr_url`: a `string` feature.
296
- - `coco_url`: a `string` feature.
297
- - `height`: a `int32` feature.
298
- - `width`: a `int32` feature.
299
- - `width`: a `int32` feature.
300
- - `height`: a `int32` feature.
301
- - `url`: a `string` feature.
302
- - `coco_id`: a `int32` feature.
303
- - `flickr_id`: a `string` feature.
304
- - `image_id`: a `string` feature.
305
- - `qas`: a dictionary feature containing:
306
- - `question`: a `string` feature.
307
- - `answer`: a `string` feature.
308
- - `id`: a `int32` feature.
309
- - `objects`: a dictionary feature containing:
310
- - `id`: a `int32` feature.
311
- - `bbox`: a `list` of `float32` features.
312
- - `category`: a `string` feature.
313
- - `area`: a `float32` feature.
314
- - `category_id`: a `int32` feature.
315
- - `segment`: a dictionary feature containing:
316
- - `feature`: a `float32` feature.
317
-
318
- #### compguesswhat-zero_shot
319
- - `id`: a `int32` feature.
320
- - `target_id`: a `string` feature.
321
- - `status`: a `string` feature.
322
- - `id`: a `int32` feature.
323
- - `file_name`: a `string` feature.
324
- - `coco_url`: a `string` feature.
325
- - `height`: a `int32` feature.
326
- - `width`: a `int32` feature.
327
- - `license`: a `int32` feature.
328
- - `open_images_id`: a `string` feature.
329
- - `date_captured`: a `string` feature.
330
- - `objects`: a dictionary feature containing:
331
- - `id`: a `string` feature.
332
- - `bbox`: a `list` of `float32` features.
333
- - `category`: a `string` feature.
334
- - `area`: a `float32` feature.
335
- - `category_id`: a `int32` feature.
336
- - `IsOccluded`: a `int32` feature.
337
- - `IsTruncated`: a `int32` feature.
338
- - `segment`: a dictionary feature containing:
339
- - `MaskPath`: a `string` feature.
340
- - `LabelName`: a `string` feature.
341
- - `BoxID`: a `string` feature.
342
- - `BoxXMin`: a `string` feature.
343
- - `BoxXMax`: a `string` feature.
344
- - `BoxYMin`: a `string` feature.
345
- - `BoxYMax`: a `string` feature.
346
- - `PredictedIoU`: a `string` feature.
347
- - `Clicks`: a `string` feature.
348
-
349
- ### Data Splits
350
-
351
- #### compguesswhat-original
352
-
353
- | |train|validation|test|
354
- |----------------------|----:|---------:|---:|
355
- |compguesswhat-original|46341| 9738|9621|
356
-
357
- #### compguesswhat-zero_shot
358
-
359
- | |nd_valid|od_valid|nd_test|od_test|
360
- |-----------------------|-------:|-------:|------:|------:|
361
- |compguesswhat-zero_shot| 5343| 5372| 13836| 13300|
362
-
363
- ## Dataset Creation
364
-
365
- ### Curation Rationale
366
-
367
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
368
-
369
- ### Source Data
370
-
371
- #### Initial Data Collection and Normalization
372
-
373
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
374
-
375
- #### Who are the source language producers?
376
-
377
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
378
-
379
- ### Annotations
380
-
381
- #### Annotation process
382
-
383
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
384
-
385
- #### Who are the annotators?
386
-
387
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
388
-
389
- ### Personal and Sensitive Information
390
-
391
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
392
-
393
- ## Considerations for Using the Data
394
-
395
- ### Social Impact of Dataset
396
-
397
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
398
-
399
- ### Discussion of Biases
400
-
401
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
402
-
403
- ### Other Known Limitations
404
-
405
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
406
-
407
- ## Additional Information
408
-
409
- ### Dataset Curators
410
-
411
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
412
-
413
- ### Licensing Information
414
-
415
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
416
-
417
- ### Citation Information
418
-
419
- ```
420
- @inproceedings{suglia2020compguesswhat,
421
- title={CompGuessWhat?!: a Multi-task Evaluation Framework for Grounded Language Learning},
422
- author={Suglia, Alessandro, Konstas, Ioannis, Vanzo, Andrea, Bastianelli, Emanuele, Desmond Elliott, Stella Frank and Oliver Lemon},
423
- booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
424
- year={2020}
425
- }
426
-
427
- ```
428
-
429
-
430
- ### Contributions
431
-
432
- Thanks to [@thomwolf](https://github.com/thomwolf), [@aleSuglia](https://github.com/aleSuglia), [@lhoestq](https://github.com/lhoestq) for adding this dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
compguesswhat-original/compguesswhat-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ddc354838f488cddec4945118ec1a17fba51d8c97f0d0d2d64a070862b1cdd1
3
+ size 15268652
compguesswhat-original/compguesswhat-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8df995decaf82975e666b12e29684334cbdd8f263635bc88023bd164fd60e457
3
+ size 74763808
compguesswhat-original/compguesswhat-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a1a7507f46288574dd5175c61861ec18dadd5f33439cfb5d555718ac44c14ab
3
+ size 15317296
compguesswhat-zero_shot/compguesswhat-nd_test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a437de08f2e03d83ffe850c6d1ea38fc118635c5eeff26ddd400c07bbf19a428
3
+ size 2434267
compguesswhat-zero_shot/compguesswhat-nd_valid.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6935e2db53ce196a2b5ea805194badd2ad4e25cf9ac3810a1585cbeff07c60f
3
+ size 929561
compguesswhat-zero_shot/compguesswhat-od_test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:082b8b48a877873eb1d50a34f50d86bbab7cf4c3dcd397847e3dc8f20607ca4a
3
+ size 2255580
compguesswhat-zero_shot/compguesswhat-od_valid.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df95d3f334ded5a5a701bd5eeecb7d81092c7a0c9d202a2c1d86be9da46c18cd
3
+ size 929400
compguesswhat.py DELETED
@@ -1,254 +0,0 @@
1
- import gzip
2
- import json
3
- import os
4
-
5
- import datasets
6
-
7
-
8
- class CompguesswhatConfig(datasets.BuilderConfig):
9
- """BuilderConfig for CompGuessWhat?!"""
10
-
11
- def __init__(self, data_url, splits, gameplay_scenario, **kwargs):
12
- """
13
-
14
- Args:
15
- gameplay_scenario: to specify if we want to load original CompGuessWhat?! split ('original') or
16
- the zero-shot reference games based on NOCAPS images ('zero_shot')
17
- **kwargs: keyword arguments forwarded to super.
18
- """
19
- super(CompguesswhatConfig, self).__init__(
20
- version=datasets.Version("0.2.0", "Second CompGuessWhat?! release"), **kwargs
21
- )
22
- assert gameplay_scenario in (
23
- "original",
24
- "zero_shot",
25
- ), "Invalid choice for parameter 'gameplay_scenario': {gameplay_scenario}. Valid values are ('original', 'zero_shot')."
26
-
27
- self.gameplay_scenario = gameplay_scenario
28
- self.splits = splits
29
- self.data_url = data_url
30
-
31
-
32
- class Compguesswhat(datasets.GeneratorBasedBuilder):
33
- _CITATION = """\
34
- @inproceedings{suglia2020compguesswhat,
35
- title={CompGuessWhat?!: a Multi-task Evaluation Framework for Grounded Language Learning},
36
- author={Suglia, Alessandro, Konstas, Ioannis, Vanzo, Andrea, Bastianelli, Emanuele, Desmond Elliott, Stella Frank and Oliver Lemon},
37
- booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
38
- year={2020}
39
- }
40
- """
41
-
42
- _DESCRIPTION = """
43
- CompGuessWhat?! is an instance of a multi-task framework for evaluating the quality of learned neural representations,
44
- in particular concerning attribute grounding. Use this dataset if you want to use the set of games whose reference
45
- scene is an image in VisualGenome. Visit the website for more details: https://compguesswhat.github.io
46
- """
47
-
48
- BUILDER_CONFIGS = [
49
- CompguesswhatConfig(
50
- name="compguesswhat-original",
51
- gameplay_scenario="original",
52
- description="CompGuessWhat?! subset of games from the original GuessWhat?! dataset",
53
- data_url="https://www.dropbox.com/s/qd9wlydpkpmq8rr/compguesswhat-original.zip?dl=1",
54
- splits={
55
- "train": "compguesswhat.train.jsonl.gz",
56
- "valid": "compguesswhat.valid.jsonl.gz",
57
- "test": "compguesswhat.test.jsonl.gz",
58
- },
59
- ),
60
- CompguesswhatConfig(
61
- name="compguesswhat-zero_shot",
62
- gameplay_scenario="zero_shot",
63
- description="CompGuessWhat?! reference set of games for zero-shot evaluation using NOCAPS images",
64
- data_url="https://www.dropbox.com/s/f5o2t7aiok7kpcm/compguesswhat-zero_shot.zip?dl=1",
65
- splits={
66
- "nd_valid": "compguesswhat.nd_valid.jsonl.gz",
67
- "nd_test": "compguesswhat.nd_test.jsonl.gz",
68
- "od_valid": "compguesswhat.od_valid.jsonl.gz",
69
- "od_test": "compguesswhat.od_test.jsonl.gz",
70
- },
71
- ),
72
- ]
73
-
74
- VERSION = datasets.Version("0.2.0")
75
-
76
- def _info(self):
77
- if self.config.gameplay_scenario == "original":
78
- return datasets.DatasetInfo(
79
- # This is the description that will appear on the datasets page.
80
- description=self._DESCRIPTION,
81
- # datasets.features.FeatureConnectors
82
- features=datasets.Features(
83
- {
84
- "id": datasets.Value("int32"),
85
- "target_id": datasets.Value("int32"),
86
- "timestamp": datasets.Value("string"),
87
- "status": datasets.Value("string"),
88
- "image": {
89
- # this is the image ID in GuessWhat?! which corresponds to the MSCOCO id
90
- "id": datasets.Value("int32"),
91
- "file_name": datasets.Value("string"),
92
- "flickr_url": datasets.Value("string"),
93
- "coco_url": datasets.Value("string"),
94
- "height": datasets.Value("int32"),
95
- "width": datasets.Value("int32"),
96
- # this field represents the corresponding image metadata that can be found in VisualGenome
97
- # in the file image_data.json
98
- # We copy it over so that we avoid any confusion or possible wrong URL
99
- # Please use the original image files to resolve photos
100
- "visual_genome": {
101
- "width": datasets.Value("int32"),
102
- "height": datasets.Value("int32"),
103
- "url": datasets.Value("string"),
104
- "coco_id": datasets.Value("int32"),
105
- # this is the actual VisualGenome image ID
106
- # because we can't rely store it as an integer we same it as string
107
- "flickr_id": datasets.Value("string"),
108
- "image_id": datasets.Value("string"),
109
- },
110
- },
111
- "qas": datasets.features.Sequence(
112
- {
113
- "question": datasets.Value("string"),
114
- "answer": datasets.Value("string"),
115
- "id": datasets.Value("int32"),
116
- }
117
- ),
118
- "objects": datasets.features.Sequence(
119
- {
120
- "id": datasets.Value("int32"),
121
- "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
122
- "category": datasets.Value("string"),
123
- "area": datasets.Value("float32"),
124
- "category_id": datasets.Value("int32"),
125
- "segment": datasets.features.Sequence(
126
- datasets.features.Sequence(datasets.Value("float32"))
127
- ),
128
- }
129
- ),
130
- }
131
- ),
132
- # If there's a common (input, target) tuple from the features,
133
- # specify them here. They'll be used if as_supervised=True in
134
- # builder.as_dataset.
135
- supervised_keys=None,
136
- # Homepage of the dataset for documentation
137
- homepage="https://compguesswhat.github.io/",
138
- citation=self._CITATION,
139
- )
140
- elif self.config.gameplay_scenario == "zero_shot":
141
- return datasets.DatasetInfo(
142
- # This is the description that will appear on the datasets page.
143
- description=self._DESCRIPTION,
144
- # datasets.features.FeatureConnectors
145
- features=datasets.Features(
146
- {
147
- "id": datasets.Value("int32"),
148
- "target_id": datasets.Value("string"),
149
- "status": datasets.Value("string"),
150
- "image": {
151
- "id": datasets.Value("int32"),
152
- "file_name": datasets.Value("string"),
153
- "coco_url": datasets.Value("string"),
154
- "height": datasets.Value("int32"),
155
- "width": datasets.Value("int32"),
156
- "license": datasets.Value("int32"),
157
- "open_images_id": datasets.Value("string"),
158
- "date_captured": datasets.Value("string"),
159
- },
160
- "objects": datasets.features.Sequence(
161
- {
162
- "id": datasets.Value("string"),
163
- "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
164
- "category": datasets.Value("string"),
165
- "area": datasets.Value("float32"),
166
- "category_id": datasets.Value("int32"),
167
- "IsOccluded": datasets.Value("int32"),
168
- "IsTruncated": datasets.Value("int32"),
169
- "segment": datasets.features.Sequence(
170
- {
171
- "MaskPath": datasets.Value("string"),
172
- "LabelName": datasets.Value("string"),
173
- "BoxID": datasets.Value("string"),
174
- "BoxXMin": datasets.Value("string"),
175
- "BoxXMax": datasets.Value("string"),
176
- "BoxYMin": datasets.Value("string"),
177
- "BoxYMax": datasets.Value("string"),
178
- "PredictedIoU": datasets.Value("string"),
179
- "Clicks": datasets.Value("string"),
180
- }
181
- ),
182
- }
183
- ),
184
- }
185
- ),
186
- # If there's a common (input, target) tuple from the features,
187
- # specify them here. They'll be used if as_supervised=True in
188
- # builder.as_dataset.
189
- supervised_keys=None,
190
- # Homepage of the dataset for documentation
191
- homepage="https://compguesswhat.github.io/",
192
- citation=self._CITATION,
193
- )
194
-
195
- def _split_generators(self, dl_manager):
196
- """Returns SplitGenerators."""
197
- dl_dir = dl_manager.download_and_extract(self.config.data_url)
198
-
199
- splits_gen = []
200
-
201
- for split_id, split_filename in self.config.splits.items():
202
- if self.config.gameplay_scenario == "original":
203
- if "train" in split_id:
204
- split_name = datasets.Split.TRAIN
205
- elif "valid" in split_id:
206
- split_name = datasets.Split.VALIDATION
207
- elif "test" in split_id:
208
- split_name = datasets.Split.TEST
209
- else:
210
- split_name = datasets.Split(split_id)
211
-
212
- full_split_name = "-".join(["compguesswhat", self.config.gameplay_scenario])
213
- splits_gen.append(
214
- datasets.SplitGenerator(
215
- name=split_name,
216
- gen_kwargs={
217
- "filepath": os.path.join(
218
- dl_dir,
219
- full_split_name,
220
- self.VERSION.version_str,
221
- split_filename,
222
- )
223
- },
224
- )
225
- )
226
-
227
- return splits_gen
228
-
229
- def _generate_examples(self, filepath):
230
- def _extract_game_tuple(data):
231
- data = data.decode("utf-8")
232
- game = json.loads(data.strip("\n"))
233
-
234
- # we refactor the data structure a bit to fit with the new version
235
- game["target_id"] = game["object_id"]
236
- if "object_id" in game:
237
- del game["object_id"]
238
-
239
- if "questioner_id" in game:
240
- del game["questioner_id"]
241
- ###
242
-
243
- if "visual_genome" in game["image"]:
244
- # We need to cast it to string so that we avoid issues with int size
245
- game["image"]["visual_genome"]["image_id"] = str(game["image"]["visual_genome"]["image_id"])
246
- game["image"]["visual_genome"]["flickr_id"] = str(game["image"]["visual_genome"]["flickr_id"])
247
-
248
- return game["id"], game
249
-
250
- """Yields examples."""
251
- with open(filepath, "rb") as gzip_file:
252
- with gzip.open(gzip_file) as in_file:
253
- for data in in_file:
254
- yield _extract_game_tuple(data)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
create_dummy_data.py DELETED
@@ -1,96 +0,0 @@
1
- import gzip
2
- import json
3
- import logging
4
- import os
5
- from argparse import ArgumentParser
6
-
7
-
8
- parser = ArgumentParser()
9
- parser.add_argument(
10
- "-d",
11
- "--data_path",
12
- type=str,
13
- required=True,
14
- help="Data path containing the CompGuessWhat?! datasets (files with 'jsonl.gz' extension)",
15
- )
16
- parser.add_argument(
17
- "--examples",
18
- type=int,
19
- default=5,
20
- help="Number of games to consider in the dummy dataset",
21
- )
22
- original_data_files = {
23
- "train": "compguesswhat.train.jsonl.gz",
24
- "valid": "compguesswhat.valid.jsonl.gz",
25
- "test": "compguesswhat.test.jsonl.gz",
26
- }
27
-
28
- zs_data_files = {
29
- "nd_valid": "compguesswhat.nd_valid.jsonl.gz",
30
- "od_valid": "compguesswhat.od_valid.jsonl.gz",
31
- "nd_test": "compguesswhat.nd_test.jsonl.gz",
32
- "od_test": "compguesswhat.od_test.jsonl.gz",
33
- }
34
-
35
- COMPGUESSWHAT_ROOT = "datasets/compguesswhat/"
36
-
37
-
38
- def create_dummy_data_for_split(data_path, dataset_name, dataset_version, data_files):
39
- full_dataset_name = "-".join(["compguesswhat", dataset_name])
40
- dummy_data_path = os.path.join(
41
- COMPGUESSWHAT_ROOT,
42
- "dummy",
43
- full_dataset_name,
44
- dataset_version,
45
- "dummy_data",
46
- full_dataset_name,
47
- dataset_version,
48
- )
49
-
50
- if not os.path.exists(dummy_data_path):
51
- os.makedirs(dummy_data_path)
52
-
53
- for split_name, split_file in data_files.items():
54
- logging.info(f"Generating dummy data for split {split_name} (num. examples = {args.examples})")
55
-
56
- split_filepath = os.path.join(data_path, full_dataset_name, dataset_version, split_file)
57
- logging.info(f"Reading split file {split_filepath}")
58
- with gzip.open(split_filepath) as in_file:
59
- dummy_filepath = os.path.join(dummy_data_path, split_file)
60
- with gzip.open(dummy_filepath, mode="w") as out_file:
61
- for i, line in enumerate(in_file):
62
- if i > args.examples:
63
- break
64
-
65
- data = json.loads(line.strip())
66
- out_file.write(json.dumps(data).encode("utf-8"))
67
- out_file.write(b"\n")
68
-
69
-
70
- def main(args):
71
- # args.data_path is the directory containing the already downloaded dataset files
72
- # we assume that the dataset test was successful and we have the file dataset_info.json
73
- dataset_info_path = os.path.join(COMPGUESSWHAT_ROOT, "dataset_infos.json")
74
-
75
- if not os.path.exists(dataset_info_path):
76
- raise ValueError(
77
- "The file 'dataset_info.json' doesn't exists. Make sure that you run the dataset tests via datasets-cli."
78
- )
79
-
80
- with open(dataset_info_path, encoding="utf-8") as in_file:
81
- dataset_info = json.load(in_file)
82
-
83
- dataset_version = dataset_info["compguesswhat-original"]["version"]["version_str"]
84
-
85
- logging.info(f"Creating dummy data for CompGuessWhat?! {dataset_version}")
86
-
87
- logging.info("Original dataset...")
88
- create_dummy_data_for_split(args.data_path, "original", dataset_version, original_data_files)
89
-
90
- logging.info("Zero-shot dataset...")
91
- create_dummy_data_for_split(args.data_path, "zero_shot", dataset_version, zs_data_files)
92
-
93
-
94
- if __name__ == "__main__":
95
- args = parser.parse_args()
96
- main(args)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"compguesswhat-original": {"description": "\n CompGuessWhat?! is an instance of a multi-task framework for evaluating the quality of learned neural representations,\n in particular concerning attribute grounding. Use this dataset if you want to use the set of games whose reference\n scene is an image in VisualGenome. Visit the website for more details: https://compguesswhat.github.io\n ", "citation": " @inproceedings{suglia2020compguesswhat,\n title={CompGuessWhat?!: a Multi-task Evaluation Framework for Grounded Language Learning},\n author={Suglia, Alessandro, Konstas, Ioannis, Vanzo, Andrea, Bastianelli, Emanuele, Desmond Elliott, Stella Frank and Oliver Lemon},\n booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},\n year={2020}\n }\n ", "homepage": "https://compguesswhat.github.io/", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "target_id": {"dtype": "int32", "id": null, "_type": "Value"}, "timestamp": {"dtype": "string", "id": null, "_type": "Value"}, "status": {"dtype": "string", "id": null, "_type": "Value"}, "image": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "file_name": {"dtype": "string", "id": null, "_type": "Value"}, "flickr_url": {"dtype": "string", "id": null, "_type": "Value"}, "coco_url": {"dtype": "string", "id": null, "_type": "Value"}, "height": {"dtype": "int32", "id": null, "_type": "Value"}, "width": {"dtype": "int32", "id": null, "_type": "Value"}, "visual_genome": {"width": {"dtype": "int32", "id": null, "_type": "Value"}, "height": {"dtype": "int32", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "coco_id": {"dtype": "int32", "id": null, "_type": "Value"}, "flickr_id": {"dtype": "string", "id": null, "_type": "Value"}, "image_id": {"dtype": "string", "id": null, "_type": "Value"}}}, "qas": {"feature": {"question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "id": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "objects": {"feature": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "bbox": {"feature": {"dtype": "float32", "id": null, "_type": "Value"}, "length": 4, "id": null, "_type": "Sequence"}, "category": {"dtype": "string", "id": null, "_type": "Value"}, "area": {"dtype": "float32", "id": null, "_type": "Value"}, "category_id": {"dtype": "int32", "id": null, "_type": "Value"}, "segment": {"feature": {"feature": {"dtype": "float32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "length": -1, "id": null, "_type": "Sequence"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "compguesswhat", "config_name": "compguesswhat-original", "version": {"version_str": "0.2.0", "description": "Second CompGuessWhat?! release", "major": 0, "minor": 2, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 126548689, "num_examples": 46341, "dataset_name": "compguesswhat"}, "validation": {"name": "validation", "num_bytes": 26055261, "num_examples": 9738, "dataset_name": "compguesswhat"}, "test": {"name": "test", "num_bytes": 25981593, "num_examples": 9621, "dataset_name": "compguesswhat"}}, "download_checksums": {"https://www.dropbox.com/s/qd9wlydpkpmq8rr/compguesswhat-original.zip?dl=1": {"num_bytes": 107201655, "checksum": "f965b469142cf65635b2b8b309ba2b28539fd7ad40039b11856cd662f2b000c1"}}, "download_size": 107201655, "post_processing_size": null, "dataset_size": 178585543, "size_in_bytes": 285787198}, "compguesswhat-zero_shot": {"description": "\n CompGuessWhat?! is an instance of a multi-task framework for evaluating the quality of learned neural representations,\n in particular concerning attribute grounding. Use this dataset if you want to use the set of games whose reference\n scene is an image in VisualGenome. Visit the website for more details: https://compguesswhat.github.io\n ", "citation": " @inproceedings{suglia2020compguesswhat,\n title={CompGuessWhat?!: a Multi-task Evaluation Framework for Grounded Language Learning},\n author={Suglia, Alessandro, Konstas, Ioannis, Vanzo, Andrea, Bastianelli, Emanuele, Desmond Elliott, Stella Frank and Oliver Lemon},\n booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},\n year={2020}\n }\n ", "homepage": "https://compguesswhat.github.io/", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "target_id": {"dtype": "string", "id": null, "_type": "Value"}, "status": {"dtype": "string", "id": null, "_type": "Value"}, "image": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "file_name": {"dtype": "string", "id": null, "_type": "Value"}, "coco_url": {"dtype": "string", "id": null, "_type": "Value"}, "height": {"dtype": "int32", "id": null, "_type": "Value"}, "width": {"dtype": "int32", "id": null, "_type": "Value"}, "license": {"dtype": "int32", "id": null, "_type": "Value"}, "open_images_id": {"dtype": "string", "id": null, "_type": "Value"}, "date_captured": {"dtype": "string", "id": null, "_type": "Value"}}, "objects": {"feature": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "bbox": {"feature": {"dtype": "float32", "id": null, "_type": "Value"}, "length": 4, "id": null, "_type": "Sequence"}, "category": {"dtype": "string", "id": null, "_type": "Value"}, "area": {"dtype": "float32", "id": null, "_type": "Value"}, "category_id": {"dtype": "int32", "id": null, "_type": "Value"}, "IsOccluded": {"dtype": "int32", "id": null, "_type": "Value"}, "IsTruncated": {"dtype": "int32", "id": null, "_type": "Value"}, "segment": {"feature": {"MaskPath": {"dtype": "string", "id": null, "_type": "Value"}, "LabelName": {"dtype": "string", "id": null, "_type": "Value"}, "BoxID": {"dtype": "string", "id": null, "_type": "Value"}, "BoxXMin": {"dtype": "string", "id": null, "_type": "Value"}, "BoxXMax": {"dtype": "string", "id": null, "_type": "Value"}, "BoxYMin": {"dtype": "string", "id": null, "_type": "Value"}, "BoxYMax": {"dtype": "string", "id": null, "_type": "Value"}, "PredictedIoU": {"dtype": "string", "id": null, "_type": "Value"}, "Clicks": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "compguesswhat", "config_name": "compguesswhat-zero_shot", "version": {"version_str": "0.2.0", "description": "Second CompGuessWhat?! release", "major": 0, "minor": 2, "patch": 0}, "splits": {"nd_valid": {"name": "nd_valid", "num_bytes": 13557059, "num_examples": 5343, "dataset_name": "compguesswhat"}, "nd_test": {"name": "nd_test", "num_bytes": 36352201, "num_examples": 13836, "dataset_name": "compguesswhat"}, "od_valid": {"name": "od_valid", "num_bytes": 14093233, "num_examples": 5372, "dataset_name": "compguesswhat"}, "od_test": {"name": "od_test", "num_bytes": 33049755, "num_examples": 13300, "dataset_name": "compguesswhat"}}, "download_checksums": {"https://www.dropbox.com/s/f5o2t7aiok7kpcm/compguesswhat-zero_shot.zip?dl=1": {"num_bytes": 4845966, "checksum": "ebf444e14408dbff2d910ba9ec049cd42882f2ce52d465d0f78203ee454aa33e"}}, "download_size": 4845966, "post_processing_size": null, "dataset_size": 97052248, "size_in_bytes": 101898214}}