system HF staff commited on
Commit
3accf1a
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,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ - other
5
+ language_creators:
6
+ - found
7
+ languages:
8
+ - en
9
+ - ja
10
+ licenses:
11
+ - cc-by-4-0
12
+ multilinguality:
13
+ - translation
14
+ size_categories:
15
+ - 10K<n<100K
16
+ source_datasets:
17
+ - original
18
+ task_categories:
19
+ - conditional-text-generation
20
+ task_ids:
21
+ - machine-translation
22
+ ---
23
+
24
+ # Dataset Card for SNOW T15 and T23 (simplified Japanese corpus)
25
+
26
+ ## Table of Contents
27
+
28
+ - [Dataset Description](#dataset-description)
29
+ - [Dataset Summary](#dataset-summary)
30
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
31
+ - [Languages](#languages)
32
+ - [Dataset Structure](#dataset-structure)
33
+ - [Data Instances](#data-instances)
34
+ - [Data Fields](#data-instances)
35
+ - [Data Splits](#data-instances)
36
+ - [Dataset Creation](#dataset-creation)
37
+ - [Curation Rationale](#curation-rationale)
38
+ - [Source Data](#source-data)
39
+ - [Annotations](#annotations)
40
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
41
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
42
+ - [Social Impact of Dataset](#social-impact-of-dataset)
43
+ - [Discussion of Biases](#discussion-of-biases)
44
+ - [Other Known Limitations](#other-known-limitations)
45
+ - [Additional Information](#additional-information)
46
+ - [Dataset Curators](#dataset-curators)
47
+ - [Licensing Information](#licensing-information)
48
+ - [Citation Information](#citation-information)
49
+
50
+ ## Dataset Description
51
+
52
+ - **Homepage:** [SNOW T15](http://www.jnlp.org/SNOW/T15), [SNOW T23](http://www.jnlp.org/SNOW/T23)
53
+ - **Repository:** [N/A]
54
+ - **Paper:** ["Simplified Corpus with Core Vocabulary"](https://www.aclweb.org/anthology/L18-1185), ["やさしい⽇本語対訳コーパスの構築"](https://www.anlp.jp/proceedings/annual_meeting/2017/pdf_dir/B5-1.pdf), ["Crowdsourced Corpus of Sentence Simplification with Core Vocabulary"](https://www.aclweb.org/anthology/L18-1072)
55
+ - **Leaderboard:** [N/A]
56
+ - **Point of Contact:** Check the homepage.
57
+
58
+ ### Dataset Summary
59
+
60
+ - **SNOW T15:**
61
+ The simplified corpus for the Japanese language. The corpus has 50,000 manually simplified and aligned sentences.
62
+ This corpus contains the original sentences, simplified sentences and English translation of the original sentences.
63
+ It can be used for automatic text simplification as well as translating simple Japanese into English and vice-versa.
64
+ The core vocabulary is restricted to 2,000 words where it is selected by accounting for several factors such as meaning preservation, variation, simplicity and the UniDic word segmentation criterion.
65
+ For details, refer to the explanation page of Japanese simplification (http://www.jnlp.org/research/Japanese_simplification).
66
+ The original texts are from "small_parallel_enja: 50k En/Ja Parallel Corpus for Testing SMT Methods", which is a bilingual corpus for machine translation.
67
+
68
+ - **SNOW T23:**
69
+ An expansion corpus of 35,000 sentences rewritten in easy Japanese (simple Japanese vocabulary) based on SNOW T15.
70
+ The original texts are from "Tanaka Corpus" (http://www.edrdg.org/wiki/index.php/Tanaka_Corpus).
71
+
72
+ ### Supported Tasks and Leaderboards
73
+
74
+ It can be used for automatic text simplification in Japanese as well as translating simple Japanese into English and vice-versa.
75
+
76
+ ### Languages
77
+
78
+ Japanese, simplified Japanese, and English.
79
+
80
+ ## Dataset Structure
81
+
82
+ ### Data Instances
83
+
84
+ SNOW T15 is xlsx file with ID, "#日本語(原文)" (Japanese (original)), "#やさしい日本語" (simplified Japanese), "#英語(原文)" (English (original)).
85
+ SNOW T23 is xlsx file with ID, "#日本語(原文)" (Japanese (original)), "#やさしい日本語" (simplified Japanese), "#英語(原文)" (English (original)), and "#固有名詞" (proper noun).
86
+
87
+ ### Data Fields
88
+
89
+ - `ID`: sentence ID.
90
+ - `original_ja`: original Japanese sentence.
91
+ - `simplified_ja`: simplified Japanese sentence.
92
+ - `original_en`: original English sentence.
93
+ - `proper_noun`: (included only in SNOW T23) Proper nowus that the workers has extracted as proper nouns. The authors instructed workers not to rewrite proper nouns, leaving the determination of proper nouns to the workers.
94
+
95
+ ### Data Splits
96
+
97
+ The data is not split.
98
+
99
+ ## Dataset Creation
100
+
101
+ ### Curation Rationale
102
+
103
+ A dataset on the study of automatic conversion to simplified Japanese (Japanese simplification).
104
+
105
+ ### Source Data
106
+
107
+ #### Initial Data Collection and Normalization
108
+
109
+ - **SNOW T15:**
110
+ The original texts are from "small_parallel_enja: 50k En/Ja Parallel Corpus for Testing SMT Methods", which is a bilingual corpus for machine translation.
111
+
112
+ - **SNOW T23:**
113
+ The original texts are from "Tanaka Corpus" (http://www.edrdg.org/wiki/index.php/Tanaka_Corpus).
114
+
115
+ #### Who are the source language producers?
116
+
117
+ [N/A]
118
+
119
+ ### Annotations
120
+
121
+ #### Annotation process
122
+
123
+ - **SNOW T15:**
124
+ Five students in the laboratory rewrote the original Japanese sentences to simplified Japanese all by hand.
125
+ The core vocabulary is restricted to 2,000 words where it is selected by accounting for several factors such as meaning preservation, variation, simplicity and the UniDic word segmentation criterion.
126
+
127
+ - **SNOW T23:**
128
+ Seven people, gathered through crowdsourcing, rewrote all the sentences manually.
129
+ Each worker rewrote 5,000 sentences, of which 100 sentences were rewritten to be common among the workers.
130
+ The average length of the sentences was kept as close to the same as possible so that the amount of work was not varied among the workers.
131
+
132
+ #### Who are the annotators?
133
+
134
+ Five students for SNOW T15, seven crowd workers for SNOW T23.
135
+
136
+ ### Personal and Sensitive Information
137
+
138
+ [More Information Needed]
139
+
140
+ ## Considerations for Using the Data
141
+
142
+ ### Social Impact of Dataset
143
+
144
+ [More Information Needed]
145
+
146
+ ### Discussion of Biases
147
+
148
+ [More Information Needed]
149
+
150
+ ### Other Known Limitations
151
+
152
+ [More Information Needed]
153
+
154
+ ## Additional Information
155
+
156
+ ### Dataset Curators
157
+
158
+ The datasets are part of SNOW, Japanese language resources/tools created by Natural Language Processing Laboratory, Nagaoka University of Technology, Japan.
159
+
160
+ ### Licensing Information
161
+
162
+ CC BY 4.0
163
+
164
+ ### Citation Information
165
+
166
+ ```
167
+ @inproceedings{maruyama-yamamoto-2018-simplified,
168
+ title = "Simplified Corpus with Core Vocabulary",
169
+ author = "Maruyama, Takumi and
170
+ Yamamoto, Kazuhide",
171
+ booktitle = "Proceedings of the Eleventh International Conference on Language Resources and Evaluation ({LREC} 2018)",
172
+ month = may,
173
+ year = "2018",
174
+ address = "Miyazaki, Japan",
175
+ publisher = "European Language Resources Association (ELRA)",
176
+ url = "https://www.aclweb.org/anthology/L18-1185",
177
+ }
178
+
179
+ @inproceedings{yamamoto-2017-simplified-japanese,
180
+ title = "やさしい⽇本語対訳コーパスの構築",
181
+ author = "⼭本 和英 and
182
+ 丸⼭ 拓海 and
183
+ ⾓張 ⻯晴 and
184
+ 稲岡 夢⼈ and
185
+ ⼩川 耀⼀朗 and
186
+ 勝⽥ 哲弘 and
187
+ 髙橋 寛治",
188
+ booktitle = "言語処理学会第23回年次大会",
189
+ month = 3月,
190
+ year = "2017",
191
+ address = "茨城, 日本",
192
+ publisher = "言語処理学会",
193
+ url = "https://www.anlp.jp/proceedings/annual_meeting/2017/pdf_dir/B5-1.pdf",
194
+ }
195
+
196
+ @inproceedings{katsuta-yamamoto-2018-crowdsourced,
197
+ title = "Crowdsourced Corpus of Sentence Simplification with Core Vocabulary",
198
+ author = "Katsuta, Akihiro and
199
+ Yamamoto, Kazuhide",
200
+ booktitle = "Proceedings of the Eleventh International Conference on Language Resources and Evaluation ({LREC} 2018)",
201
+ month = may,
202
+ year = "2018",
203
+ address = "Miyazaki, Japan",
204
+ publisher = "European Language Resources Association (ELRA)",
205
+ url = "https://www.aclweb.org/anthology/L18-1072",
206
+ }
207
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"snow_t15": {"description": "About SNOW T15: The simplified corpus for the Japanese language. The corpus has 50,000 manually simplified and aligned sentences. This corpus contains the original sentences, simplified sentences and English translation of the original sentences. It can be used for automatic text simplification as well as translating simple Japanese into English and vice-versa. The core vocabulary is restricted to 2,000 words where it is selected by accounting for several factors such as meaning preservation, variation, simplicity and the UniDic word segmentation criterion.\nFor details, refer to the explanation page of Japanese simplification (http://www.jnlp.org/research/Japanese_simplification). The original texts are from \"small_parallel_enja: 50k En/Ja Parallel Corpus for Testing SMT Methods\", which is a bilingual corpus for machine translation. About SNOW T23: An expansion corpus of 35,000 sentences rewritten in easy Japanese (simple Japanese vocabulary) based on SNOW T15. The original texts are from \"Tanaka Corpus\" (http://www.edrdg.org/wiki/index.php/Tanaka_Corpus).\n", "citation": "@inproceedings{maruyama-yamamoto-2018-simplified,\n title = \"Simplified Corpus with Core Vocabulary\",\n author = \"Maruyama, Takumi and\n Yamamoto, Kazuhide\",\n booktitle = \"Proceedings of the Eleventh International Conference on Language Resources and Evaluation ({LREC} 2018)\",\n month = may,\n year = \"2018\",\n address = \"Miyazaki, Japan\",\n publisher = \"European Language Resources Association (ELRA)\",\n url = \"https://www.aclweb.org/anthology/L18-1185\",\n}\n\n@inproceedings{yamamoto-2017-simplified-japanese,\n title = \"\u3084\u3055\u3057\u3044\u2f47\u672c\u8a9e\u5bfe\u8a33\u30b3\u30fc\u30d1\u30b9\u306e\u69cb\u7bc9\",\n author = \"\u2f2d\u672c \u548c\u82f1 and\n \u4e38\u2f2d \u62d3\u6d77 and\n \u2f93\u5f35 \u2eef\u6674 and\n \u7a32\u5ca1 \u5922\u2f08 and\n \u2f29\u5ddd \u8000\u2f00\u6717 and\n \u52dd\u2f65 \u54f2\u5f18 and\n \u9ad9\u6a4b \u5bdb\u6cbb\",\n booktitle = \"\u8a00\u8a9e\u51e6\u7406\u5b66\u4f1a\u7b2c23\u56de\u5e74\u6b21\u5927\u4f1a\",\n month = 3\u6708,\n year = \"2017\",\n address = \"\u8328\u57ce, \u65e5\u672c\",\n publisher = \"\u8a00\u8a9e\u51e6\u7406\u5b66\u4f1a\",\n url = \"https://www.anlp.jp/proceedings/annual_meeting/2017/pdf_dir/B5-1.pdf\",\n}\n\n@inproceedings{katsuta-yamamoto-2018-crowdsourced,\n title = \"Crowdsourced Corpus of Sentence Simplification with Core Vocabulary\",\n author = \"Katsuta, Akihiro and\n Yamamoto, Kazuhide\",\n booktitle = \"Proceedings of the Eleventh International Conference on Language Resources and Evaluation ({LREC} 2018)\",\n month = may,\n year = \"2018\",\n address = \"Miyazaki, Japan\",\n publisher = \"European Language Resources Association (ELRA)\",\n url = \"https://www.aclweb.org/anthology/L18-1072\",\n}\n", "homepage": "http://www.jnlp.org/SNOW/T15, http://www.jnlp.org/SNOW/T23", "license": "CC BY 4.0", "features": {"ID": {"dtype": "string", "id": null, "_type": "Value"}, "original_ja": {"dtype": "string", "id": null, "_type": "Value"}, "simplified_ja": {"dtype": "string", "id": null, "_type": "Value"}, "original_en": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "snow_simplified_japanese_corpus", "config_name": "snow_t15", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7218115, "num_examples": 50000, "dataset_name": "snow_simplified_japanese_corpus"}}, "download_checksums": {"https://filedn.com/lit4DCIlHwxfS1gj9zcYuDJ/SNOW/T15-2020.1.7.xlsx": {"num_bytes": 3634132, "checksum": "46f6e788e744876b08ca432c585e2942ac6a8a35c8c9ab6687ed7e371a0bc0ac"}}, "download_size": 3634132, "post_processing_size": null, "dataset_size": 7218115, "size_in_bytes": 10852247}, "snow_t23": {"description": "About SNOW T15: The simplified corpus for the Japanese language. The corpus has 50,000 manually simplified and aligned sentences. This corpus contains the original sentences, simplified sentences and English translation of the original sentences. It can be used for automatic text simplification as well as translating simple Japanese into English and vice-versa. The core vocabulary is restricted to 2,000 words where it is selected by accounting for several factors such as meaning preservation, variation, simplicity and the UniDic word segmentation criterion.\nFor details, refer to the explanation page of Japanese simplification (http://www.jnlp.org/research/Japanese_simplification). The original texts are from \"small_parallel_enja: 50k En/Ja Parallel Corpus for Testing SMT Methods\", which is a bilingual corpus for machine translation. About SNOW T23: An expansion corpus of 35,000 sentences rewritten in easy Japanese (simple Japanese vocabulary) based on SNOW T15. The original texts are from \"Tanaka Corpus\" (http://www.edrdg.org/wiki/index.php/Tanaka_Corpus).\n", "citation": "@inproceedings{maruyama-yamamoto-2018-simplified,\n title = \"Simplified Corpus with Core Vocabulary\",\n author = \"Maruyama, Takumi and\n Yamamoto, Kazuhide\",\n booktitle = \"Proceedings of the Eleventh International Conference on Language Resources and Evaluation ({LREC} 2018)\",\n month = may,\n year = \"2018\",\n address = \"Miyazaki, Japan\",\n publisher = \"European Language Resources Association (ELRA)\",\n url = \"https://www.aclweb.org/anthology/L18-1185\",\n}\n\n@inproceedings{yamamoto-2017-simplified-japanese,\n title = \"\u3084\u3055\u3057\u3044\u2f47\u672c\u8a9e\u5bfe\u8a33\u30b3\u30fc\u30d1\u30b9\u306e\u69cb\u7bc9\",\n author = \"\u2f2d\u672c \u548c\u82f1 and\n \u4e38\u2f2d \u62d3\u6d77 and\n \u2f93\u5f35 \u2eef\u6674 and\n \u7a32\u5ca1 \u5922\u2f08 and\n \u2f29\u5ddd \u8000\u2f00\u6717 and\n \u52dd\u2f65 \u54f2\u5f18 and\n \u9ad9\u6a4b \u5bdb\u6cbb\",\n booktitle = \"\u8a00\u8a9e\u51e6\u7406\u5b66\u4f1a\u7b2c23\u56de\u5e74\u6b21\u5927\u4f1a\",\n month = 3\u6708,\n year = \"2017\",\n address = \"\u8328\u57ce, \u65e5\u672c\",\n publisher = \"\u8a00\u8a9e\u51e6\u7406\u5b66\u4f1a\",\n url = \"https://www.anlp.jp/proceedings/annual_meeting/2017/pdf_dir/B5-1.pdf\",\n}\n\n@inproceedings{katsuta-yamamoto-2018-crowdsourced,\n title = \"Crowdsourced Corpus of Sentence Simplification with Core Vocabulary\",\n author = \"Katsuta, Akihiro and\n Yamamoto, Kazuhide\",\n booktitle = \"Proceedings of the Eleventh International Conference on Language Resources and Evaluation ({LREC} 2018)\",\n month = may,\n year = \"2018\",\n address = \"Miyazaki, Japan\",\n publisher = \"European Language Resources Association (ELRA)\",\n url = \"https://www.aclweb.org/anthology/L18-1072\",\n}\n", "homepage": "http://www.jnlp.org/SNOW/T15, http://www.jnlp.org/SNOW/T23", "license": "CC BY 4.0", "features": {"ID": {"dtype": "string", "id": null, "_type": "Value"}, "original_ja": {"dtype": "string", "id": null, "_type": "Value"}, "simplified_ja": {"dtype": "string", "id": null, "_type": "Value"}, "original_en": {"dtype": "string", "id": null, "_type": "Value"}, "proper_noun": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "snow_simplified_japanese_corpus", "config_name": "snow_t23", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 6704695, "num_examples": 34300, "dataset_name": "snow_simplified_japanese_corpus"}}, "download_checksums": {"https://filedn.com/lit4DCIlHwxfS1gj9zcYuDJ/SNOW/T23-2020.1.7.xlsx": {"num_bytes": 3641507, "checksum": "71a8923f024c26c28543663b46aab4e9b6af7c2e8f99a8644190942d8f63c7ca"}}, "download_size": 3641507, "post_processing_size": null, "dataset_size": 6704695, "size_in_bytes": 10346202}}
dummy/snow_t15/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b72a59baba2582505bb9ae4a5754bc3836be464f294065f2d4b7d1d8f141f43
3
+ size 5191
dummy/snow_t23/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7332a875c9bdde6989d219232357b09ac66ccba86833241ac9dc1f85688dfe9a
3
+ size 5397
snow_simplified_japanese_corpus.py ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """SNOW T15 and T23: "Japanese Simplified Corpus with Core Vocabulary" and ''Crowdsourced Corpus of Sentence Simplification with Core Vocabulary"."""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import openpyxl # noqa: requires this pandas optional dependency for reading xlsx files
20
+ import pandas as pd
21
+
22
+ import datasets
23
+
24
+
25
+ _CITATION = """\
26
+ @inproceedings{maruyama-yamamoto-2018-simplified,
27
+ title = "Simplified Corpus with Core Vocabulary",
28
+ author = "Maruyama, Takumi and
29
+ Yamamoto, Kazuhide",
30
+ booktitle = "Proceedings of the Eleventh International Conference on Language Resources and Evaluation ({LREC} 2018)",
31
+ month = may,
32
+ year = "2018",
33
+ address = "Miyazaki, Japan",
34
+ publisher = "European Language Resources Association (ELRA)",
35
+ url = "https://www.aclweb.org/anthology/L18-1185",
36
+ }
37
+
38
+ @inproceedings{yamamoto-2017-simplified-japanese,
39
+ title = "やさしい⽇本語対訳コーパスの構築",
40
+ author = "⼭本 和英 and
41
+ 丸⼭ 拓海 and
42
+ ⾓張 ⻯晴 and
43
+ 稲岡 夢⼈ and
44
+ ⼩川 耀⼀朗 and
45
+ 勝⽥ 哲弘 and
46
+ 髙橋 寛治",
47
+ booktitle = "言語処理学会第23回年次大会",
48
+ month = 3月,
49
+ year = "2017",
50
+ address = "茨城, 日本",
51
+ publisher = "言語処理学会",
52
+ url = "https://www.anlp.jp/proceedings/annual_meeting/2017/pdf_dir/B5-1.pdf",
53
+ }
54
+
55
+ @inproceedings{katsuta-yamamoto-2018-crowdsourced,
56
+ title = "Crowdsourced Corpus of Sentence Simplification with Core Vocabulary",
57
+ author = "Katsuta, Akihiro and
58
+ Yamamoto, Kazuhide",
59
+ booktitle = "Proceedings of the Eleventh International Conference on Language Resources and Evaluation ({LREC} 2018)",
60
+ month = may,
61
+ year = "2018",
62
+ address = "Miyazaki, Japan",
63
+ publisher = "European Language Resources Association (ELRA)",
64
+ url = "https://www.aclweb.org/anthology/L18-1072",
65
+ }
66
+ """
67
+
68
+ _DESCRIPTION = """\
69
+ About SNOW T15: \
70
+ The simplified corpus for the Japanese language. The corpus has 50,000 manually simplified and aligned sentences. \
71
+ This corpus contains the original sentences, simplified sentences and English translation of the original sentences. \
72
+ It can be used for automatic text simplification as well as translating simple Japanese into English and vice-versa. \
73
+ The core vocabulary is restricted to 2,000 words where it is selected by accounting for several factors such as meaning preservation, variation, simplicity and the UniDic word segmentation criterion.
74
+ For details, refer to the explanation page of Japanese simplification (http://www.jnlp.org/research/Japanese_simplification). \
75
+ The original texts are from "small_parallel_enja: 50k En/Ja Parallel Corpus for Testing SMT Methods", which is a bilingual corpus for machine translation. \
76
+ \
77
+ About SNOW T23: \
78
+ An expansion corpus of 35,000 sentences rewritten in easy Japanese (simple Japanese vocabulary) based on SNOW T15. \
79
+ The original texts are from "Tanaka Corpus" (http://www.edrdg.org/wiki/index.php/Tanaka_Corpus).
80
+ """
81
+
82
+ _HOMEPAGE = "http://www.jnlp.org/SNOW/T15, http://www.jnlp.org/SNOW/T23"
83
+
84
+ _LICENSE = "CC BY 4.0"
85
+
86
+ # The HuggingFace dataset library don't host the datasets but only point to the original files
87
+ _URLs = {
88
+ "snow_t15": "https://filedn.com/lit4DCIlHwxfS1gj9zcYuDJ/SNOW/T15-2020.1.7.xlsx",
89
+ "snow_t23": "https://filedn.com/lit4DCIlHwxfS1gj9zcYuDJ/SNOW/T23-2020.1.7.xlsx",
90
+ }
91
+
92
+
93
+ class SnowSimplifiedJapaneseCorpus(datasets.GeneratorBasedBuilder):
94
+ """SNOW T15 and T23: "Japanese Simplified Corpus with Core Vocabulary" and ''Crowdsourced Corpus of Sentence Simplification with Core Vocabulary"."""
95
+
96
+ VERSION = datasets.Version("1.1.0")
97
+
98
+ BUILDER_CONFIGS = [
99
+ datasets.BuilderConfig(name="snow_t15", version=VERSION, description="SNOW T15 dataset"),
100
+ datasets.BuilderConfig(name="snow_t23", version=VERSION, description="SNOW T23 dataset (extension)"),
101
+ ]
102
+
103
+ DEFAULT_CONFIG_NAME = "snow_t15"
104
+
105
+ def _info(self):
106
+ if self.config.name == "snow_t15":
107
+ features = datasets.Features(
108
+ {
109
+ "ID": datasets.Value("string"),
110
+ "original_ja": datasets.Value("string"),
111
+ "simplified_ja": datasets.Value("string"),
112
+ "original_en": datasets.Value("string"),
113
+ }
114
+ )
115
+ else:
116
+ features = datasets.Features(
117
+ {
118
+ "ID": datasets.Value("string"),
119
+ "original_ja": datasets.Value("string"),
120
+ "simplified_ja": datasets.Value("string"),
121
+ "original_en": datasets.Value("string"),
122
+ "proper_noun": datasets.Value("string"),
123
+ }
124
+ )
125
+
126
+ return datasets.DatasetInfo(
127
+ description=_DESCRIPTION,
128
+ features=features,
129
+ supervised_keys=None,
130
+ homepage=_HOMEPAGE,
131
+ license=_LICENSE,
132
+ citation=_CITATION,
133
+ )
134
+
135
+ def _split_generators(self, dl_manager):
136
+ """Returns SplitGenerators."""
137
+
138
+ my_urls = _URLs[self.config.name]
139
+ data_url = dl_manager.download(my_urls)
140
+
141
+ return [
142
+ datasets.SplitGenerator(
143
+ name=datasets.Split.TRAIN,
144
+ gen_kwargs={"filepath": data_url, "split": "train"},
145
+ ),
146
+ ]
147
+
148
+ def _generate_examples(self, filepath, split):
149
+ """ Yields examples. """
150
+
151
+ with open(filepath, "rb") as f:
152
+ df = pd.read_excel(f, engine="openpyxl").astype("str")
153
+
154
+ if self.config.name == "snow_t15":
155
+ for id_, row in df.iterrows():
156
+ yield id_, {
157
+ "ID": row["ID"],
158
+ "original_ja": row["#日本語(原文)"],
159
+ "simplified_ja": row["#やさしい日本語"],
160
+ "original_en": row["#英語(原文)"],
161
+ }
162
+ else:
163
+ for id_, row in df.iterrows():
164
+ yield id_, {
165
+ "ID": row["ID"],
166
+ "original_ja": row["#日本語(原文)"],
167
+ "simplified_ja": row["#やさしい日本語"],
168
+ "original_en": row["#英語(原文)"],
169
+ "proper_noun": row["#固有名詞"],
170
+ }