Convert dataset to Parquet

#3
by SaylorTwift HF Staff - opened
.gitignore DELETED
@@ -1 +0,0 @@
1
- .DS_Store
 
 
IndicQA.py DELETED
@@ -1,113 +0,0 @@
1
- """TODO(xquad): Add a description here."""
2
-
3
-
4
- import json
5
-
6
- import datasets
7
-
8
-
9
- _CITATION = """\
10
-
11
- """
12
-
13
- _DESCRIPTION = """\
14
-
15
- """
16
-
17
- _URL = "https://huggingface.co/datasets/ai4bharat/IndicQA/resolve/main/data/"
18
- _LANG = ["as", "bn", "gu", "hi", "kn", "ml", "mr", "or", "pa", "ta", "te"]
19
-
20
-
21
- class IndicqaConfig(datasets.BuilderConfig):
22
-
23
- """BuilderConfig for Indicqa"""
24
-
25
- def __init__(self, lang, **kwargs):
26
- """
27
-
28
- Args:
29
- lang: string, language for the input text
30
- **kwargs: keyword arguments forwarded to super.
31
- """
32
- super(IndicqaConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
33
- self.lang = lang
34
-
35
-
36
- class Xquad(datasets.GeneratorBasedBuilder):
37
- """TODO(indicqa): Short description of my dataset."""
38
-
39
- # TODO(indicqa): Set up version.
40
- VERSION = datasets.Version("1.0.0")
41
- BUILDER_CONFIGS = [IndicqaConfig(name=f"indicqa.{lang}", description=_DESCRIPTION, lang=lang) for lang in _LANG]
42
-
43
- def _info(self):
44
- # TODO(indicqa): Specifies the datasets.DatasetInfo object
45
- return datasets.DatasetInfo(
46
- # This is the description that will appear on the datasets page.
47
- description=_DESCRIPTION,
48
- # datasets.features.FeatureConnectors
49
- features=datasets.Features(
50
- {
51
- "id": datasets.Value("string"),
52
- "context": datasets.Value("string"),
53
- "question": datasets.Value("string"),
54
- "answers": datasets.features.Sequence(
55
- {
56
- "text": datasets.Value("string"),
57
- "answer_start": datasets.Value("int32"),
58
- }
59
- ),
60
- # These are the features of your dataset like images, labels ...
61
- }
62
- ),
63
- # If there's a common (input, target) tuple from the features,
64
- # specify them here. They'll be used if as_supervised=True in
65
- # builder.as_dataset.
66
- supervised_keys=None,
67
- # Homepage of the dataset for documentation
68
- homepage="",
69
- citation=_CITATION,
70
- )
71
-
72
- def _split_generators(self, dl_manager):
73
- """Returns SplitGenerators."""
74
- # TODO(indicqa): Downloads the data and defines the splits
75
- # dl_manager is a datasets.download.DownloadManager that can be used to
76
- # download and extract URLs
77
- urls_to_download = {lang: _URL + f"indicqa.{lang}.json" for lang in _LANG}
78
- downloaded_files = dl_manager.download_and_extract(urls_to_download)
79
-
80
- return [
81
- datasets.SplitGenerator(
82
- name=datasets.Split.TEST,
83
- # These kwargs will be passed to _generate_examples
84
- gen_kwargs={"filepath": downloaded_files[self.config.lang]},
85
- ),
86
- ]
87
-
88
- def _generate_examples(self, filepath):
89
- """Yields examples."""
90
- # TODO(indicqa): Yields (key, example) tuples from the dataset
91
- with open(filepath, encoding="utf-8") as f:
92
- indicqa = json.load(f)
93
- id_ = 0
94
- for article in indicqa["data"]:
95
- for paragraph in article["paragraphs"]:
96
- context = paragraph["context"].strip()
97
- for qa in paragraph["qas"]:
98
- question = qa["question"].strip()
99
- answer_starts = [answer["answer_start"] for answer in qa["answers"]]
100
- answers = [answer["text"].strip() for answer in qa["answers"]]
101
-
102
- # Features currently used are "context", "question", and "answers".
103
- # Others are extracted here for the ease of future expansions.
104
- yield id_, {
105
- "context": context,
106
- "question": question,
107
- "id": qa["id"],
108
- "answers": {
109
- "answer_start": answer_starts,
110
- "text": answers,
111
- },
112
- }
113
- id_ += 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -28,6 +28,272 @@ task_categories:
28
  - question-answering
29
  task_ids:
30
  - closed-domain-qa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  ---
32
 
33
  # Dataset Card for [Dataset Name]
 
28
  - question-answering
29
  task_ids:
30
  - closed-domain-qa
31
+ configs:
32
+ - config_name: indicqa.as
33
+ data_files:
34
+ - split: test
35
+ path: indicqa.as/test-*
36
+ - config_name: indicqa.bn
37
+ data_files:
38
+ - split: test
39
+ path: indicqa.bn/test-*
40
+ - config_name: indicqa.gu
41
+ data_files:
42
+ - split: test
43
+ path: indicqa.gu/test-*
44
+ - config_name: indicqa.hi
45
+ data_files:
46
+ - split: test
47
+ path: indicqa.hi/test-*
48
+ - config_name: indicqa.kn
49
+ data_files:
50
+ - split: test
51
+ path: indicqa.kn/test-*
52
+ - config_name: indicqa.ml
53
+ data_files:
54
+ - split: test
55
+ path: indicqa.ml/test-*
56
+ - config_name: indicqa.mr
57
+ data_files:
58
+ - split: test
59
+ path: indicqa.mr/test-*
60
+ - config_name: indicqa.or
61
+ data_files:
62
+ - split: test
63
+ path: indicqa.or/test-*
64
+ - config_name: indicqa.pa
65
+ data_files:
66
+ - split: test
67
+ path: indicqa.pa/test-*
68
+ - config_name: indicqa.ta
69
+ data_files:
70
+ - split: test
71
+ path: indicqa.ta/test-*
72
+ - config_name: indicqa.te
73
+ data_files:
74
+ - split: test
75
+ path: indicqa.te/test-*
76
+ dataset_info:
77
+ - config_name: indicqa.as
78
+ features:
79
+ - name: id
80
+ dtype: string
81
+ - name: context
82
+ dtype: string
83
+ - name: question
84
+ dtype: string
85
+ - name: answers
86
+ sequence:
87
+ - name: text
88
+ dtype: string
89
+ - name: answer_start
90
+ dtype: int32
91
+ splits:
92
+ - name: test
93
+ num_bytes: 7088629
94
+ num_examples: 1789
95
+ download_size: 531873
96
+ dataset_size: 7088629
97
+ - config_name: indicqa.bn
98
+ features:
99
+ - name: id
100
+ dtype: string
101
+ - name: context
102
+ dtype: string
103
+ - name: question
104
+ dtype: string
105
+ - name: answers
106
+ sequence:
107
+ - name: text
108
+ dtype: string
109
+ - name: answer_start
110
+ dtype: int32
111
+ splits:
112
+ - name: test
113
+ num_bytes: 10823292
114
+ num_examples: 1763
115
+ download_size: 705431
116
+ dataset_size: 10823292
117
+ - config_name: indicqa.gu
118
+ features:
119
+ - name: id
120
+ dtype: string
121
+ - name: context
122
+ dtype: string
123
+ - name: question
124
+ dtype: string
125
+ - name: answers
126
+ sequence:
127
+ - name: text
128
+ dtype: string
129
+ - name: answer_start
130
+ dtype: int32
131
+ splits:
132
+ - name: test
133
+ num_bytes: 5562543
134
+ num_examples: 2017
135
+ download_size: 446851
136
+ dataset_size: 5562543
137
+ - config_name: indicqa.hi
138
+ features:
139
+ - name: id
140
+ dtype: string
141
+ - name: context
142
+ dtype: string
143
+ - name: question
144
+ dtype: string
145
+ - name: answers
146
+ sequence:
147
+ - name: text
148
+ dtype: string
149
+ - name: answer_start
150
+ dtype: int32
151
+ splits:
152
+ - name: test
153
+ num_bytes: 10672978
154
+ num_examples: 1547
155
+ download_size: 779170
156
+ dataset_size: 10672978
157
+ - config_name: indicqa.kn
158
+ features:
159
+ - name: id
160
+ dtype: string
161
+ - name: context
162
+ dtype: string
163
+ - name: question
164
+ dtype: string
165
+ - name: answers
166
+ sequence:
167
+ - name: text
168
+ dtype: string
169
+ - name: answer_start
170
+ dtype: int32
171
+ splits:
172
+ - name: test
173
+ num_bytes: 4005605
174
+ num_examples: 1517
175
+ download_size: 382152
176
+ dataset_size: 4005605
177
+ - config_name: indicqa.ml
178
+ features:
179
+ - name: id
180
+ dtype: string
181
+ - name: context
182
+ dtype: string
183
+ - name: question
184
+ dtype: string
185
+ - name: answers
186
+ sequence:
187
+ - name: text
188
+ dtype: string
189
+ - name: answer_start
190
+ dtype: int32
191
+ splits:
192
+ - name: test
193
+ num_bytes: 11532860
194
+ num_examples: 1589
195
+ download_size: 808944
196
+ dataset_size: 11532860
197
+ - config_name: indicqa.mr
198
+ features:
199
+ - name: id
200
+ dtype: string
201
+ - name: context
202
+ dtype: string
203
+ - name: question
204
+ dtype: string
205
+ - name: answers
206
+ sequence:
207
+ - name: text
208
+ dtype: string
209
+ - name: answer_start
210
+ dtype: int32
211
+ splits:
212
+ - name: test
213
+ num_bytes: 7736596
214
+ num_examples: 1604
215
+ download_size: 590846
216
+ dataset_size: 7736596
217
+ - config_name: indicqa.or
218
+ features:
219
+ - name: id
220
+ dtype: string
221
+ - name: context
222
+ dtype: string
223
+ - name: question
224
+ dtype: string
225
+ - name: answers
226
+ sequence:
227
+ - name: text
228
+ dtype: string
229
+ - name: answer_start
230
+ dtype: int32
231
+ splits:
232
+ - name: test
233
+ num_bytes: 4036028
234
+ num_examples: 1680
235
+ download_size: 368204
236
+ dataset_size: 4036028
237
+ - config_name: indicqa.pa
238
+ features:
239
+ - name: id
240
+ dtype: string
241
+ - name: context
242
+ dtype: string
243
+ - name: question
244
+ dtype: string
245
+ - name: answers
246
+ sequence:
247
+ - name: text
248
+ dtype: string
249
+ - name: answer_start
250
+ dtype: int32
251
+ splits:
252
+ - name: test
253
+ num_bytes: 6117320
254
+ num_examples: 1542
255
+ download_size: 504985
256
+ dataset_size: 6117320
257
+ - config_name: indicqa.ta
258
+ features:
259
+ - name: id
260
+ dtype: string
261
+ - name: context
262
+ dtype: string
263
+ - name: question
264
+ dtype: string
265
+ - name: answers
266
+ sequence:
267
+ - name: text
268
+ dtype: string
269
+ - name: answer_start
270
+ dtype: int32
271
+ splits:
272
+ - name: test
273
+ num_bytes: 11536309
274
+ num_examples: 1804
275
+ download_size: 700937
276
+ dataset_size: 11536309
277
+ - config_name: indicqa.te
278
+ features:
279
+ - name: id
280
+ dtype: string
281
+ - name: context
282
+ dtype: string
283
+ - name: question
284
+ dtype: string
285
+ - name: answers
286
+ sequence:
287
+ - name: text
288
+ dtype: string
289
+ - name: answer_start
290
+ dtype: int32
291
+ splits:
292
+ - name: test
293
+ num_bytes: 14051634
294
+ num_examples: 1734
295
+ download_size: 929374
296
+ dataset_size: 14051634
297
  ---
298
 
299
  # Dataset Card for [Dataset Name]
data/.gitattributes DELETED
@@ -1,11 +0,0 @@
1
- indicqa.ta.json filter=lfs diff=lfs merge=lfs -text
2
- indicqa.te.json filter=lfs diff=lfs merge=lfs -text
3
- indicqa.as.json filter=lfs diff=lfs merge=lfs -text
4
- indicqa.bn.json filter=lfs diff=lfs merge=lfs -text
5
- indicqa.hi.json filter=lfs diff=lfs merge=lfs -text
6
- indicqa.ml.json filter=lfs diff=lfs merge=lfs -text
7
- indicqa.pa.json filter=lfs diff=lfs merge=lfs -text
8
- indicqa.gu.json filter=lfs diff=lfs merge=lfs -text
9
- indicqa.kn.json filter=lfs diff=lfs merge=lfs -text
10
- indicqa.mr.json filter=lfs diff=lfs merge=lfs -text
11
- indicqa.or.json filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
data/indicqa.kn.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7041d848ac33981008454ba49d1ddc023112ad02955e0ab34135012f61cee33c
3
- size 1571913
 
 
 
 
data/indicqa.ml.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:aebd0ebf2d40ad4625a17194127cefa0e834ba60f85bc01e694a006c51a6f44f
3
- size 2816110
 
 
 
 
data/indicqa.mr.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:03c14357ce3e54bb02f9d0b4a0e531ad687c70f68416cc46400216a3376d9d52
3
- size 2177201
 
 
 
 
data/indicqa.or.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c55506f5d8d5e4dfac2c2939308f0405a0312d6d077b087688d0d471e01c63cf
3
- size 1602257
 
 
 
 
data/indicqa.pa.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:99a3407f0d59401a24193a94d7fa793ea647adaa4476b3ed9261879810c6a695
3
- size 1857268
 
 
 
 
data/indicqa.ta.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:247c9e74623f8e73e723f0dabd725c4504b3ca6690c4019c0c6e78f4a7aae77c
3
- size 2709926
 
 
 
 
data/indicqa.te.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:6e32cd280bc4792c9b0852abe6450984a7ba807cb7d1d004df8c9e6eaf33dc6d
3
- size 3119401
 
 
 
 
data/indicqa.bn.json → indicqa.as/test-00000-of-00001.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a0e65c5b28e90d1912c0ec114eba5fa81aa39cbcf76ec968412c7d77900d666b
3
- size 2592245
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d6640b41d22f01c89d00ed139b3ec6af992d5d81812ff78a6e74bb899718f5f
3
+ size 531873
data/indicqa.gu.json → indicqa.bn/test-00000-of-00001.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0964fbdb056c1d21942a4332da31a2c70eba7387c327ee604bcae8785b32569f
3
- size 1901951
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5bd2e2c479d5e97ba8d2a36e73082cc82808cbb2fb706fda622504d070398ae
3
+ size 705431
data/indicqa.hi.json → indicqa.gu/test-00000-of-00001.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9c91d20e7c095956a097e8d2962c0e4bd7029006f2031e86fc4af16f7fef8cb5
3
- size 2673518
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6fbfc7d7b714ebe8c74e7026dc09e3484b123d49dd91e5030b63c05cbe24e26
3
+ size 446851
data/indicqa.as.json → indicqa.hi/test-00000-of-00001.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2bb91906d9a9a0390f02a79e08f67a1e72fcda95335a9e98ec8884e8063286f2
3
- size 2067724
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3843a08af151bfb6b945001bc8b1a2500bb76389d8414fbb0e6ca821a4adb234
3
+ size 779170
indicqa.kn/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1cc265b0a39f9921625c79e6e9e534bc210fe964bf636a3d0d9807e45dff400
3
+ size 382152
indicqa.ml/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc870669dc4549d94c7a485bc24bfd490322f7df2974c0537e1ba81cde10e995
3
+ size 808944
indicqa.mr/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5025e41aae415244d32ee2728e9c9267c0034c9fea2d5442763cc1b5ef87077f
3
+ size 590846
indicqa.or/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fbebb72fc5a3555595453d17d20396b0bcba5bcb901dbdbaef2fd0a7454faca
3
+ size 368204
indicqa.pa/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:450d4240d00903f44125e329e293e2c6bc6a8ca6207fd1541acf49cca4a319e9
3
+ size 504985
indicqa.ta/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:258d56a1d7e9103775db0411a046fe140c32707703aab8435958e5282eb3b756
3
+ size 700937
indicqa.te/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:493a1bd424cc7bd99af26ad72de4dd40c27645cb22ed220e9452f595547f4f57
3
+ size 929374