system HF staff commited on
Commit
6d01535
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,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ - machine-generated
5
+ language_creators:
6
+ - machine-generated
7
+ languages:
8
+ - en
9
+ - th
10
+ licenses:
11
+ - cc-by-sa-4-0
12
+ multilinguality:
13
+ - translation
14
+ size_categories:
15
+ - 100K<n<1M
16
+ source_datasets:
17
+ - original
18
+ task_categories:
19
+ - conditional-text-generation
20
+ - text-classification
21
+ task_ids:
22
+ - machine-translation
23
+ - multi-class-classification
24
+ - semantic-similarity-classification
25
+ ---
26
+
27
+ # Dataset Card for `generated_reviews_enth`
28
+
29
+ ## Table of Contents
30
+ - [Dataset Description](#dataset-description)
31
+ - [Dataset Summary](#dataset-summary)
32
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
33
+ - [Languages](#languages)
34
+ - [Dataset Structure](#dataset-structure)
35
+ - [Data Instances](#data-instances)
36
+ - [Data Fields](#data-instances)
37
+ - [Data Splits](#data-instances)
38
+ - [Dataset Creation](#dataset-creation)
39
+ - [Curation Rationale](#curation-rationale)
40
+ - [Source Data](#source-data)
41
+ - [Annotations](#annotations)
42
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
43
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
44
+ - [Social Impact of Dataset](#social-impact-of-dataset)
45
+ - [Discussion of Biases](#discussion-of-biases)
46
+ - [Other Known Limitations](#other-known-limitations)
47
+ - [Additional Information](#additional-information)
48
+ - [Dataset Curators](#dataset-curators)
49
+ - [Licensing Information](#licensing-information)
50
+ - [Citation Information](#citation-information)
51
+
52
+ ## Dataset Description
53
+
54
+ - **Homepage:** ttp://airesearch.in.th/
55
+ - **Repository:** https://github.com/vistec-ai/generated_reviews_enth
56
+ - **Paper:** https://arxiv.org/pdf/2007.03541.pdf
57
+ - **Leaderboard:**
58
+ - **Point of Contact:** [AIResearch](http://airesearch.in.th/)
59
+
60
+ ### Dataset Summary
61
+
62
+ `generated_reviews_enth` is created as part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf) for machine translation task. This dataset (referred to as `generated_reviews_yn` in [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)) are English product reviews generated by [CTRL](https://arxiv.org/abs/1909.05858), translated by Google Translate API and annotated as accepted or rejected (`correct`) based on fluency and adequacy of the translation by human annotators. This allows it to be used for English-to-Thai translation quality esitmation (binary label), machine translation, and sentiment analysis.
63
+
64
+ ### Supported Tasks and Leaderboards
65
+
66
+ English-to-Thai translation quality esitmation (binary label) is the intended use. Other uses include machine translation and sentiment analysis.
67
+
68
+ ### Languages
69
+
70
+ English, Thai
71
+
72
+ ## Dataset Structure
73
+
74
+ ### Data Instances
75
+
76
+ ```
77
+ {'correct': 0, 'review_star': 4, 'translation': {'en': "I had a hard time finding a case for my new LG Lucid 2 but finally found this one on amazon. The colors are really pretty and it works just as well as, if not better than the otterbox. Hopefully there will be more available by next Xmas season. Overall, very cute case. I love cheetah's. :)", 'th': 'ฉันมีปัญหาในการหาเคสสำหรับ LG Lucid 2 ใหม่ของฉัน แต่ในที่สุดก็พบเคสนี้ใน Amazon สีสวยมากและใช้งานได้ดีเช่นเดียวกับถ้าไม่ดีกว่านาก หวังว่าจะมีให้มากขึ้นในช่วงเทศกาลคริสต์มาสหน้า โดยรวมแล้วน่ารักมาก ๆ ฉันรักเสือชีตาห์ :)'}}
78
+ {'correct': 0, 'review_star': 1, 'translation': {'en': "This is the second battery charger I bought as a Christmas present, that came from Amazon, after one purchased before for my son. His was still working. The first charger, received in July, broke apart and wouldn't charge anymore. Just found out two days ago they discontinued it without warning. It took quite some time to find the exact replacement charger. Too bad, really liked it. One of these days, will purchase an actual Nikon product, or go back to buying batteries.", 'th': 'นี่เป็นเครื่องชาร์จแบตเตอรี่ก้อนที่สองที่ฉันซื้อเป็นของขวัญคริสต์มาสซึ่งมาจากอเมซอนหลังจากที่ซื้อมาเพื่อลูกชายของฉัน เขายังทำงานอยู่ เครื่องชาร์จแรกที่ได้รับในเดือนกรกฎาคมแตกเป็นชิ้น ๆ และจะไม่ชาร์จอีกต่อไป เพิ่งค้นพบเมื่อสองวันก่อนพวกเขาหยุดมันโดยไม่มีการเตือนล่วงหน้า ใช้เวลาพอสมควรในการหาที่ชาร์จท��่ถูกต้อง แย่มากชอบมาก สักวันหนึ่งจะซื้อผลิตภัณฑ์ Nikon จริงหรือกลับไปซื้อแบตเตอรี่'}}
79
+ {'correct': 1, 'review_star': 1, 'translation': {'en': 'I loved the idea of having a portable computer to share pictures with family and friends on my big screen. It worked really well for about 3 days, then when i opened it one evening there was water inside where all the wires came out. I cleaned that up and put some tape over that, so far, no leaks. My husband just told me yesterday, however, that this thing is trash.', 'th': 'ฉันชอบไอเดียที่มีคอมพิวเตอร์พกพาเพื่อแชร์รูปภาพกับครอบครัวและเพื่อน ๆ บนหน้าจอขนาดใหญ่ของฉัน มันใช้งานได้ดีจริง ๆ ประมาณ 3 วันจากนั้นเมื่อฉันเปิดมันในเย็นวันหนึ่งมีน้ำอยู่ภายในที่ซึ่งสายไฟทั้งหมดออกมา ฉันทำความสะอาดมันแล้ววางเทปไว้ที่นั่นจนถึงตอนนี้ไม่มีรอยรั่ว สามีของฉันเพิ่งบอกฉันเมื่อวานนี้ว่าสิ่งนี้เป็นขยะ'}}
80
+ ```
81
+
82
+ ### Data Fields
83
+
84
+ - `translation`:
85
+ - `en`: English product reviews generated by [CTRL](https://arxiv.org/abs/1909.05858)
86
+ - `th`: Thai product reviews translated from `en` by Google Translate API
87
+ - `review_star`: Stars of the generated reviews, put as condition for [CTRL](https://arxiv.org/abs/1909.05858)
88
+ - `correct`: 1 if the English-to-Thai translation is accepted (`correct`) based on fluency and adequacy of the translation by human annotators else 0
89
+
90
+ ### Data Splits
91
+
92
+ | | train | valid | test |
93
+ |-----------------|--------|-------|-------|
94
+ | # samples | 141369 | 15708 | 17453 |
95
+ | # correct:0 | 99296 | 10936 | 12208 |
96
+ | # correct:1 | 42073 | 4772 | 5245 |
97
+ | # review_star:1 | 50418 | 5628 | 6225 |
98
+ | # review_star:2 | 22876 | 2596 | 2852 |
99
+ | # review_star:3 | 22825 | 2521 | 2831 |
100
+ | # review_star:1 | 22671 | 2517 | 2778 |
101
+ | # review_star:5 | 22579 | 2446 | 2767 |
102
+
103
+ ## Dataset Creation
104
+
105
+ ### Curation Rationale
106
+
107
+ `generated_reviews_enth` is created as part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf) for machine translation task. This dataset (referred to as `generated_reviews_yn` in [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)) are English product reviews generated by [CTRL](https://arxiv.org/abs/1909.05858), translated by Google Translate API and annotated as accepted or rejected (`correct`) based on fluency and adequacy of the translation by human annotators. This allows it to be used for English-to-Thai translation quality esitmation (binary label), machine translation, and sentiment analysis.
108
+
109
+ ### Source Data
110
+
111
+ #### Initial Data Collection and Normalization
112
+
113
+ The data generation process is as follows:
114
+ - `en` is generated using conditional generation of [CTRL](https://arxiv.org/abs/1909.05858), stating a star review for each generated product review.
115
+ - `th` is translated from `en` using Google Translate API
116
+ - `correct` is annotated as accepted or rejected (1 or 0) based on fluency and adequacy of the translation by human annotators
117
+
118
+ For this specific dataset for translation quality estimation task, we apply the following preprocessing:
119
+ - Drop duplciates on `en`,`th`,`review_star`,`correct`; duplicates might exist because the translation checking is done by annotators.
120
+ - Remove reviews that are not between 1-5 stars.
121
+ - Remove reviews whose `correct` are not 0 or 1.
122
+ - Deduplicate on `en` which contains the source sentences.
123
+
124
+ #### Who are the source language producers?
125
+
126
+ [CTRL](https://arxiv.org/abs/1909.05858)
127
+
128
+ ### Annotations
129
+
130
+ #### Annotation process
131
+
132
+ Annotators are given English and Thai product review pairs. They are asked to label the pair as acceptable translation or not based on fluency and adequacy of the translation.
133
+
134
+ #### Who are the annotators?
135
+
136
+ Human annotators of [Hope Data Annotations](https://www.hopedata.org/) hired by [AIResearch.in.th](http://airesearch.in.th/)
137
+
138
+ ### Personal and Sensitive Information
139
+
140
+ The authors do not expect any personal or sensitive information to be in the generated product reviews, but they could slip through from pretraining of [CTRL](https://arxiv.org/abs/1909.05858).
141
+
142
+ ## Considerations for Using the Data
143
+
144
+ ### Social Impact of Dataset
145
+
146
+ - English-Thai translation quality estimation for machine translation
147
+ - Product review classification for Thai
148
+
149
+ ### Discussion of Biases
150
+
151
+ [More Information Needed]
152
+
153
+ ### Other Known Limitations
154
+
155
+ Due to annotation process constraints, the number of one-star reviews are notably higher than other-star reviews. This makes the dataset slighly imbalanced.
156
+
157
+ ## Additional Information
158
+
159
+ ### Dataset Curators
160
+
161
+ The dataset was created by [AIResearch.in.th](http://airesearch.in.th/)
162
+
163
+ ### Licensing Information
164
+
165
+ CC BY-SA 4.0
166
+
167
+ ### Citation Information
168
+
169
+ ```
170
+ @article{lowphansirikul2020scb,
171
+ title={scb-mt-en-th-2020: A Large English-Thai Parallel Corpus},
172
+ author={Lowphansirikul, Lalita and Polpanumas, Charin and Rutherford, Attapol T and Nutanong, Sarana},
173
+ journal={arXiv preprint arXiv:2007.03541},
174
+ year={2020}
175
+ }
176
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"generated_reviews_enth": {"description": " `generated_reviews_enth`\n Generated product reviews dataset for machine translation quality prediction, part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)\n `generated_reviews_enth` is created as part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf) for machine translation task.\n This dataset (referred to as `generated_reviews_yn` in [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)) are English product reviews\n generated by [CTRL](https://arxiv.org/abs/1909.05858), translated by Google Translate API and annotated as accepted or rejected (`correct`)\n based on fluency and adequacy of the translation by human annotators.\n This allows it to be used for English-to-Thai translation quality esitmation (binary label), machine translation, and sentiment analysis.\n", "citation": "@article{lowphansirikul2020scb,\n title={scb-mt-en-th-2020: A Large English-Thai Parallel Corpus},\n author={Lowphansirikul, Lalita and Polpanumas, Charin and Rutherford, Attapol T and Nutanong, Sarana},\n journal={arXiv preprint arXiv:2007.03541},\n year={2020}\n}\n", "homepage": "https://github.com/vistec-AI/generated_reviews_enth", "license": "", "features": {"translation": {"languages": ["en", "th"], "id": null, "_type": "Translation"}, "review_star": {"dtype": "int32", "id": null, "_type": "Value"}, "correct": {"num_classes": 2, "names": ["neg", "pos"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "generated_reviews_enth", "config_name": "generated_reviews_enth", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 147673215, "num_examples": 141369, "dataset_name": "generated_reviews_enth"}, "validation": {"name": "validation", "num_bytes": 16409966, "num_examples": 15708, "dataset_name": "generated_reviews_enth"}, "test": {"name": "test", "num_bytes": 18133523, "num_examples": 17453, "dataset_name": "generated_reviews_enth"}}, "download_checksums": {"https://github.com/vistec-AI/generated_reviews_enth/raw/main/data.zip": {"num_bytes": 59490601, "checksum": "55be9242869bc951c9be6899a5be94775ffb71cba878c70f034379962b9a95b5"}}, "download_size": 59490601, "post_processing_size": null, "dataset_size": 182216704, "size_in_bytes": 241707305}}
dummy/generated_reviews_enth/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bcb259621a3a9e6168c4129e7b582622444211b56e44b2e3d3a8ef8b5efdcc14
3
+ size 7420
generated_reviews_enth.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """`generated_reviews_enth`: Generated product reviews dataset for machine translation quality prediction, part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)"""
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
+ @article{lowphansirikul2020scb,
13
+ title={scb-mt-en-th-2020: A Large English-Thai Parallel Corpus},
14
+ author={Lowphansirikul, Lalita and Polpanumas, Charin and Rutherford, Attapol T and Nutanong, Sarana},
15
+ journal={arXiv preprint arXiv:2007.03541},
16
+ year={2020}
17
+ }
18
+ """
19
+
20
+ _DESCRIPTION = """\
21
+ `generated_reviews_enth`
22
+ Generated product reviews dataset for machine translation quality prediction, part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)
23
+ `generated_reviews_enth` is created as part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf) for machine translation task.
24
+ This dataset (referred to as `generated_reviews_yn` in [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)) are English product reviews
25
+ generated by [CTRL](https://arxiv.org/abs/1909.05858), translated by Google Translate API and annotated as accepted or rejected (`correct`)
26
+ based on fluency and adequacy of the translation by human annotators.
27
+ This allows it to be used for English-to-Thai translation quality esitmation (binary label), machine translation, and sentiment analysis.
28
+ """
29
+
30
+
31
+ class GeneratedReviewsEnthConfig(datasets.BuilderConfig):
32
+ """BuilderConfig for GeneratedReviewsEnth."""
33
+
34
+ def __init__(self, **kwargs):
35
+ """BuilderConfig for GeneratedReviewsEnth.
36
+
37
+ Args:
38
+ **kwargs: keyword arguments forwarded to super.
39
+ """
40
+ super(GeneratedReviewsEnthConfig, self).__init__(**kwargs)
41
+ self.language_pair = ("en", "th")
42
+
43
+
44
+ class GeneratedReviewsEnth(datasets.GeneratorBasedBuilder):
45
+ """`generated_reviews_enth`: Generated product reviews dataset for machine translation quality prediction, part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)"""
46
+
47
+ _DOWNLOAD_URL = "https://github.com/vistec-AI/generated_reviews_enth/raw/main/data.zip"
48
+ _TRAIN_FILE = "train.jsonl"
49
+ _VAL_FILE = "valid.jsonl"
50
+ _TEST_FILE = "test.jsonl"
51
+ BUILDER_CONFIG_CLASS = GeneratedReviewsEnthConfig
52
+ BUILDER_CONFIGS = [
53
+ GeneratedReviewsEnthConfig(
54
+ name="generated_reviews_enth",
55
+ version=datasets.Version("1.0.0"),
56
+ description="`generated_reviews_enth`: Generated product reviews dataset for machine translation quality prediction, part of [scb-mt-en-th-2020](https://arxiv.org/pdf/2007.03541.pdf)",
57
+ ),
58
+ ]
59
+
60
+ def _info(self):
61
+ return datasets.DatasetInfo(
62
+ description=_DESCRIPTION,
63
+ features=datasets.Features(
64
+ {
65
+ "translation": datasets.features.Translation(languages=self.config.language_pair),
66
+ "review_star": datasets.Value("int32"),
67
+ "correct": datasets.features.ClassLabel(names=["neg", "pos"]),
68
+ }
69
+ ),
70
+ supervised_keys=None,
71
+ homepage="https://github.com/vistec-AI/generated_reviews_enth",
72
+ citation=_CITATION,
73
+ )
74
+
75
+ def _split_generators(self, dl_manager):
76
+ arch_path = dl_manager.download_and_extract(self._DOWNLOAD_URL)
77
+ data_dir = os.path.join(arch_path, "data")
78
+ return [
79
+ datasets.SplitGenerator(
80
+ name=datasets.Split.TRAIN, gen_kwargs={"filepath": os.path.join(data_dir, self._TRAIN_FILE)}
81
+ ),
82
+ datasets.SplitGenerator(
83
+ name=datasets.Split.VALIDATION, gen_kwargs={"filepath": os.path.join(data_dir, self._VAL_FILE)}
84
+ ),
85
+ datasets.SplitGenerator(
86
+ name=datasets.Split.TEST, gen_kwargs={"filepath": os.path.join(data_dir, self._TEST_FILE)}
87
+ ),
88
+ ]
89
+
90
+ def _generate_examples(self, filepath):
91
+ """Generate generated_reviews_enth examples."""
92
+ source, target = self.config.language_pair
93
+ with open(filepath, encoding="utf-8") as f:
94
+ for id_, row in enumerate(f):
95
+ data = json.loads(row)
96
+ yield id_, {
97
+ "translation": {source: data["en_segment"], target: data["th_segment"]},
98
+ "review_star": data["review_star"],
99
+ "correct": data["correct"],
100
+ }