Commit
•
743507f
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +172 -0
- dataset_infos.json +1 -0
- dummy/squad_kor_v2/2.1.0/dummy_data.zip +3 -0
- squad_kor_v2.py +149 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- ko
|
8 |
+
licenses:
|
9 |
+
- cc-by-nd-2-0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- extended|squad_kor_v1
|
16 |
+
- original
|
17 |
+
task_categories:
|
18 |
+
- question-answering
|
19 |
+
task_ids:
|
20 |
+
- extractive-qa
|
21 |
+
---
|
22 |
+
|
23 |
+
# Dataset Card for KorQuAD v2.1
|
24 |
+
|
25 |
+
## Table of Contents
|
26 |
+
- [Dataset Description](#dataset-description)
|
27 |
+
- [Dataset Summary](#dataset-summary)
|
28 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
29 |
+
- [Languages](#languages)
|
30 |
+
- [Dataset Structure](#dataset-structure)
|
31 |
+
- [Data Instances](#data-instances)
|
32 |
+
- [Data Fields](#data-instances)
|
33 |
+
- [Data Splits](#data-instances)
|
34 |
+
- [Dataset Creation](#dataset-creation)
|
35 |
+
- [Curation Rationale](#curation-rationale)
|
36 |
+
- [Source Data](#source-data)
|
37 |
+
- [Annotations](#annotations)
|
38 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
39 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
40 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
41 |
+
- [Discussion of Biases](#discussion-of-biases)
|
42 |
+
- [Other Known Limitations](#other-known-limitations)
|
43 |
+
- [Additional Information](#additional-information)
|
44 |
+
- [Dataset Curators](#dataset-curators)
|
45 |
+
- [Licensing Information](#licensing-information)
|
46 |
+
- [Citation Information](#citation-information)
|
47 |
+
|
48 |
+
## Dataset Description
|
49 |
+
|
50 |
+
- [**Homepage**](https://korquad.github.io/)
|
51 |
+
- [**Repository**](https://github.com/korquad/korquad.github.io/tree/master/dataset)
|
52 |
+
- [**Paper**](https://korquad.github.io/dataset/KorQuAD_2.0/KorQuAD_2.0_paper.pdf)
|
53 |
+
|
54 |
+
### Dataset Summary
|
55 |
+
|
56 |
+
KorQuAD 2.0 is a Korean question and answering dataset consisting of a total of 100,000+ pairs. There are three major differences from KorQuAD 1.0, which is the standard Korean Q & A data. The first is that a given document is a whole Wikipedia page, not just one or two paragraphs. Second, because the document also contains tables and lists, it is necessary to understand the document structured with HTML tags. Finally, the answer can be a long text covering not only word or phrase units, but paragraphs, tables, and lists.
|
57 |
+
|
58 |
+
### Supported Tasks and Leaderboards
|
59 |
+
|
60 |
+
`question-answering`
|
61 |
+
|
62 |
+
### Languages
|
63 |
+
|
64 |
+
Korean
|
65 |
+
|
66 |
+
## Dataset Structure
|
67 |
+
|
68 |
+
Follows the standart SQuAD format. There is only 1 answer per question
|
69 |
+
|
70 |
+
### Data Instances
|
71 |
+
|
72 |
+
An example from the data set looks as follows:
|
73 |
+
```py
|
74 |
+
{'answer': {'answer_start': 3873,
|
75 |
+
'html_answer_start': 16093,
|
76 |
+
'text': '20,890 표'},
|
77 |
+
'context': '<!DOCTYPE html>\n<html>\n<head>\n<meta>\n<title>심규언 - 위키백과, 우리 모두의 백과사전</title>\n\n\n<link>\n.....[omitted]',
|
78 |
+
'id': '36615',
|
79 |
+
'question': '심규언은 17대 지방 선거에서 몇 표를 득표하였는가?',
|
80 |
+
'raw_html': '<!DOCTYPE html>\n<html c ...[omitted]',
|
81 |
+
'title': '심규언',
|
82 |
+
'url': 'https://ko.wikipedia.org/wiki/심규언'}
|
83 |
+
```
|
84 |
+
|
85 |
+
### Data Fields
|
86 |
+
```py
|
87 |
+
{'id': Value(dtype='string', id=None),
|
88 |
+
'title': Value(dtype='string', id=None),
|
89 |
+
'context': Value(dtype='string', id=None),
|
90 |
+
'question': Value(dtype='string', id=None),
|
91 |
+
'answer': {'text': Value(dtype='string', id=None),
|
92 |
+
'answer_start': Value(dtype='int32', id=None),
|
93 |
+
'html_answer_start': Value(dtype='int32', id=None)},
|
94 |
+
'url': Value(dtype='string', id=None),
|
95 |
+
'raw_html': Value(dtype='string', id=None)}
|
96 |
+
```
|
97 |
+
### Data Splits
|
98 |
+
|
99 |
+
- Train : 83486
|
100 |
+
- Validation: 10165
|
101 |
+
|
102 |
+
## Dataset Creation
|
103 |
+
|
104 |
+
### Curation Rationale
|
105 |
+
|
106 |
+
[More Information Needed]
|
107 |
+
|
108 |
+
### Source Data
|
109 |
+
|
110 |
+
Wikipedia
|
111 |
+
|
112 |
+
#### Initial Data Collection and Normalization
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
#### Who are the source language producers?
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
### Annotations
|
121 |
+
|
122 |
+
#### Annotation process
|
123 |
+
|
124 |
+
[More Information Needed]
|
125 |
+
|
126 |
+
#### Who are the annotators?
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
### Personal and Sensitive Information
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
## Considerations for Using the Data
|
135 |
+
|
136 |
+
### Social Impact of Dataset
|
137 |
+
|
138 |
+
[More Information Needed]
|
139 |
+
|
140 |
+
### Discussion of Biases
|
141 |
+
|
142 |
+
[More Information Needed]
|
143 |
+
|
144 |
+
### Other Known Limitations
|
145 |
+
|
146 |
+
[More Information Needed]
|
147 |
+
|
148 |
+
## Additional Information
|
149 |
+
|
150 |
+
### Dataset Curators
|
151 |
+
|
152 |
+
[More Information Needed]
|
153 |
+
|
154 |
+
### Licensing Information
|
155 |
+
|
156 |
+
[CC BY-ND 2.0 KR](https://creativecommons.org/licenses/by-nd/2.0/kr/deed.en)
|
157 |
+
|
158 |
+
### Citation Information
|
159 |
+
```
|
160 |
+
@article{NODE09353166,
|
161 |
+
author={Youngmin Kim,Seungyoung Lim;Hyunjeong Lee;Soyoon Park;Myungji Kim},
|
162 |
+
title={{KorQuAD 2.0: Korean QA Dataset for Web Document Machine Comprehension}},
|
163 |
+
booltitle={{Journal of KIISE 제47권 제6호}},
|
164 |
+
journal={{Journal of KIISE}},
|
165 |
+
volume={{47}},
|
166 |
+
issue={{6}},
|
167 |
+
publisher={The Korean Institute of Information Scientists and Engineers},
|
168 |
+
year={2020},
|
169 |
+
ISSN={{2383-630X}},
|
170 |
+
pages={577-586},
|
171 |
+
url={http://www.dbpia.co.kr/journal/articleDetail?nodeId=NODE09353166}}
|
172 |
+
```
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"squad_kor_v2": {"description": "KorQuAD 2.0 is a Korean question and answering dataset consisting of a total of 100,000+ pairs. There are three major differences from KorQuAD 1.0, which is the standard Korean Q & A data. The first is that a given document is a whole Wikipedia page, not just one or two paragraphs. Second, because the document also contains tables and lists, it is necessary to understand the document structured with HTML tags. Finally, the answer can be a long text covering not only word or phrase units, but paragraphs, tables, and lists. As a baseline model, BERT Multilingual is used, released by Google as an open source. It shows 46.0% F1 score, a very low score compared to 85.7% of the human F1 score. It indicates that this data is a challenging task. Additionally, we increased the performance by no-answer data augmentation. Through the distribution of this data, we intend to extend the limit of MRC that was limited to plain text to real world tasks of various lengths and formats.\n", "citation": "@article{NODE09353166,\n author={Youngmin Kim,Seungyoung Lim;Hyunjeong Lee;Soyoon Park;Myungji Kim},\n title={{KorQuAD 2.0: Korean QA Dataset for Web Document Machine Comprehension}},\n booltitle={{Journal of KIISE \uc81c47\uad8c \uc81c6\ud638}},\n journal={{Journal of KIISE}},\n volume={{47}},\n issue={{6}},\n publisher={The Korean Institute of Information Scientists and Engineers},\n year={2020},\n ISSN={{2383-630X}},\n pages={577-586},\n url={http://www.dbpia.co.kr/journal/articleDetail?nodeId=NODE09353166}}\n", "homepage": "https://korquad.github.io/", "license": "CC BY-ND 2.0 KR", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "answer_start": {"dtype": "int32", "id": null, "_type": "Value"}, "html_answer_start": {"dtype": "int32", "id": null, "_type": "Value"}}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "raw_html": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "squad_kor_v2", "config_name": "squad_kor_v2", "version": {"version_str": "2.1.0", "description": null, "major": 2, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 17983434492, "num_examples": 83486, "dataset_name": "squad_kor_v2"}, "validation": {"name": "validation", "num_bytes": 2230543100, "num_examples": 10165, "dataset_name": "squad_kor_v2"}}, "download_checksums": {"https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_00.zip": {"num_bytes": 96161084, "checksum": "98918d10e3e08bf6b34b50d17cd7f7438d5a577a8089d02698d16a151424a36a"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_01.zip": {"num_bytes": 92163603, "checksum": "0a8a59ee82e92e9509c5dbf7d98a31c007a3693afb818e37c60ddacf7f48c4b3"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_02.zip": {"num_bytes": 91681447, "checksum": "7035a35daac0c210b4754fc6a2885442929754db35e33b40d7c912706c66b9bc"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_03.zip": {"num_bytes": 94792676, "checksum": "4a61272d13e535f73fa20f2d1619b895adb763d8fa7cf02d813b733e7f702562"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_04.zip": {"num_bytes": 94470762, "checksum": "35834a74b3486eaa32712c689bccaab0c841c3ee252560e754245d3ed89e1c3a"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_05.zip": {"num_bytes": 93427959, "checksum": "5ea9b2975451c5a67bc172690a56a6e7a9e87b4001d3d1d684cb1336958a3a3b"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_06.zip": {"num_bytes": 93224892, "checksum": "87872acd46c2a8291a176826ad7eb23f3a6cf1db05bb27566d2eac1199a9091b"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_07.zip": {"num_bytes": 92550803, "checksum": "a615c0ebba60fc9b55fa602973d504f76d0273592c22f63b7f202655c1bb10bf"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_08.zip": {"num_bytes": 93684404, "checksum": "fa3955e23eab859819990edde3dd23308740cf94c3839fb538f30b1126117a39"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_09.zip": {"num_bytes": 94028022, "checksum": "b3b7ec508fbacaf6a5c12065e1d061cbfd8990bf2ae4c940a0a8d841294c2c1c"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_10.zip": {"num_bytes": 93432479, "checksum": "b7e8e44e43ec63514265e2202f73a4a6ce46f7226cc5662efc6a2ab92161a462"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_11.zip": {"num_bytes": 94500610, "checksum": "f6483e1e4b2577603e4fc881ec1651ca2ea5764a4b0f7e5eb59007ed9cc4bbae"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/train/KorQuAD_2.1_train_12.zip": {"num_bytes": 99301520, "checksum": "84c4b6391a07bc1fdcc70d7194bda0e65edc796ae9b4e184a58c58d6973af7ad"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/dev/KorQuAD_2.1_dev_00.zip": {"num_bytes": 93536216, "checksum": "4a0b25f896f333dc470e87b83cef874a9f7ea9a3df4c83f5ce8d5de6d71b07db"}, "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1/dev/KorQuAD_2.1_dev_01.zip": {"num_bytes": 56806828, "checksum": "bf76fe7c684409151f92eacc56d551d0471477c47959b916c002ae39666caf59"}}, "download_size": 1373763305, "post_processing_size": null, "dataset_size": 20213977592, "size_in_bytes": 21587740897}}
|
dummy/squad_kor_v2/2.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:49d312db185274c99426ad0933495fbf5e5dd3b22d93297579248991616009dd
|
3 |
+
size 36392
|
squad_kor_v2.py
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 v2.1:The Korean Question Answering Dataset"""
|
17 |
+
|
18 |
+
from __future__ import absolute_import, division, print_function
|
19 |
+
|
20 |
+
import json
|
21 |
+
import os
|
22 |
+
|
23 |
+
import datasets
|
24 |
+
|
25 |
+
|
26 |
+
_CITATION = """\
|
27 |
+
@article{NODE09353166,
|
28 |
+
author={Youngmin Kim,Seungyoung Lim;Hyunjeong Lee;Soyoon Park;Myungji Kim},
|
29 |
+
title={{KorQuAD 2.0: Korean QA Dataset for Web Document Machine Comprehension}},
|
30 |
+
booltitle={{Journal of KIISE 제47권 제6호}},
|
31 |
+
journal={{Journal of KIISE}},
|
32 |
+
volume={{47}},
|
33 |
+
issue={{6}},
|
34 |
+
publisher={The Korean Institute of Information Scientists and Engineers},
|
35 |
+
year={2020},
|
36 |
+
ISSN={{2383-630X}},
|
37 |
+
pages={577-586},
|
38 |
+
url={http://www.dbpia.co.kr/journal/articleDetail?nodeId=NODE09353166}}
|
39 |
+
"""
|
40 |
+
|
41 |
+
_DESCRIPTION = """\
|
42 |
+
KorQuAD 2.0 is a Korean question and answering dataset consisting of a total of 100,000+ pairs. There are three major differences from KorQuAD 1.0, which is the standard Korean Q & A data. The first is that a given document is a whole Wikipedia page, not just one or two paragraphs. Second, because the document also contains tables and lists, it is necessary to understand the document structured with HTML tags. Finally, the answer can be a long text covering not only word or phrase units, but paragraphs, tables, and lists. As a baseline model, BERT Multilingual is used, released by Google as an open source. It shows 46.0% F1 score, a very low score compared to 85.7% of the human F1 score. It indicates that this data is a challenging task. Additionally, we increased the performance by no-answer data augmentation. Through the distribution of this data, we intend to extend the limit of MRC that was limited to plain text to real world tasks of various lengths and formats.
|
43 |
+
"""
|
44 |
+
_HOMEPAGE = "https://korquad.github.io/"
|
45 |
+
_LICENSE = "CC BY-ND 2.0 KR"
|
46 |
+
|
47 |
+
_URL = "https://github.com/korquad/korquad.github.io/raw/master/dataset/KorQuAD_2.1"
|
48 |
+
_URLS = {
|
49 |
+
"train": [
|
50 |
+
_URL + "/train/KorQuAD_2.1_train_00.zip",
|
51 |
+
_URL + "/train/KorQuAD_2.1_train_01.zip",
|
52 |
+
_URL + "/train/KorQuAD_2.1_train_02.zip",
|
53 |
+
_URL + "/train/KorQuAD_2.1_train_03.zip",
|
54 |
+
_URL + "/train/KorQuAD_2.1_train_04.zip",
|
55 |
+
_URL + "/train/KorQuAD_2.1_train_05.zip",
|
56 |
+
_URL + "/train/KorQuAD_2.1_train_06.zip",
|
57 |
+
_URL + "/train/KorQuAD_2.1_train_07.zip",
|
58 |
+
_URL + "/train/KorQuAD_2.1_train_08.zip",
|
59 |
+
_URL + "/train/KorQuAD_2.1_train_09.zip",
|
60 |
+
_URL + "/train/KorQuAD_2.1_train_10.zip",
|
61 |
+
_URL + "/train/KorQuAD_2.1_train_11.zip",
|
62 |
+
_URL + "/train/KorQuAD_2.1_train_12.zip",
|
63 |
+
],
|
64 |
+
"validation": [_URL + "/dev/KorQuAD_2.1_dev_00.zip", _URL + "/dev/KorQuAD_2.1_dev_01.zip"],
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
class SquadKorV2(datasets.GeneratorBasedBuilder):
|
69 |
+
"""KorQuAD 2.1 dataset"""
|
70 |
+
|
71 |
+
VERSION = datasets.Version("2.1.0")
|
72 |
+
BUILDER_CONFIGS = [
|
73 |
+
datasets.BuilderConfig(name="squad_kor_v2", version=VERSION, description=_DESCRIPTION),
|
74 |
+
]
|
75 |
+
|
76 |
+
def _info(self):
|
77 |
+
return datasets.DatasetInfo(
|
78 |
+
description=_DESCRIPTION,
|
79 |
+
features=datasets.Features(
|
80 |
+
{
|
81 |
+
"id": datasets.Value("string"),
|
82 |
+
"title": datasets.Value("string"),
|
83 |
+
"context": datasets.Value("string"),
|
84 |
+
"question": datasets.Value("string"),
|
85 |
+
"answer": datasets.Features(
|
86 |
+
{
|
87 |
+
"text": datasets.Value("string"),
|
88 |
+
"answer_start": datasets.Value("int32"),
|
89 |
+
"html_answer_start": datasets.Value("int32"),
|
90 |
+
}
|
91 |
+
),
|
92 |
+
"url": datasets.Value("string"),
|
93 |
+
"raw_html": datasets.Value("string"),
|
94 |
+
}
|
95 |
+
),
|
96 |
+
supervised_keys=None,
|
97 |
+
homepage=_HOMEPAGE,
|
98 |
+
license=_LICENSE,
|
99 |
+
citation=_CITATION,
|
100 |
+
)
|
101 |
+
|
102 |
+
def _split_generators(self, dl_manager):
|
103 |
+
"""Returns SplitGenerators."""
|
104 |
+
# download and extract URLs
|
105 |
+
urls_to_download = _URLS
|
106 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
107 |
+
|
108 |
+
return [
|
109 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"dirs": downloaded_files["train"]}),
|
110 |
+
datasets.SplitGenerator(
|
111 |
+
name=datasets.Split.VALIDATION, gen_kwargs={"dirs": downloaded_files["validation"]}
|
112 |
+
),
|
113 |
+
]
|
114 |
+
|
115 |
+
def _generate_examples(self, dirs):
|
116 |
+
"""Yields examples."""
|
117 |
+
|
118 |
+
for d in dirs:
|
119 |
+
filepaths = sorted(os.scandir(d), key=lambda x: x.name)
|
120 |
+
for filepath in filepaths:
|
121 |
+
with open(filepath, encoding="utf-8") as f:
|
122 |
+
squad = json.load(f)
|
123 |
+
for example in squad["data"]:
|
124 |
+
title = example.get("title", "").strip()
|
125 |
+
url = example.get("url", "").strip()
|
126 |
+
raw_html = example.get("raw_html", "").strip()
|
127 |
+
context = example["context"].strip()
|
128 |
+
for qa in example["qas"]:
|
129 |
+
question = qa["question"].strip()
|
130 |
+
answer = qa["answer"]
|
131 |
+
id_ = qa["id"]
|
132 |
+
|
133 |
+
answer_start = answer["answer_start"]
|
134 |
+
html_answer_start = answer["html_answer_start"]
|
135 |
+
answer_text = answer["text"].strip()
|
136 |
+
|
137 |
+
yield id_, {
|
138 |
+
"title": title,
|
139 |
+
"context": context,
|
140 |
+
"question": question,
|
141 |
+
"id": id_,
|
142 |
+
"answer": {
|
143 |
+
"answer_start": answer_start,
|
144 |
+
"html_answer_start": html_answer_start,
|
145 |
+
"text": answer_text,
|
146 |
+
},
|
147 |
+
"url": url,
|
148 |
+
"raw_html": raw_html,
|
149 |
+
}
|