Datasets:

Languages:
Thai
Multilinguality:
monolingual
Size Categories:
1K<n<10K
Language Creators:
found
Annotations Creators:
expert-generated
Source Datasets:
extended|other-thaiqa
Tags:
License:
system HF staff commited on
Commit
56243fc
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.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,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - th
8
+ licenses:
9
+ - cc-by-nc-sa-3-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 1K<n<10K
14
+ source_datasets:
15
+ - extended|other-thaiqa
16
+ task_categories:
17
+ - question-answering
18
+ task_ids:
19
+ - extractive-qa
20
+ - open-domain-qa
21
+ ---
22
+
23
+ # Dataset Card for `thaiqa-squad`
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:** http://github.com/pythainlp/thaiqa_squad (original `thaiqa` at https://aiforthai.in.th/)
51
+ - **Repository:** http://github.com/pythainlp/thaiqa_squad
52
+ - **Paper:**
53
+ - **Leaderboard:**
54
+ - **Point of Contact:**http://github.com/pythainlp/ (original `thaiqa` at https://aiforthai.in.th/)
55
+
56
+ ### Dataset Summary
57
+
58
+ `thaiqa_squad` is an open-domain, extractive question answering dataset (4,000 questions in `train` and 74 questions in `dev`) in [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/) format, originally created by [NECTEC](https://www.nectec.or.th/en/) from Wikipedia articles and adapted to [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/) format by [PyThaiNLP](https://github.com/PyThaiNLP/).
59
+
60
+ ### Supported Tasks and Leaderboards
61
+
62
+ extractive question answering
63
+
64
+ ### Languages
65
+
66
+ Thai
67
+
68
+ ## Dataset Structure
69
+
70
+ ### Data Instances
71
+
72
+ ```
73
+ {'answers': {'answer': ['ฮิกกิ้นส์'], 'answer_begin_position': [528], 'answer_end_position': [537]}, 'article_id': 115035, 'context': '<doc id="115035" url="https://th.wikipedia.org/wiki?curid=115035" title="เบนจี้">เบนจี้ เบนจี้ () เป็นชื่อตัวละครหมาพันทางแสนรู้ ที่ปรากฏอยู่ในภาพยนตร์หลายเรื่องที่เขียนบท และกำกับโดย โจ แคมป์ ในช่วงทศวรรษ 1970 ถึง 1980 ภาพยนตร์เรื่องแรกในชุด ใช้ชื่อเรื่องว่า เบนจี้ เช่นเดียวกับตัวละคร ถ่ายทำที่เมืองดัลลัส รัฐเทกซัส ฉายครั้งแรกในปี พ.ศ. 2517 ภาพยนตร์ได้รับการเสนอชื่อเข้าชิงรางวัลออสการ์ และได้รางวัลลูกโลกทองคำ สาขาเพลงประกอบยอดเยี่ยม จากเพลง Benji\'s Theme (I Feel Love) ร้องโดย ชาร์ลี ริช หมาที่แสดงเป็นเบนจี้ตัวแรก ชื่อว่า ฮิกกิ้นส์ (พ.ศ. 2502 - พ.ศ. 2518) มีอายุถึง 15 ปีแล้วในขณะแสดง หลังจากภาพยนตร์ออกฉายได้ไม่นาน มันก็ตายในปี พ.ศ. 2518เบนจี้ในภาพยนตร์เบนจี้ในภาพยนตร์. - พ.ศ. 2517, Benji (ภาพยนตร์) - พ.ศ. 2520, For the Love of Benji (ภาพยนตร์) - พ.ศ. 2521, Benji\'s Very Own Christmas Story (ภาพยนตร์โทรทัศน์) - พ.ศ. 2523, Oh Heavenly Dog (ภาพยนตร์) - พ.ศ. 2523, Benji at Work (ภาพยนตร์โทรทัศน์) - พ.ศ. 2524, Benji Takes a Dive at Marineland (ภาพยนตร์โทรทัศน์) - พ.ศ. 2526, Benji, Zax & the Alien Prince (ภาพยนตร์ซีรีส์) - พ.ศ. 2530, Benji the Hunted (ภาพยนตร์) - พ.ศ. 2547, Benji: Off the Leash! (ภาพยนตร์) - พ.ศ. 2550, Benji: The Barkening (ภาพยนตร์)</doc>\n', 'question': 'สุนัขตัวแรกรับบทเป็นเบนจี้ในภาพยนตร์เรื่อง Benji ที่ออกฉายในปี พ.ศ. 2517 มีชื่อว่าอะไร', 'question_id': 1}
74
+ {'answers': {'answer': ['ชาร์ลี ริช'], 'answer_begin_position': [482], 'answer_end_position': [492]}, 'article_id': 115035, 'context': '<doc id="115035" url="https://th.wikipedia.org/wiki?curid=115035" title="เบนจี้">เบนจี้ เบนจี้ () เป็นชื่อตัวละครหมาพันทางแสนรู้ ที่ปรากฏอยู่ในภาพยนตร์หลายเรื่องที่เขียนบท และกำกับโดย โจ แคมป์ ในช่วงทศวรรษ 1970 ถึง 1980 ภาพยนตร์เรื่องแรกในชุด ใช้ชื่อเรื่องว่า เบนจี้ เช่นเดียวกับตัวละคร ถ่ายทำที่เมืองดัลลัส รัฐเทกซัส ฉายครั้งแรกในปี พ.ศ. 2517 ภาพยนตร์ได้รับการเสนอชื่อเข้าชิงรางวัลออสการ์ และได้รางวัลลูกโลกทองคำ สาขาเพลงประกอบยอดเยี่ยม จากเพลง Benji\'s Theme (I Feel Love) ร้องโดย ชาร์ลี ริช หมาที่แสดงเป็นเบนจี้ตัวแรก ชื่อว่า ฮิกกิ้นส์ (พ.ศ. 2502 - พ.ศ. 2518) มีอายุถึง 15 ปีแล้วในขณะแสดง หลังจากภาพยนตร์ออกฉายได้ไม่นาน มันก็ตายในปี พ.ศ. 2518เบนจี้ในภาพยนตร์เบนจี้ในภาพยนตร์. - พ.ศ. 2517, Benji (ภาพยนตร์) - พ.ศ. 2520, For the Love of Benji (ภาพยนตร์) - พ.ศ. 2521, Benji\'s Very Own Christmas Story (ภาพยนตร์โทรทัศน์) - พ.ศ. 2523, Oh Heavenly Dog (ภาพยนตร์) - พ.ศ. 2523, Benji at Work (ภาพยนตร์โทรทัศน์) - พ.ศ. 2524, Benji Takes a Dive at Marineland (ภาพยนตร์โทรทัศน์) - พ.ศ. 2526, Benji, Zax & the Alien Prince (ภาพยนตร์ซีรีส์) - พ.ศ. 2530, Benji the Hunted (ภาพยนตร์) - พ.ศ. 2547, Benji: Off the Leash! (ภาพยนตร์) - พ.ศ. 2550, Benji: The Barkening (ภาพยนตร์)</doc>\n', 'question': "เพลง Benji's Theme ใช้ประกอบภาพยนตร์เรื่อง Benji ในปีพ.ศ. 2517 ขับร้องโดยใคร", 'question_id': 2035}
75
+ ```
76
+
77
+ ### Data Fields
78
+
79
+ ```
80
+ {
81
+ "question_id": question id
82
+ "article_id": article id
83
+ "context": article texts
84
+ "question": question
85
+ "answers":
86
+ {
87
+ "answer": answer text
88
+ "answer_begin_position": answer beginning position
89
+ "answer_end_position": answer exclusive upper bound position
90
+ }
91
+ ),
92
+ }
93
+ ```
94
+
95
+ ### Data Splits
96
+
97
+ | | train | valid |
98
+ |-------------------------|-------------|-------------|
99
+ | # questions | 4000 | 74 |
100
+ | # avg words in context | 1186.740750 | 1016.459459 |
101
+ | # avg words in question | 14.325500 | 12.743243 |
102
+ | # avg words in answer | 3.279750 | 4.608108 |
103
+
104
+ ## Dataset Creation
105
+
106
+ ### Curation Rationale
107
+
108
+ [PyThaiNLP](https://github.com/PyThaiNLP/) created `thaiqa_squad` as a [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/) version of [thaiqa](http://copycatch.in.th/thai-qa-task.html). [thaiqa](https://aiforthai.in.th/corpus.php) is part of [The 2nd Question answering program from Thai Wikipedia](http://copycatch.in.th/thai-qa-task.html) of [National Software Contest 2020](http://nsc.siit.tu.ac.th/GENA2/login.php).
109
+
110
+ ### Source Data
111
+
112
+ #### Initial Data Collection and Normalization
113
+
114
+ [More Information Needed]
115
+
116
+ #### Who are the source language producers?
117
+
118
+ Wikipedia authors for contexts and [NECTEC](https://www.nectec.or.th/en/) for questions and answer annotations
119
+
120
+ ### Annotations
121
+
122
+ #### Annotation process
123
+
124
+ [More Information Needed]
125
+
126
+ #### Who are the annotators?
127
+
128
+ [NECTEC](https://www.nectec.or.th/en/)
129
+
130
+ ### Personal and Sensitive Information
131
+
132
+ All contents are from Wikipedia. No personal and sensitive information is expected to be included.
133
+
134
+ ## Considerations for Using the Data
135
+
136
+ ### Social Impact of Dataset
137
+
138
+ - open-domain, extractive question answering in Thai
139
+
140
+ ### Discussion of Biases
141
+
142
+ [More Information Needed]
143
+
144
+ ### Other Known Limitations
145
+
146
+ - The contexts include `<doc>` tags at start and at the end
147
+
148
+ ## Additional Information
149
+
150
+ ### Dataset Curators
151
+
152
+ [NECTEC](https://www.nectec.or.th/en/) for original [thaiqa](https://aiforthai.in.th/corpus.php). SQuAD formattting by [PyThaiNLP](https://github.com/PyThaiNLP/).
153
+
154
+ ### Licensing Information
155
+
156
+ CC-BY-NC-SA 3.0
157
+
158
+ ### Citation Information
159
+
160
+ [More Information Needed]
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"thaiqa_squad": {"description": "`thaiqa_squad` is an open-domain, extractive question answering dataset (4,000 questions in `train` and 74 questions in `dev`) in\n[SQuAD](https://rajpurkar.github.io/SQuAD-explorer/) format, originally created by [NECTEC](https://www.nectec.or.th/en/) from\nWikipedia articles and adapted to [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/) format by [PyThaiNLP](https://github.com/PyThaiNLP/).\n", "citation": "No clear citation guidelines from source:\nhttps://aiforthai.in.th/corpus.php\nSQuAD version:\nhttps://github.com/PyThaiNLP/thaiqa_squad\n", "homepage": "https://github.com/PyThaiNLP/thaiqa_squad", "license": "", "features": {"question_id": {"dtype": "int32", "id": null, "_type": "Value"}, "article_id": {"dtype": "int32", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"answer": {"dtype": "string", "id": null, "_type": "Value"}, "answer_begin_position": {"dtype": "int32", "id": null, "_type": "Value"}, "answer_end_position": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "thaiqa_squad", "config_name": "thaiqa_squad", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 47905050, "num_examples": 4000, "dataset_name": "thaiqa_squad"}, "validation": {"name": "validation", "num_bytes": 744813, "num_examples": 74, "dataset_name": "thaiqa_squad"}}, "download_checksums": {"https://github.com/PyThaiNLP/thaiqa_squad/raw/main/data.zip": {"num_bytes": 10003354, "checksum": "6aa58c8a9b52862de166618b9b682d7094f56a1587f9681f3dd617bfd78f95c8"}}, "download_size": 10003354, "post_processing_size": null, "dataset_size": 48649863, "size_in_bytes": 58653217}}
dummy/thaiqa_squad/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3548d330232ce816f8abafd33b966c106eff85ce22934a9baa27a2a7d18e4ae5
3
+ size 7253
thaiqa_squad.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TODO(squad_v2): Add a description here."""
2
+
3
+ from __future__ import absolute_import, division, print_function
4
+
5
+ import json
6
+ import os
7
+
8
+ import datasets
9
+
10
+
11
+ _CITATION = """\
12
+ No clear citation guidelines from source:
13
+ https://aiforthai.in.th/corpus.php
14
+ SQuAD version:
15
+ https://github.com/PyThaiNLP/thaiqa_squad
16
+ """
17
+
18
+ _DESCRIPTION = """\
19
+ `thaiqa_squad` is an open-domain, extractive question answering dataset (4,000 questions in `train` and 74 questions in `dev`) in
20
+ [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/) format, originally created by [NECTEC](https://www.nectec.or.th/en/) from
21
+ Wikipedia articles and adapted to [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/) format by [PyThaiNLP](https://github.com/PyThaiNLP/).
22
+ """
23
+
24
+
25
+ class ThaiQaSquadConfig(datasets.BuilderConfig):
26
+ def __init__(self, **kwargs):
27
+ """BuilderConfig
28
+
29
+ Args:
30
+ **kwargs: keyword arguments forwarded to super.
31
+ """
32
+ super(ThaiQaSquadConfig, self).__init__(**kwargs)
33
+
34
+
35
+ class ThaiqaSquad(datasets.GeneratorBasedBuilder):
36
+ _DOWNLOAD_URL = "https://github.com/PyThaiNLP/thaiqa_squad/raw/main/data.zip"
37
+ _TRAIN_FILE = "train.jsonl"
38
+ _VAL_FILE = "dev.jsonl"
39
+
40
+ BUILDER_CONFIGS = [
41
+ ThaiQaSquadConfig(
42
+ name="thaiqa_squad",
43
+ version=datasets.Version("1.0.0"),
44
+ description="`thaiqa_squad` is an open-domain, extractive question answering dataset (4,000 questions in `train` and 74 questions in `dev`) in [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/) format",
45
+ ),
46
+ ]
47
+
48
+ def _info(self):
49
+ return datasets.DatasetInfo(
50
+ # This is the description that will appear on the datasets page.
51
+ description=_DESCRIPTION,
52
+ # datasets.features.FeatureConnectors
53
+ features=datasets.Features(
54
+ {
55
+ "question_id": datasets.Value("int32"),
56
+ "article_id": datasets.Value("int32"),
57
+ "context": datasets.Value("string"),
58
+ "question": datasets.Value("string"),
59
+ "answers": datasets.features.Sequence(
60
+ {
61
+ "answer": datasets.Value("string"),
62
+ "answer_begin_position": datasets.Value("int32"),
63
+ "answer_end_position": datasets.Value("int32"),
64
+ }
65
+ ),
66
+ }
67
+ ),
68
+ # If there's a common (input, target) tuple from the features,
69
+ # specify them here. They'll be used if as_supervised=True in
70
+ # builder.as_dataset.
71
+ supervised_keys=None,
72
+ # Homepage of the dataset for documentation
73
+ homepage="https://github.com/PyThaiNLP/thaiqa_squad",
74
+ citation=_CITATION,
75
+ )
76
+
77
+ def _split_generators(self, dl_manager):
78
+ arch_path = dl_manager.download_and_extract(self._DOWNLOAD_URL)
79
+ data_dir = os.path.join(arch_path, "data")
80
+ return [
81
+ datasets.SplitGenerator(
82
+ name=datasets.Split.TRAIN,
83
+ gen_kwargs={"filepath": os.path.join(data_dir, self._TRAIN_FILE)},
84
+ ),
85
+ datasets.SplitGenerator(
86
+ name=datasets.Split.VALIDATION,
87
+ gen_kwargs={"filepath": os.path.join(data_dir, self._VAL_FILE)},
88
+ ),
89
+ ]
90
+
91
+ def _generate_examples(self, filepath):
92
+ """Yields examples."""
93
+ with open(filepath, encoding="utf-8") as f:
94
+ for id_, row in enumerate(f):
95
+ data = json.loads(row)
96
+ if not isinstance(data["answer"], list):
97
+ answer = [data["answer"]]
98
+ answer_begin_position = [data["answer_begin_position"]]
99
+ answer_end_position = [data["answer_end_position"]]
100
+ yield id_, {
101
+ "question_id": data["question_id"],
102
+ "article_id": data["article_id"],
103
+ "context": data["context"],
104
+ "question": data["question"],
105
+ "answers": {
106
+ "answer": answer,
107
+ "answer_begin_position": answer_begin_position,
108
+ "answer_end_position": answer_end_position,
109
+ },
110
+ }