carmentano commited on
Commit
52211fb
1 Parent(s): 3c2a260

first commit

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. README.md +275 -1
  3. coqcat.py +80 -0
  4. dev.json +0 -0
  5. test.json +0 -0
  6. train.json +3 -0
.gitattributes CHANGED
@@ -53,3 +53,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
+ train.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,277 @@
1
  ---
2
- license: cc-by-nc-nd-4.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language:
5
+ - ca
6
+ language_creators:
7
+ - found
8
+ license:
9
+ - cc-by-nc-nd-4.0
10
+ multilinguality:
11
+ - monolingual
12
+ pretty_name: CoQCat - Conversational Question Answering in Catalan
13
+ size_categories:
14
+ - 10K<n<100K
15
+ source_datasets: []
16
+ tags: []
17
+ task_categories:
18
+ - conversational
19
+ - question-answering
20
+ task_ids:
21
+ - dialogue-generation
22
+ - extractive-qa
23
+ - closed-domain-qa
24
  ---
25
+
26
+ # Dataset Card for CoQCat
27
+
28
+ ## Table of Contents
29
+ - [Table of Contents](#table-of-contents)
30
+ - [Dataset Description](#dataset-description)
31
+ - [Dataset Summary](#dataset-summary)
32
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
33
+ - [Languages](#languages)
34
+ - [Dataset Structure](#dataset-structure)
35
+ - [Data Instances](#data-instances)
36
+ - [Data Fields](#data-fields)
37
+ - [Data Splits](#data-splits)
38
+ - [Dataset Creation](#dataset-creation)
39
+ - [Curation Rationale](#curation-rationale)
40
+ - [Source Data](#source-data)
41
+ - [Annotations](#annotations)
42
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
43
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
44
+ - [Social Impact of Dataset](#social-impact-of-dataset)
45
+ - [Discussion of Biases](#discussion-of-biases)
46
+ - [Other Known Limitations](#other-known-limitations)
47
+ - [Additional Information](#additional-information)
48
+ - [Dataset Curators](#dataset-curators)
49
+ - [Licensing Information](#licensing-information)
50
+ - [Citation Information](#citation-information)
51
+ - [Contributions](#contributions)
52
+
53
+ ## Dataset Description
54
+
55
+ - **Homepage:**
56
+ - **Repository:**
57
+ - **Paper:**
58
+ - **Leaderboard:**
59
+ - **Point of Contact:** langtech@bsc.es
60
+
61
+ ### Dataset Summary
62
+
63
+ CoQCat is a dataset for Conversational Question Answering in Catalan. It is based on [CoQA dataset](https://stanfordnlp.github.io/coqa/).
64
+
65
+ CoQCat comprises 89384 question-answer pairs, sourced from conversations related to text passages from six different domains. The questions and responses are designed to maintain a conversational tone. The answers are presented in a free-form text format, with evidence highlighted from the passage.
66
+
67
+ For the development and test sets, an additional 2 responses to each question have been collected.
68
+
69
+ This work is licensed under a [CC BY-NC-ND 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/deed.en_GB).
70
+
71
+ ### Supported Tasks and Leaderboards
72
+
73
+ Conversational models, question answering.
74
+
75
+ ### Languages
76
+
77
+ The dataset is in Catalan (ca-CA).
78
+
79
+ ## Dataset Structure
80
+
81
+ ### Data Instances
82
+
83
+ Three JSON files, one for each split.
84
+
85
+ An example of 'test' looks as follows:
86
+
87
+ ```
88
+ {
89
+ "source": "petites_histories",
90
+ "id": "petites_histories_100",
91
+ "filename": "coqcat_batch1",
92
+ "title": "Superant la crisi dels 40",
93
+ "story": "“Què collons estic fent aquí” es preguntà, “…fotent bots i suant a raig als meus quaranta tacos en una classe de body-step. Si no he estat mai un amant del gimnàs! Tot això és culpa del club de ‘singles', els desaparellats desesperats per trobar algú que ens escolti una mica, mentre calculem les possibilitats de fotre un clau”. Pensant tot això es va descomptar i anava a contratemps, un altre cop.\nHo acaba de decidir: sortint de la classe es donarà de baixa. Sí, serà millor oblidar els ‘singles' i dedicar els caps de setmana que no tingui les nenes a fer sortides amb el seu germà, els nebots són més grans que les seves filles i ja fan bones excursions.\nUn cop dutxat s'apropà al mostrador de l'entrada. El noi el va fer passar a l'oficina per omplir el full de baixa. Dins, una veu el va cridar: “Txume?”. Es girà estranyat ja que li deien així només a l'institut, després va ser el Jaume. Va mirar la dona que li somreia.:\n-“Estàs igual que fa vint-i-cinc anys! Has fet un pacte amb el diable?”\n-“… Alba?? Ets l'Alba?”- la seva cara li recordava a la de la noia grassoneta de la classe, però ara no ho estava pas de grassa! -“Tu sí que hi has pactat! Estàs molt millor… bé, vull dir que…”\n-“Sí, em vaig posar les piles.”\n-“Segueixes escrivint relats? Recordo que a tots ens agradaven les històries de l'Alba.”\n-“Doncs encara ho faig, just ara en plegar vaig a una sessió literària musical. Si vols venir, podem recordar batalletes.”\nS'hi apuntà. Van xerrar, van riure, van escoltar relats i poemes, van reviure les aventures de l'institut amb música de jazz de fons, … Hi estava a gust, i s'adonà que, per primer cop en molt temps, no avaluava les possibilitats d'acabar prenent la darrera copa a casa seva.",
94
+ "questions": [
95
+ {"input_text": "Està satisfet del que està fent?","turn_id": 1},
96
+ {"input_text": "Sua?","turn_id": 2},
97
+ {"input_text": "Quants anys té?","turn_id": 3},
98
+ {"input_text": "Li agrada anar al gimnàs?","turn_id": 4},
99
+ {"input_text": "Està solter?","turn_id": 5},
100
+ {"input_text": "Segueix bé el ritme de la música?","turn_id": 6},
101
+ {"input_text": "Continuarà apuntat al gimnàs?","turn_id": 7},
102
+ {"input_text": "Què farà els caps de setmana?","turn_id": 8},
103
+ {"input_text": "On li deien Txume?","turn_id": 9},
104
+ {"input_text": "Com l'anomenaven després?","turn_id": 10},
105
+ {"input_text": "En Jaume ha envellit bé?","turn_id": 11},
106
+ {"input_text": "L'Alba s'havia aprimat?","turn_id": 12},
107
+ {"input_text": "A què es dedica l'Alba?","turn_id": 13},
108
+ {"input_text": "On van anar plegats?","turn_id": 14},
109
+ {"input_text": "Volia que acabessin anant a la seva llar?","turn_id": 15}
110
+ ],
111
+ "answers": [
112
+ {"input_text": "No.", "span_text": "Què collons estic fent aquí", "span_start": 1, "span_end": 28,"turn_id": 1},
113
+ {"input_text": "Sí, a raig.", "span_text": "fotent bots i suant a raig", "span_start": 45, "span_end": 71,"turn_id": 2},
114
+ {"input_text": "Quaranta.", "span_text": "als meus quaranta tacos", "span_start": 72, "span_end": 95,"turn_id": 3},
115
+ {"input_text": "No.", "span_text": "Si no he estat mai un amant del gimnàs", "span_start": 124, "span_end": 162,"turn_id": 4},
116
+ {"input_text": "Sí.", "span_text": "Tot això és culpa del club de ‘singles'", "span_start": 164, "span_end": 203,"turn_id": 5},
117
+ {"input_text": "No.", "span_text": "es va descomptar i anava a contratemps, un altre cop", "span_start": 347, "span_end": 399,"turn_id": 6},
118
+ {"input_text": "No, quan surti de la classe es donarà de baixa.", "span_text": "sortint de la classe es donarà de baixa", "span_start": 422, "span_end": 461,"turn_id": 7},
119
+ {"input_text": "Farà sortides amb el seu germà i els seus nebots.", "span_text": "dedicar els caps de setmana que no tingui les nenes a fer sortides amb el seu germà, els nebots són més grans que les seves filles i ja fan bones excursions", "span_start": 503, "span_end": 659,"turn_id": 8},
120
+ {"input_text": "A l'institut.", "span_text": "Dins, una veu el va cridar: “Txume?”. Es girà estranyat ja que li deien així només a l'institut", "span_start": 776, "span_end": 871,"turn_id": 9},
121
+ {"input_text": "Jaume.", "span_text": "que li deien així només a l'institut, després va ser el Jaume", "span_start": 835, "span_end": 896,"turn_id": 10},
122
+ {"input_text": "Sí.", "span_text": "Estàs igual que fa vint-i-cinc anys", "span_start": 934, "span_end": 969,"turn_id": 11},
123
+ {"input_text": "Sí.", "span_text": "però ara no ho estava pas de grassa", "span_start": 1096, "span_end": 1131,"turn_id": 12},
124
+ {"input_text": "Escriu relats.", "span_text": "Segueixes escrivint relats? Recordo que a tots ens agradaven les històries de l'Alba.”\n-“Doncs encara ho faig", "span_start": 1232, "span_end": 1341,"turn_id": 13},
125
+ {"input_text": "A una sessió literària musical.", "span_text": "just ara en plegar vaig a una sessió literària musical. Si vols venir, podem recordar batalletes.”\nS'hi apuntà", "span_start": 1343, "span_end": 1453,"turn_id": 14},
126
+ {"input_text": "No.", "span_text": "no avaluava les possibilitats d'acabar prenent la darrera copa a casa seva", "span_start": 1641, "span_end": 1715,"turn_id": 15}
127
+ ],
128
+ "additional_answers": {
129
+ "0": [
130
+ {"input_text": "No.", "span_text": "Què collons estic fent aquí", "span_start": 1, "span_end": 28, "turn_id": 1},
131
+ {"input_text": "Sí, molt.", "span_text": "fotent bots i suant a raig", "span_start": 45, "span_end": 71, "turn_id": 2},
132
+ {"input_text": "Quaranta.", "span_text": "als meus quaranta tacos", "span_start": 72, "span_end": 95, "turn_id": 3},
133
+ {"input_text": "No.", "span_text": "Si no he estat mai un amant del gimnàs", "span_start": 124, "span_end": 162, "turn_id": 4},
134
+ {"input_text": "Sí.", "span_text": "Tot això és culpa del club de ‘singles'", "span_start": 164, "span_end": 203, "turn_id": 5},
135
+ {"input_text": "No.", "span_text": "es va descomptar i anava a contratemps, un altre cop", "span_start": 347, "span_end": 399, "turn_id": 6},
136
+ {"input_text": "No.", "span_text": "sortint de la classe es donarà de baixa", "span_start": 422, "span_end": 461, "turn_id": 7},
137
+ {"input_text": "Farà sortides amb el seu germà i els seus nebots.", "span_text": "serà millor oblidar els ‘singles' i dedicar els caps de setmana que no tingui les nenes a fer sortides amb el seu germà, els nebots són més grans que les seves filles i ja fan bones excursions", "span_start": 467, "span_end": 659, "turn_id": 8},
138
+ {"input_text": "A l'institut.", "span_text": "“Txume?”. Es girà estranyat ja que li deien així només a l'institut", "span_start": 804, "span_end": 871, "turn_id": 9},
139
+ {"input_text": "Jaume.", "span_text": "després va ser el Jaume", "span_start": 873, "span_end": 896, "turn_id": 10},
140
+ {"input_text": "Sí.", "span_text": "Estàs igual que fa vint-i-cinc anys", "span_start": 934, "span_end": 969, "turn_id": 11},
141
+ {"input_text": "Sí.", "span_text": "però ara no ho estava pas de grassa", "span_start": 1096, "span_end": 1131, "turn_id": 12},
142
+ {"input_text": "Escriu relats.", "span_text": "Segueixes escrivint relats? Recordo que a tots ens agradaven les històries de l'Alba.”\n-“Doncs encara ho faig", "span_start": 1232, "span_end": 1341, "turn_id": 13},
143
+ {"input_text": "A una sessió literària musical.", "span_text": "just ara en plegar vaig a una sessió literària musical. Si vols venir, podem recordar batalletes.”\nS'hi apuntà", "span_start": 1343, "span_end": 1453, "turn_id": 14},
144
+ {"input_text": "No.", "span_text": "no avaluava les possibilitats d'acabar prenent la darrera copa a casa seva", "span_start": 1641, "span_end": 1715, "turn_id": 15}
145
+ ],
146
+ "1": [
147
+ {"input_text": "No.", "span_text": "Què collons estic fent aquí", "span_start": 1, "span_end": 28, "turn_id": 1},
148
+ {"input_text": "Sí.", "span_text": "fotent bots i suant", "span_start": 45, "span_end": 64, "turn_id": 2},
149
+ {"input_text": "Quaranta.", "span_text": "als meus quaranta tacos", "span_start": 72, "span_end": 95, "turn_id": 3},
150
+ {"input_text": "No.", "span_text": "Si no he estat mai un amant del gimnàs", "span_start": 124, "span_end": 162, "turn_id": 4},
151
+ {"input_text": "Sí.", "span_text": "Tot això és culpa del club de ‘singles', els desaparellats desesperats per trobar algú que ens escolti una mica", "span_start": 164, "span_end": 275, "turn_id": 5},
152
+ {"input_text": "No.", "span_text": "es va descomptar i anava a contratemps, un altre cop", "span_start": 347, "span_end": 399, "turn_id": 6},
153
+ {"input_text": "No.", "span_text": "sortint de la classe es donarà de baixa", "span_start": 422, "span_end": 461, "turn_id": 7},
154
+ {"input_text": "A fer sortides amb el seu germà.", "span_text": "serà millor oblidar els ‘singles' i dedicar els caps de setmana que no tingui les nenes a fer sortides amb el seu germà", "span_start": 467, "span_end": 586, "turn_id": 8},
155
+ {"input_text": "A l'institut.", "span_text": "una veu el va cridar: “Txume?”. Es girà estranyat ja que li deien així només a l'institut", "span_start": 782, "span_end": 871, "turn_id": 9},
156
+ {"input_text": "Jaume.", "span_text": "després va ser el Jaume", "span_start": 873, "span_end": 896, "turn_id": 10},
157
+ {"input_text": "Sí.", "span_text": "Estàs igual que fa vint-i-cinc anys", "span_start": 934, "span_end": 969, "turn_id": 11},
158
+ {"input_text": "Sí.", "span_text": "però ara no ho estava pas de grassa", "span_start": 1096, "span_end": 1131, "turn_id": 12},
159
+ {"input_text": "Escriu relats.", "span_text": "Segueixes escrivint relats? Recordo que a tots ens agradaven les històries de l'Alba.”\n-“Doncs encara ho faig", "span_start": 1232, "span_end": 1341, "turn_id": 13},
160
+ {"input_text": "A una sessió literària musical.", "span_text": "una sessió literària musical. Si vols venir, podem recordar batalletes.”\nS'hi apuntà", "span_start": 1369, "span_end": 1453, "turn_id": 14},
161
+ {"input_text": "No.", "span_text": "no avaluava les possibilitats d'acabar prenent la darrera copa a casa seva", "span_start": 1641, "span_end": 1715, "turn_id": 15}
162
+ ]
163
+ }
164
+ }
165
+ ```
166
+
167
+ ### Data Fields
168
+
169
+ The data fields are the same among all splits.
170
+
171
+ - `source`: a `string` feature.
172
+ - `id`: a `string` feature.
173
+ - `filename`: a `string` feature.
174
+ - `story`: a `string` feature.
175
+ - `questions`: a `list` of dictionaries containing:
176
+ - `input_text`: a `string` feature.
177
+ - `turn_id`: a `int32` feature.
178
+ - `answers`: a `list` of dictionaries containing:
179
+ - `input_text`: a `string` feature.
180
+ - `span_text`: a `string` feature.
181
+ - `answer_start`: a `int32` feature.
182
+ - `answer_end`: a `int32` feature.
183
+ - `turn_id`: a `int32` feature.
184
+ - `additional_answers` (only in `dev`and `test`): a dictionary feature containing:
185
+ - `0`: a `list` of dictionaries equal to `answers`.
186
+ - `1`: a `list` of dictionaries equal to `answers`.
187
+
188
+ ### Data Splits
189
+
190
+ * dev.json: 8909 question-answering examples. 600 text passages from 4 domains
191
+ * test.json: 8986 question-answering examples. 600 text passages from 6 domains
192
+ * train.json: 71489 question-answering examples. 4800 text passages from 4 domains
193
+
194
+ ## Dataset Creation
195
+
196
+ ### Curation Rationale
197
+
198
+ We created this dataset to contribute to the development of language models in Catalan, a low-resource language.
199
+
200
+ ### Source Data
201
+
202
+ #### Initial Data Collection and Normalization
203
+
204
+ We obtained the initial text passages from different sources, depending on the domain:
205
+
206
+ * biographies: [Catalan wikipedia](ca.wikipedia.org)
207
+ * litterature: [Gutenberg Project](gutenberg.org/)
208
+ * news: [VilaWeb](vilaweb.cat)
209
+ * mitology: [Catalan wikipedia](ca.wikipedia.org)
210
+ * short histories (only in `dev`and `test`): [Petites històries](https://petiteshistories.wordpress.com/)
211
+ * movie plot (only in `dev`and `test`): [Catalan wikipedia](ca.wikipedia.org)
212
+
213
+ #### Who are the source language producers?
214
+
215
+ The contents of [Catalan wikipedia](ca.wikipedia.org) are developed by a team of volunteers, and are subject to review processes also carried out by volunteers.
216
+
217
+ The texts from [VilaWeb](vilaweb.cat) are prepared by journalists and communication professionals, and edited by expert proofreaders.
218
+
219
+ The paragraphes extracted from the [Gutenberg Project](gutenberg.org/) are written by diferent Catalan authors.
220
+
221
+ The texts of the [Petites històries website](https://petiteshistories.wordpress.com/) are written by the writer M. Carme Marí and published on her website. The author has provided them for the preparation of this dataset.
222
+
223
+ ### Annotations
224
+
225
+ #### Annotation process
226
+
227
+ The annotation process was entrusted to the company [m47 labs](https://www.m47labs.com/) through a public tender process.
228
+
229
+ We asked to organize the annotators team in pairs: one of the members asking questions from the text passage and the other one answering them. For the elaboration of addicional answers for the dev and test splits, we asked the participation of a third person, not involved in the original conversation.
230
+
231
+ Annotation guidelines can be found in [Zenodo](link).
232
+
233
+ #### Who are the annotators?
234
+
235
+ Annotation was entrusted to the company [m47 labs](https://www.m47labs.com/) through a public tender process.
236
+
237
+ We asked for a team of at least 4 annotators, students or graduates of universities, ideally in the field of Humanities or Social Sciences, with optimal demonstrable knowledge of the Catalan language (minimum level C1, or equivalent), and a senior coordinator with proven experience in management and coordination of text annotation.
238
+
239
+ ### Personal and Sensitive Information
240
+
241
+ No personal or sensitive information included.
242
+
243
+ ## Considerations for Using the Data
244
+
245
+ ### Social Impact of Dataset
246
+
247
+ We hope that this dataset will help the development of virtual assistants in Catalan, a language that is often not taken into account.
248
+
249
+ ### Discussion of Biases
250
+
251
+ [More Information Needed]
252
+
253
+ ### Other Known Limitations
254
+
255
+ [More Information Needed]
256
+
257
+ ## Additional Information
258
+
259
+ ### Dataset Curators
260
+
261
+ Language Technologies Unit at the Barcelona Supercomputing Center (langtech@bsc.es)
262
+
263
+ This work was funded by the [Departament de la Vicepresidència i de Polítiques Digitals i Territori de la Generalitat de Catalunya](https://politiquesdigitals.gencat.cat/ca/inici/index.html#googtrans(ca|en) within the framework of [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina).
264
+
265
+ ### Licensing Information
266
+
267
+ This work is licensed under a [CC BY-NC-ND 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/deed.en_GB).
268
+
269
+ ### Citation Information
270
+
271
+ DOI []
272
+
273
+ ### Contributions
274
+
275
+ The annotation was entrusted to the company [m47 labs](https://www.m47labs.com/) through a public tender process.
276
+
277
+ Thanks to [M. Carme Marí](https://petiteshistories.wordpress.com/quant-a/) and the [VilaWeb](vilaweb.cat) team for allowing us to use their texts. And also to all the [Catalan wikipedia](ca.wikipedia.org) and [Gutenberg Project](gutenberg.org/) volunteers all their work.
coqcat.py ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """CoQA dataset."""
2
+
3
+
4
+ import json
5
+
6
+ import datasets
7
+
8
+
9
+ _HOMEPAGE = ""
10
+
11
+ _CITATION = """\
12
+
13
+ """
14
+
15
+ _DESCRIPTION = """\
16
+ CoQCat - Conversational Question Answering in Catalan
17
+ """
18
+
19
+ _TRAIN_FILE = "train.json"
20
+ _DEV_FILE = "dev.json"
21
+ _TEST_FILE = "test.json"
22
+
23
+ class Coqa(datasets.GeneratorBasedBuilder):
24
+
25
+ VERSION = datasets.Version("1.0.0")
26
+
27
+ def _info(self):
28
+ return datasets.DatasetInfo(
29
+ description=_DESCRIPTION,
30
+ features=datasets.Features(
31
+ {
32
+ "source": datasets.Value("string"),
33
+ "story": datasets.Value("string"),
34
+ "questions": datasets.features.Sequence(datasets.Value("string")),
35
+ "answers": datasets.features.Sequence(
36
+ {
37
+ "input_text": datasets.Value("string"),
38
+ "answer_start": datasets.Value("int32"),
39
+ "answer_end": datasets.Value("int32"),
40
+ }
41
+ ),
42
+ }
43
+ ),
44
+ homepage=_HOMEPAGE,
45
+ citation=_CITATION,
46
+ )
47
+
48
+
49
+ def _split_generators(self, dl_manager):
50
+ """Returns SplitGenerators."""
51
+ urls_to_download = {
52
+ "train": f"{_TRAIN_FILE}",
53
+ "dev": f"{_DEV_FILE}",
54
+ "test": f"{_TEST_FILE}",
55
+ }
56
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
57
+
58
+ return [
59
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"], "split": "train"}),
60
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"], "split": "validation"}),
61
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"], "split": "test"}),
62
+ ]
63
+
64
+ def _generate_examples(self, filepath, split):
65
+ """Yields examples."""
66
+ with open(filepath, encoding="utf-8") as f:
67
+ data = json.load(f)
68
+ for row in data["data"]:
69
+ questions = [question["input_text"] for question in row["questions"]]
70
+ story = row["story"]
71
+ source = row["source"]
72
+ answers_start = [answer["span_start"] for answer in row["answers"]]
73
+ answers_end = [answer["span_end"] for answer in row["answers"]]
74
+ answers = [answer["input_text"] for answer in row["answers"]]
75
+ yield row["id"], {
76
+ "source": source,
77
+ "story": story,
78
+ "questions": questions,
79
+ "answers": {"input_text": answers, "answer_start": answers_start, "answer_end": answers_end},
80
+ }
dev.json ADDED
The diff for this file is too large to render. See raw diff
 
test.json ADDED
The diff for this file is too large to render. See raw diff
 
train.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c54d9bd38b948c361840d49e8a54bc19f10ba464c3e30e74e42fc4a97f0581dd
3
+ size 40592005