zhangrenhua commited on
Commit
2e89744
·
1 Parent(s): 036265c
Files changed (2) hide show
  1. README.md +322 -0
  2. my_dataset.py → super_glue.py +13 -13
README.md CHANGED
@@ -0,0 +1,322 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ - config_name: boolq
4
+ features:
5
+ - name: question
6
+ dtype: string
7
+ - name: passage
8
+ dtype: string
9
+ - name: idx
10
+ dtype: int32
11
+ - name: label
12
+ dtype:
13
+ class_label:
14
+ names:
15
+ '0': 'False'
16
+ '1': 'True'
17
+ splits:
18
+ - name: train
19
+ num_bytes: 6173303
20
+ num_examples: 9427
21
+ - name: validation
22
+ num_bytes: 2116452
23
+ num_examples: 3270
24
+ - name: test
25
+ num_bytes: 2105959
26
+ num_examples: 3245
27
+ download_size: 4118001
28
+ dataset_size: 10395714
29
+ - config_name: cb
30
+ features:
31
+ - name: premise
32
+ dtype: string
33
+ - name: hypothesis
34
+ dtype: string
35
+ - name: idx
36
+ dtype: int32
37
+ - name: label
38
+ dtype:
39
+ class_label:
40
+ names:
41
+ '0': entailment
42
+ '1': contradiction
43
+ '2': neutral
44
+ splits:
45
+ - name: train
46
+ num_bytes: 87050
47
+ num_examples: 250
48
+ - name: validation
49
+ num_bytes: 21851
50
+ num_examples: 56
51
+ - name: test
52
+ num_bytes: 93492
53
+ num_examples: 250
54
+ download_size: 75482
55
+ dataset_size: 202393
56
+ - config_name: copa
57
+ features:
58
+ - name: premise
59
+ dtype: string
60
+ - name: choice1
61
+ dtype: string
62
+ - name: choice2
63
+ dtype: string
64
+ - name: question
65
+ dtype: string
66
+ - name: idx
67
+ dtype: int32
68
+ - name: label
69
+ dtype:
70
+ class_label:
71
+ names:
72
+ '0': choice1
73
+ '1': choice2
74
+ splits:
75
+ - name: train
76
+ num_bytes: 49233
77
+ num_examples: 400
78
+ - name: validation
79
+ num_bytes: 12479
80
+ num_examples: 100
81
+ - name: test
82
+ num_bytes: 59846
83
+ num_examples: 500
84
+ download_size: 43986
85
+ dataset_size: 121558
86
+ - config_name: multirc
87
+ features:
88
+ - name: paragraph
89
+ dtype: string
90
+ - name: question
91
+ dtype: string
92
+ - name: answer
93
+ dtype: string
94
+ - name: idx
95
+ struct:
96
+ - name: paragraph
97
+ dtype: int32
98
+ - name: question
99
+ dtype: int32
100
+ - name: answer
101
+ dtype: int32
102
+ - name: label
103
+ dtype:
104
+ class_label:
105
+ names:
106
+ '0': 'False'
107
+ '1': 'True'
108
+ splits:
109
+ - name: train
110
+ num_bytes: 46182913
111
+ num_examples: 27243
112
+ - name: validation
113
+ num_bytes: 7753452
114
+ num_examples: 4848
115
+ - name: test
116
+ num_bytes: 14985531
117
+ num_examples: 9693
118
+ download_size: 1116225
119
+ dataset_size: 68921896
120
+ - config_name: record
121
+ features:
122
+ - name: passage
123
+ dtype: string
124
+ - name: query
125
+ dtype: string
126
+ - name: entities
127
+ sequence: string
128
+ - name: entity_spans
129
+ sequence:
130
+ - name: text
131
+ dtype: string
132
+ - name: start
133
+ dtype: int32
134
+ - name: end
135
+ dtype: int32
136
+ - name: answers
137
+ sequence: string
138
+ - name: idx
139
+ struct:
140
+ - name: passage
141
+ dtype: int32
142
+ - name: query
143
+ dtype: int32
144
+ splits:
145
+ - name: train
146
+ num_bytes: 178757646
147
+ num_examples: 100730
148
+ - name: validation
149
+ num_bytes: 17432944
150
+ num_examples: 10000
151
+ - name: test
152
+ num_bytes: 17154943
153
+ num_examples: 10000
154
+ download_size: 51757880
155
+ dataset_size: 213345533
156
+ - config_name: rte
157
+ features:
158
+ - name: premise
159
+ dtype: string
160
+ - name: hypothesis
161
+ dtype: string
162
+ - name: idx
163
+ dtype: int32
164
+ - name: label
165
+ dtype:
166
+ class_label:
167
+ names:
168
+ '0': entailment
169
+ '1': not_entailment
170
+ splits:
171
+ - name: train
172
+ num_bytes: 847177
173
+ num_examples: 2490
174
+ - name: validation
175
+ num_bytes: 90716
176
+ num_examples: 277
177
+ - name: test
178
+ num_bytes: 973916
179
+ num_examples: 3000
180
+ download_size: 750920
181
+ dataset_size: 1911809
182
+ - config_name: wic
183
+ features:
184
+ - name: word
185
+ dtype: string
186
+ - name: sentence1
187
+ dtype: string
188
+ - name: sentence2
189
+ dtype: string
190
+ - name: start1
191
+ dtype: int32
192
+ - name: start2
193
+ dtype: int32
194
+ - name: end1
195
+ dtype: int32
196
+ - name: end2
197
+ dtype: int32
198
+ - name: idx
199
+ dtype: int32
200
+ - name: label
201
+ dtype:
202
+ class_label:
203
+ names:
204
+ '0': 'False'
205
+ '1': 'True'
206
+ splits:
207
+ - name: train
208
+ num_bytes: 658381
209
+ num_examples: 5428
210
+ - name: validation
211
+ num_bytes: 81811
212
+ num_examples: 638
213
+ - name: test
214
+ num_bytes: 178831
215
+ num_examples: 1400
216
+ download_size: 396213
217
+ dataset_size: 919023
218
+ - config_name: wsc
219
+ features:
220
+ - name: text
221
+ dtype: string
222
+ - name: span1_index
223
+ dtype: int32
224
+ - name: span2_index
225
+ dtype: int32
226
+ - name: span1_text
227
+ dtype: string
228
+ - name: span2_text
229
+ dtype: string
230
+ - name: idx
231
+ dtype: int32
232
+ - name: label
233
+ dtype:
234
+ class_label:
235
+ names:
236
+ '0': 'False'
237
+ '1': 'True'
238
+ splits:
239
+ - name: train
240
+ num_bytes: 89311
241
+ num_examples: 554
242
+ - name: validation
243
+ num_bytes: 21521
244
+ num_examples: 104
245
+ - name: test
246
+ num_bytes: 31408
247
+ num_examples: 146
248
+ download_size: 32751
249
+ dataset_size: 142240
250
+ - config_name: wsc.fixed
251
+ features:
252
+ - name: text
253
+ dtype: string
254
+ - name: span1_index
255
+ dtype: int32
256
+ - name: span2_index
257
+ dtype: int32
258
+ - name: span1_text
259
+ dtype: string
260
+ - name: span2_text
261
+ dtype: string
262
+ - name: idx
263
+ dtype: int32
264
+ - name: label
265
+ dtype:
266
+ class_label:
267
+ names:
268
+ '0': 'False'
269
+ '1': 'True'
270
+ splits:
271
+ - name: train
272
+ num_bytes: 89311
273
+ num_examples: 554
274
+ - name: validation
275
+ num_bytes: 21521
276
+ num_examples: 104
277
+ - name: test
278
+ num_bytes: 31404
279
+ num_examples: 146
280
+ download_size: 32751
281
+ dataset_size: 142236
282
+ - config_name: axb
283
+ features:
284
+ - name: sentence1
285
+ dtype: string
286
+ - name: sentence2
287
+ dtype: string
288
+ - name: idx
289
+ dtype: int32
290
+ - name: label
291
+ dtype:
292
+ class_label:
293
+ names:
294
+ '0': entailment
295
+ '1': not_entailment
296
+ splits:
297
+ - name: test
298
+ num_bytes: 237694
299
+ num_examples: 1104
300
+ download_size: 33950
301
+ dataset_size: 237694
302
+ - config_name: axg
303
+ features:
304
+ - name: premise
305
+ dtype: string
306
+ - name: hypothesis
307
+ dtype: string
308
+ - name: idx
309
+ dtype: int32
310
+ - name: label
311
+ dtype:
312
+ class_label:
313
+ names:
314
+ '0': entailment
315
+ '1': not_entailment
316
+ splits:
317
+ - name: test
318
+ num_bytes: 53348
319
+ num_examples: 356
320
+ download_size: 10413
321
+ dataset_size: 53348
322
+ ---
my_dataset.py → super_glue.py RENAMED
@@ -278,7 +278,7 @@ _AXG_CITATION = """\
278
  """
279
 
280
 
281
- class MyDataset(datasets.BuilderConfig):
282
  """BuilderConfig for SuperGLUE."""
283
 
284
  def __init__(self, features, data_url, citation, url, label_classes=("False", "True"), **kwargs):
@@ -302,7 +302,7 @@ class MyDataset(datasets.BuilderConfig):
302
  # the full release (v2.0).
303
  # 1.0.0: S3 (new shuffling, sharding and slicing mechanism).
304
  # 0.0.2: Initial version.
305
- super(MyDataset, self).__init__(version=datasets.Version("1.0.3"), **kwargs)
306
  self.features = features
307
  self.label_classes = label_classes
308
  self.data_url = data_url
@@ -314,7 +314,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
314
  """The SuperGLUE benchmark."""
315
 
316
  BUILDER_CONFIGS = [
317
- MyDataset(
318
  name="boolq",
319
  description=_BOOLQ_DESCRIPTION,
320
  features=["question", "passage"],
@@ -322,7 +322,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
322
  citation=_BOOLQ_CITATION,
323
  url="https://github.com/google-research-datasets/boolean-questions",
324
  ),
325
- MyDataset(
326
  name="cb",
327
  description=_CB_DESCRIPTION,
328
  features=["premise", "hypothesis"],
@@ -331,7 +331,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
331
  citation=_CB_CITATION,
332
  url="https://github.com/mcdm/CommitmentBank",
333
  ),
334
- MyDataset(
335
  name="copa",
336
  description=_COPA_DESCRIPTION,
337
  label_classes=["choice1", "choice2"],
@@ -342,7 +342,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
342
  citation=_COPA_CITATION,
343
  url="http://people.ict.usc.edu/~gordon/copa.html",
344
  ),
345
- MyDataset(
346
  name="multirc",
347
  description=_MULTIRC_DESCRIPTION,
348
  features=["paragraph", "question", "answer"],
@@ -350,7 +350,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
350
  citation=_MULTIRC_CITATION,
351
  url="https://cogcomp.org/multirc/",
352
  ),
353
- MyDataset(
354
  name="record",
355
  description=_RECORD_DESCRIPTION,
356
  # Note that entities and answers will be a sequences of strings. Query
@@ -361,7 +361,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
361
  citation=_RECORD_CITATION,
362
  url="https://sheng-z.github.io/ReCoRD-explorer/",
363
  ),
364
- MyDataset(
365
  name="rte",
366
  description=_RTE_DESCRIPTION,
367
  features=["premise", "hypothesis"],
@@ -370,7 +370,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
370
  citation=_RTE_CITATION,
371
  url="https://aclweb.org/aclwiki/Recognizing_Textual_Entailment",
372
  ),
373
- MyDataset(
374
  name="wic",
375
  description=_WIC_DESCRIPTION,
376
  # Note that start1, start2, end1, and end2 will be integers stored as
@@ -380,7 +380,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
380
  citation=_WIC_CITATION,
381
  url="https://pilehvar.github.io/wic/",
382
  ),
383
- MyDataset(
384
  name="wsc",
385
  description=_WSC_DESCRIPTION,
386
  # Note that span1_index and span2_index will be integers stored as
@@ -390,7 +390,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
390
  citation=_WSC_CITATION,
391
  url="https://cs.nyu.edu/faculty/davise/papers/WinogradSchemas/WS.html",
392
  ),
393
- MyDataset(
394
  name="wsc.fixed",
395
  description=(
396
  _WSC_DESCRIPTION + "\n\nThis version fixes issues where the spans are not actually "
@@ -403,7 +403,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
403
  citation=_WSC_CITATION,
404
  url="https://cs.nyu.edu/faculty/davise/papers/WinogradSchemas/WS.html",
405
  ),
406
- MyDataset(
407
  name="axb",
408
  description=_AXB_DESCRIPTION,
409
  features=["sentence1", "sentence2"],
@@ -412,7 +412,7 @@ class SuperGlue(datasets.GeneratorBasedBuilder):
412
  citation="", # The GLUE citation is sufficient.
413
  url="https://gluebenchmark.com/diagnostics",
414
  ),
415
- MyDataset(
416
  name="axg",
417
  description=_AXG_DESCRIPTION,
418
  features=["premise", "hypothesis"],
 
278
  """
279
 
280
 
281
+ class SuperGlueConfig(datasets.BuilderConfig):
282
  """BuilderConfig for SuperGLUE."""
283
 
284
  def __init__(self, features, data_url, citation, url, label_classes=("False", "True"), **kwargs):
 
302
  # the full release (v2.0).
303
  # 1.0.0: S3 (new shuffling, sharding and slicing mechanism).
304
  # 0.0.2: Initial version.
305
+ super(SuperGlueConfig, self).__init__(version=datasets.Version("1.0.3"), **kwargs)
306
  self.features = features
307
  self.label_classes = label_classes
308
  self.data_url = data_url
 
314
  """The SuperGLUE benchmark."""
315
 
316
  BUILDER_CONFIGS = [
317
+ SuperGlueConfig(
318
  name="boolq",
319
  description=_BOOLQ_DESCRIPTION,
320
  features=["question", "passage"],
 
322
  citation=_BOOLQ_CITATION,
323
  url="https://github.com/google-research-datasets/boolean-questions",
324
  ),
325
+ SuperGlueConfig(
326
  name="cb",
327
  description=_CB_DESCRIPTION,
328
  features=["premise", "hypothesis"],
 
331
  citation=_CB_CITATION,
332
  url="https://github.com/mcdm/CommitmentBank",
333
  ),
334
+ SuperGlueConfig(
335
  name="copa",
336
  description=_COPA_DESCRIPTION,
337
  label_classes=["choice1", "choice2"],
 
342
  citation=_COPA_CITATION,
343
  url="http://people.ict.usc.edu/~gordon/copa.html",
344
  ),
345
+ SuperGlueConfig(
346
  name="multirc",
347
  description=_MULTIRC_DESCRIPTION,
348
  features=["paragraph", "question", "answer"],
 
350
  citation=_MULTIRC_CITATION,
351
  url="https://cogcomp.org/multirc/",
352
  ),
353
+ SuperGlueConfig(
354
  name="record",
355
  description=_RECORD_DESCRIPTION,
356
  # Note that entities and answers will be a sequences of strings. Query
 
361
  citation=_RECORD_CITATION,
362
  url="https://sheng-z.github.io/ReCoRD-explorer/",
363
  ),
364
+ SuperGlueConfig(
365
  name="rte",
366
  description=_RTE_DESCRIPTION,
367
  features=["premise", "hypothesis"],
 
370
  citation=_RTE_CITATION,
371
  url="https://aclweb.org/aclwiki/Recognizing_Textual_Entailment",
372
  ),
373
+ SuperGlueConfig(
374
  name="wic",
375
  description=_WIC_DESCRIPTION,
376
  # Note that start1, start2, end1, and end2 will be integers stored as
 
380
  citation=_WIC_CITATION,
381
  url="https://pilehvar.github.io/wic/",
382
  ),
383
+ SuperGlueConfig(
384
  name="wsc",
385
  description=_WSC_DESCRIPTION,
386
  # Note that span1_index and span2_index will be integers stored as
 
390
  citation=_WSC_CITATION,
391
  url="https://cs.nyu.edu/faculty/davise/papers/WinogradSchemas/WS.html",
392
  ),
393
+ SuperGlueConfig(
394
  name="wsc.fixed",
395
  description=(
396
  _WSC_DESCRIPTION + "\n\nThis version fixes issues where the spans are not actually "
 
403
  citation=_WSC_CITATION,
404
  url="https://cs.nyu.edu/faculty/davise/papers/WinogradSchemas/WS.html",
405
  ),
406
+ SuperGlueConfig(
407
  name="axb",
408
  description=_AXB_DESCRIPTION,
409
  features=["sentence1", "sentence2"],
 
412
  citation="", # The GLUE citation is sufficient.
413
  url="https://gluebenchmark.com/diagnostics",
414
  ),
415
+ SuperGlueConfig(
416
  name="axg",
417
  description=_AXG_DESCRIPTION,
418
  features=["premise", "hypothesis"],