Datasets:

Modalities:
Text
Formats:
parquet
Sub-tasks:
extractive-qa
Languages:
Korean
ArXiv:
Libraries:
Datasets
pandas
License:

Convert dataset to Parquet

#3
by albertvillanova HF staff - opened
README.md CHANGED
@@ -20,6 +20,7 @@ task_ids:
20
  paperswithcode_id: korquad
21
  pretty_name: The Korean Question Answering Dataset
22
  dataset_info:
 
23
  features:
24
  - name: id
25
  dtype: string
@@ -35,16 +36,23 @@ dataset_info:
35
  dtype: string
36
  - name: answer_start
37
  dtype: int32
38
- config_name: squad_kor_v1
39
  splits:
40
  - name: train
41
- num_bytes: 83380337
42
  num_examples: 60407
43
  - name: validation
44
- num_bytes: 8261729
45
  num_examples: 5774
46
- download_size: 42408533
47
- dataset_size: 91642066
 
 
 
 
 
 
 
 
48
  ---
49
 
50
  # Dataset Card for KorQuAD v1.0
 
20
  paperswithcode_id: korquad
21
  pretty_name: The Korean Question Answering Dataset
22
  dataset_info:
23
+ config_name: squad_kor_v1
24
  features:
25
  - name: id
26
  dtype: string
 
36
  dtype: string
37
  - name: answer_start
38
  dtype: int32
 
39
  splits:
40
  - name: train
41
+ num_bytes: 83380141
42
  num_examples: 60407
43
  - name: validation
44
+ num_bytes: 8261701
45
  num_examples: 5774
46
+ download_size: 12713412
47
+ dataset_size: 91641842
48
+ configs:
49
+ - config_name: squad_kor_v1
50
+ data_files:
51
+ - split: train
52
+ path: squad_kor_v1/train-*
53
+ - split: validation
54
+ path: squad_kor_v1/validation-*
55
+ default: true
56
  ---
57
 
58
  # Dataset Card for KorQuAD v1.0
squad_kor_v1.py DELETED
@@ -1,122 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """KorQuAD v1.0:The Korean Question Answering Dataset"""
17
-
18
-
19
- import json
20
-
21
- import datasets
22
- from datasets.tasks import QuestionAnsweringExtractive
23
-
24
-
25
- _CITATION = """\
26
- @article{lim2019korquad1,
27
- title={Korquad1. 0: Korean qa dataset for machine reading comprehension},
28
- author={Lim, Seungyoung and Kim, Myungji and Lee, Jooyoul},
29
- journal={arXiv preprint arXiv:1909.07005},
30
- year={2019}
31
- }
32
- """
33
-
34
- _DESCRIPTION = """\
35
- KorQuAD 1.0 is a large-scale Korean dataset for machine reading comprehension task consisting of human generated questions for Wikipedia articles. We benchmark the data collecting process of SQuADv1.0 and crowdsourced 70,000+ question-answer pairs. 1,637 articles and 70,079 pairs of question answers were collected. 1,420 articles are used for the training set, 140 for the dev set, and 77 for the test set. 60,407 question-answer pairs are for the training set, 5,774 for the dev set, and 3,898 for the test set.
36
- """
37
- _HOMEPAGE = "https://korquad.github.io/KorQuad%201.0/"
38
- _LICENSE = "CC BY-ND 2.0 KR"
39
-
40
- _URL = "https://korquad.github.io/dataset/"
41
- _URLS = {
42
- "train": _URL + "KorQuAD_v1.0_train.json",
43
- "dev": _URL + "KorQuAD_v1.0_dev.json",
44
- }
45
-
46
-
47
- class SquadKorV1(datasets.GeneratorBasedBuilder):
48
- """KorQuAD 1.0 dataset"""
49
-
50
- VERSION = datasets.Version("1.0.0")
51
- BUILDER_CONFIGS = [
52
- datasets.BuilderConfig(
53
- name="squad_kor_v1",
54
- version=VERSION,
55
- description=_DESCRIPTION,
56
- ),
57
- ]
58
-
59
- def _info(self):
60
- return datasets.DatasetInfo(
61
- description=_DESCRIPTION,
62
- features=datasets.Features(
63
- {
64
- "id": datasets.Value("string"),
65
- "title": datasets.Value("string"),
66
- "context": datasets.Value("string"),
67
- "question": datasets.Value("string"),
68
- "answers": datasets.features.Sequence(
69
- {
70
- "text": datasets.Value("string"),
71
- "answer_start": datasets.Value("int32"),
72
- }
73
- ),
74
- }
75
- ),
76
- supervised_keys=None,
77
- homepage=_HOMEPAGE,
78
- license=_LICENSE,
79
- citation=_CITATION,
80
- task_templates=[
81
- QuestionAnsweringExtractive(
82
- question_column="question", context_column="context", answers_column="answers"
83
- )
84
- ],
85
- )
86
-
87
- def _split_generators(self, dl_manager):
88
- """Returns SplitGenerators."""
89
- # download and extract URLs
90
- urls_to_download = _URLS
91
- downloaded_files = dl_manager.download_and_extract(urls_to_download)
92
-
93
- return [
94
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
95
- datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
96
- ]
97
-
98
- def _generate_examples(self, filepath):
99
- """Yields examples."""
100
- with open(filepath, encoding="utf-8") as f:
101
- squad = json.load(f)
102
- for example in squad["data"]:
103
- title = example.get("title", "").strip()
104
- for paragraph in example["paragraphs"]:
105
- context = paragraph["context"].strip()
106
- for qa in paragraph["qas"]:
107
- question = qa["question"].strip()
108
- id_ = qa["id"]
109
-
110
- answer_starts = [answer["answer_start"] for answer in qa["answers"]]
111
- answers = [answer["text"].strip() for answer in qa["answers"]]
112
-
113
- yield id_, {
114
- "title": title,
115
- "context": context,
116
- "question": question,
117
- "id": id_,
118
- "answers": {
119
- "answer_start": answer_starts,
120
- "text": answers,
121
- },
122
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
squad_kor_v1/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:036d1c8992ed7fc71d94bf737bdf18ca0c8bdaad44265f56a7a47dabe1f53cef
3
+ size 11553672
squad_kor_v1/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03c3e9247a1035e7ee0ef7db4487292cc597e09a7a9d3fa4597718a6551e360d
3
+ size 1159740