Datasets:

Modalities:
Text
Formats:
json
Sub-tasks:
extractive-qa
Languages:
Catalan
Size:
< 1K
ArXiv:
Libraries:
Datasets
pandas
License:
albertvillanova HF staff commited on
Commit
e2e036d
1 Parent(s): 1c667c9
Files changed (1) hide show
  1. viquiquad.py +22 -27
viquiquad.py CHANGED
@@ -1,26 +1,28 @@
 
1
  # Loading script for the ViquiQuAD dataset.
2
  import json
 
3
  import datasets
4
 
5
  logger = datasets.logging.get_logger(__name__)
6
 
7
- _CITATION = """
8
- Rodriguez-Penagos, Carlos Gerardo, & Armentano-Oller, Carme. (2021).
9
- ViquiQuAD: an extractive QA dataset from Catalan Wikipedia (Version ViquiQuad_v.1.0.1)
10
- [Data set]. Zenodo. http://doi.org/10.5281/zenodo.4761412
11
- """
12
 
13
- _DESCRIPTION = """
14
- ViquiQuAD: an extractive QA dataset from Catalan Wikipedia.
15
- This dataset contains 3111 contexts extracted from a set of 597 high quality original (no translations)
16
- articles in the Catalan Wikipedia "Viquipèdia" (ca.wikipedia.org), and 1 to 5 questions with their
17
- answer for each fragment. Viquipedia articles are used under CC-by-sa licence.
18
- This dataset can be used to build extractive-QA and Language Models.
19
- Funded by the Generalitat de Catalunya, Departament de Polítiques Digitals i Administració Pública (AINA),
20
- MT4ALL and Plan de Impulso de las Tecnologías del Lenguaje (Plan TL).
21
- """
22
 
23
- _HOMEPAGE = """https://zenodo.org/record/4562345#.YK41aqGxWUk"""
24
 
25
  _URL = "https://huggingface.co/datasets/projecte-aina/viquiquad/resolve/main/"
26
  _TRAINING_FILE = "train.json"
@@ -42,17 +44,12 @@ class ViquiQuAD(datasets.GeneratorBasedBuilder):
42
  "title": datasets.Value("string"),
43
  "context": datasets.Value("string"),
44
  "question": datasets.Value("string"),
45
- "answers":[
46
-
47
  {
48
-
49
  "text": datasets.Value("string"),
50
-
51
  "answer_start": datasets.Value("int32"),
52
-
53
  }
54
-
55
- ]
56
  }
57
  ),
58
  # No default supervised_keys (as we have to pass both question
@@ -89,10 +86,8 @@ class ViquiQuAD(datasets.GeneratorBasedBuilder):
89
  for qa in paragraph["qas"]:
90
  question = qa["question"].strip()
91
  id_ = qa["id"]
92
-
93
- # answer_starts = [answer["answer_start"] for answer in qa["answers"]]
94
- # answers = [answer["text"].strip() for answer in qa["answers"]]
95
-
96
  text = qa["answers"][0]["text"]
97
  answer_start = qa["answers"][0]["answer_start"]
98
 
@@ -103,5 +98,5 @@ class ViquiQuAD(datasets.GeneratorBasedBuilder):
103
  "context": context,
104
  "question": question,
105
  "id": id_,
106
- "answers": [{"text": text, "answer_start": answer_start}]
107
  }
 
1
+ """ViquiQuAD Dataset."""
2
  # Loading script for the ViquiQuAD dataset.
3
  import json
4
+
5
  import datasets
6
 
7
  logger = datasets.logging.get_logger(__name__)
8
 
9
+ _CITATION = """\
10
+ Rodriguez-Penagos, Carlos Gerardo, & Armentano-Oller, Carme. (2021).
11
+ ViquiQuAD: an extractive QA dataset from Catalan Wikipedia (Version ViquiQuad_v.1.0.1)
12
+ [Data set]. Zenodo. http://doi.org/10.5281/zenodo.4761412
13
+ """
14
 
15
+ _DESCRIPTION = """\
16
+ ViquiQuAD: an extractive QA dataset from Catalan Wikipedia.
17
+ This dataset contains 3111 contexts extracted from a set of 597 high quality original (no translations)
18
+ articles in the Catalan Wikipedia "Viquipèdia" (ca.wikipedia.org), and 1 to 5 questions with their
19
+ answer for each fragment. Viquipedia articles are used under CC-by-sa licence.
20
+ This dataset can be used to build extractive-QA and Language Models.
21
+ Funded by the Generalitat de Catalunya, Departament de Polítiques Digitals i Administració Pública (AINA),
22
+ MT4ALL and Plan de Impulso de las Tecnologías del Lenguaje (Plan TL).
23
+ """
24
 
25
+ _HOMEPAGE = "https://zenodo.org/record/4562345#.YK41aqGxWUk"
26
 
27
  _URL = "https://huggingface.co/datasets/projecte-aina/viquiquad/resolve/main/"
28
  _TRAINING_FILE = "train.json"
 
44
  "title": datasets.Value("string"),
45
  "context": datasets.Value("string"),
46
  "question": datasets.Value("string"),
47
+ "answers": [
 
48
  {
 
49
  "text": datasets.Value("string"),
 
50
  "answer_start": datasets.Value("int32"),
 
51
  }
52
+ ],
 
53
  }
54
  ),
55
  # No default supervised_keys (as we have to pass both question
 
86
  for qa in paragraph["qas"]:
87
  question = qa["question"].strip()
88
  id_ = qa["id"]
89
+ # answer_starts = [answer["answer_start"] for answer in qa["answers"]]
90
+ # answers = [answer["text"].strip() for answer in qa["answers"]]
 
 
91
  text = qa["answers"][0]["text"]
92
  answer_start = qa["answers"][0]["answer_start"]
93
 
 
98
  "context": context,
99
  "question": question,
100
  "id": id_,
101
+ "answers": [{"text": text, "answer_start": answer_start}],
102
  }