update dataset
Browse files- .gitignore +4 -0
- README.md +16 -0
- tydiqa-goldp-th.py +110 -0
- tydiqa.dev.json +0 -0
- tydiqa.goldp.th.dev.json +0 -0
- tydiqa.train.json +0 -0
- xtreme/tydiqa.goldp.th.dev.json +0 -0
.gitignore
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
notebooks
|
2 |
+
|
3 |
+
**/.DS_Store
|
4 |
+
**/*.ipynb*
|
README.md
CHANGED
@@ -1,3 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# TyDiQA-GoldP-Th
|
2 |
This dataset contains a removed Thai TyDiQA dataset obtained from [Khalidalt's TyDiQA Dataset](https://huggingface.co/datasets/khalidalt/tydiqa-goldp).
|
3 |
This dataset version does the following additional preprocessing to the dataset
|
|
|
1 |
+
---
|
2 |
+
pretty_name: TyDiQA-GoldP-Th
|
3 |
+
languages:
|
4 |
+
- th
|
5 |
+
task_categories:
|
6 |
+
- question-answering
|
7 |
+
task_ids:
|
8 |
+
- extractive-qa
|
9 |
+
configs:
|
10 |
+
- config_name: default
|
11 |
+
data_files:
|
12 |
+
- split: train
|
13 |
+
path: tydiqa.goldp.th.train.json
|
14 |
+
- split: dev
|
15 |
+
path: tydiqa.goldp.th.dev.json
|
16 |
+
---
|
17 |
# TyDiQA-GoldP-Th
|
18 |
This dataset contains a removed Thai TyDiQA dataset obtained from [Khalidalt's TyDiQA Dataset](https://huggingface.co/datasets/khalidalt/tydiqa-goldp).
|
19 |
This dataset version does the following additional preprocessing to the dataset
|
tydiqa-goldp-th.py
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Modified from https://huggingface.co/datasets/khalidalt/tydiqa-goldp/blob/main/tydiqa-goldp.py
|
3 |
+
"""
|
4 |
+
|
5 |
+
import json
|
6 |
+
import textwrap
|
7 |
+
|
8 |
+
import datasets
|
9 |
+
from datasets.tasks import QuestionAnsweringExtractive
|
10 |
+
|
11 |
+
# TODO(tydiqa): BibTeX citation
|
12 |
+
_CITATION = """\
|
13 |
+
@article{tydiqa,
|
14 |
+
title = {TyDi QA: A Benchmark for Information-Seeking Question Answering in Typologically Diverse Languages},
|
15 |
+
author = {Jonathan H. Clark and Eunsol Choi and Michael Collins and Dan Garrette and Tom Kwiatkowski and Vitaly Nikolaev and Jennimaria Palomaki}
|
16 |
+
year = {2020},
|
17 |
+
journal = {Transactions of the Association for Computational Linguistics}
|
18 |
+
}
|
19 |
+
"""
|
20 |
+
|
21 |
+
# TODO(tydiqa):
|
22 |
+
_DESCRIPTION = """\
|
23 |
+
TyDi QA is a question answering dataset covering 11 typologically diverse languages with 204K question-answer pairs.
|
24 |
+
The languages of TyDi QA are diverse with regard to their typology -- the set of linguistic features that each language
|
25 |
+
expresses -- such that we expect models performing well on this set to generalize across a large number of the languages
|
26 |
+
in the world. It contains language phenomena that would not be found in English-only corpora. To provide a realistic
|
27 |
+
information-seeking task and avoid priming effects, questions are written by people who want to know the answer, but
|
28 |
+
don’t know the answer yet, (unlike SQuAD and its descendents) and the data is collected directly in each language without
|
29 |
+
the use of translation (unlike MLQA and XQuAD).
|
30 |
+
"""
|
31 |
+
|
32 |
+
|
33 |
+
_LANG = ["thai"]
|
34 |
+
|
35 |
+
_URL = "https://huggingface.co/datasets/chompk/tydiqa-goldp-th/resolve/main/tydiqa.{split}.jsonl"
|
36 |
+
_VERSION = datasets.Version("1.1.0", "")
|
37 |
+
|
38 |
+
|
39 |
+
class tydiqa_GoldP_th(datasets.GeneratorBasedBuilder):
|
40 |
+
BUILDER_CONFIGS = [
|
41 |
+
datasets.BuilderConfig(
|
42 |
+
name=lang,
|
43 |
+
description=f"tydiqa-GoldP language {lang}",
|
44 |
+
version=_VERSION,
|
45 |
+
)
|
46 |
+
for lang in _LANG
|
47 |
+
]
|
48 |
+
|
49 |
+
|
50 |
+
def _info(self):
|
51 |
+
# TODO(tydiqa): Specifies the datasets.DatasetInfo object
|
52 |
+
|
53 |
+
return datasets.DatasetInfo(
|
54 |
+
description=_DESCRIPTION,
|
55 |
+
features=dataset.Features(
|
56 |
+
"paragraphs": datasets.features.Sequence({
|
57 |
+
"context": datasets.Value("string"),
|
58 |
+
"qas": datasets.features.Sequence({
|
59 |
+
"answers": datasets.features.Sequence({
|
60 |
+
"answer_start": datasets.Value("int32"),
|
61 |
+
"answer_end": datasets.Value("int32"),
|
62 |
+
"text": datasets.Value("string"),
|
63 |
+
}),
|
64 |
+
"question": datasets.Value("string"),
|
65 |
+
"id": datasets.Value("string"),
|
66 |
+
})
|
67 |
+
})
|
68 |
+
),
|
69 |
+
# No default supervised_keys (as we have to pass both question
|
70 |
+
# and context as input).
|
71 |
+
supervised_keys=None,
|
72 |
+
homepage="https://github.com/google-research-datasets/tydiqa",
|
73 |
+
citation=_CITATION,
|
74 |
+
task_templates=[
|
75 |
+
QuestionAnsweringExtractive(
|
76 |
+
question_column="question", context_column="context", answers_column="answers"
|
77 |
+
)
|
78 |
+
],
|
79 |
+
)
|
80 |
+
|
81 |
+
def _split_generators(self, dl_manager):
|
82 |
+
"""Returns SplitGenerators."""
|
83 |
+
# TODO(tydiqa): Downloads the data and defines the splits
|
84 |
+
# dl_manager is a datasets.download.DownloadManager that can be used to
|
85 |
+
# download and extract URLs
|
86 |
+
language = self.config.name
|
87 |
+
splits = {datasets.Split.TRAIN: "train", datasets.Split.VALIDATION: "dev"}
|
88 |
+
|
89 |
+
data_urls = {
|
90 |
+
split: _URL.format(language=language, split=splits[split]) for split in splits
|
91 |
+
}
|
92 |
+
|
93 |
+
dl_paths = dl_manager.download(data_urls)
|
94 |
+
return [
|
95 |
+
datasets.SplitGenerator(
|
96 |
+
name=split,
|
97 |
+
gen_kwargs={"filepath": dl_paths[split]},
|
98 |
+
)
|
99 |
+
for split in splits
|
100 |
+
]
|
101 |
+
|
102 |
+
def _generate_examples(self, filepath):
|
103 |
+
"""Yields examples."""
|
104 |
+
# TODO(tydiqa): Yields (key, example) tuples from the dataset
|
105 |
+
|
106 |
+
with open(filepath, encoding="utf-8") as f:
|
107 |
+
for _id,row in enumerate(f):
|
108 |
+
data = json.loads(row)
|
109 |
+
|
110 |
+
yield _id, data
|
tydiqa.dev.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tydiqa.goldp.th.dev.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|
tydiqa.train.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
xtreme/tydiqa.goldp.th.dev.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|