system HF staff commited on
Commit
71de2fd
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,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators: []
3
+ language_creators: []
4
+ languages:
5
+ - th
6
+ licenses:
7
+ - lgpl-3-0-only
8
+ multilinguality:
9
+ - monolingual
10
+ size_categories:
11
+ - 10K<n<100K
12
+ source_datasets:
13
+ - original
14
+ task_categories:
15
+ - text-classification
16
+ task_ids:
17
+ - sentiment-classification
18
+ ---
19
+
20
+ # Dataset Card for Wongnai_Reviews
21
+
22
+ ## Dataset Description
23
+
24
+ - **Repository: ** https://github.com/wongnai/wongnai-corpus
25
+
26
+ ### Dataset Summary
27
+
28
+ The Wongnai Review dataset contains restaurant reviews and ratings, almost entirely in Thai language.
29
+
30
+ The reviews are in 5 classes ranging from 1 to 5 stars.
31
+
32
+ This dataset was featured in a Kaggle challenge https://www.kaggle.com/c/wongnai-challenge-review-rating-prediction/overview
33
+
34
+ ### Languages
35
+
36
+ Thai
37
+
38
+ ## Dataset Structure
39
+
40
+ ### Data Fields
41
+
42
+ - review_body - text of review
43
+ - star_rating - an integer star rating (1-5) or -1 (for test)
44
+
45
+ ### Data Splits
46
+
47
+ Designated train (40,000 reviews) and test (6,204) sets.
48
+
49
+ ### Source Data
50
+
51
+ #### Initial Data Collection and Normalization
52
+
53
+ Data was collected by Wongnai from business reviews on their website,
54
+ and shared on GitHub and Kaggle.
55
+
56
+ ### Annotations
57
+
58
+ The reviews are users' own star ratings, so no additional annotation was needed.
59
+
60
+ ## Additional Information
61
+
62
+ ### Dataset Curators
63
+
64
+ Contributors to original GitHub repo:
65
+ - Ekkalak Thongthanomkul
66
+ - Tanapol Nearunchorn
67
+ - Yuwat Chuesathuchon
68
+
69
+ ### Licensing Information
70
+
71
+ LGPL-3.0
72
+
73
+ ### Citation Information
74
+
75
+ See https://github.com/wongnai/wongnai-corpus
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "Wongnai's review dataset contains restaurant reviews and ratings, mainly in Thai language.\nThe reviews are in 5 classes ranging from 1 to 5 stars.\n", "citation": "", "homepage": "https://github.com/wongnai/wongnai-corpus", "license": "LGPL-3.0", "features": {"review_body": {"dtype": "string", "id": null, "_type": "Value"}, "star_rating": {"num_classes": 5, "names": ["1", "2", "3", "4", "5"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "wongnai_reviews", "config_name": "default", "version": {"version_str": "1.0.1", "description": null, "major": 1, "minor": 0, "patch": 1}, "splits": {"train": {"name": "train", "num_bytes": 60691428, "num_examples": 40000, "dataset_name": "wongnai_reviews"}, "test": {"name": "test", "num_bytes": 9913686, "num_examples": 6203, "dataset_name": "wongnai_reviews"}}, "download_checksums": {"https://archive.org/download/wongnai_reviews/wongnai_reviews_withtest.zip": {"num_bytes": 16556587, "checksum": "d3d1de39d28346023db55f2a97735be667dae8480ab765a1764138c5cec17b36"}}, "download_size": 16556587, "post_processing_size": null, "dataset_size": 70605114, "size_in_bytes": 87161701}}
dummy/1.0.1/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00993f89612305cf1677f6a628d0e6ffc28ad1481ffd60b52de27474f00d0245
3
+ size 10097
wongnai_reviews.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """TODO: Add a description here."""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import csv
20
+ import os
21
+
22
+ import datasets
23
+
24
+
25
+ # no BibTeX citation
26
+ _CITATION = ""
27
+
28
+ _DESCRIPTION = """\
29
+ Wongnai's review dataset contains restaurant reviews and ratings, mainly in Thai language.
30
+ The reviews are in 5 classes ranging from 1 to 5 stars.
31
+ """
32
+
33
+ _LICENSE = "LGPL-3.0"
34
+
35
+ _URLs = {"default": "https://archive.org/download/wongnai_reviews/wongnai_reviews_withtest.zip"}
36
+
37
+
38
+ class WongnaiReviews(datasets.GeneratorBasedBuilder):
39
+ VERSION = datasets.Version("1.0.1")
40
+
41
+ def _info(self):
42
+ features = datasets.Features(
43
+ {
44
+ "review_body": datasets.Value("string"),
45
+ "star_rating": datasets.features.ClassLabel(names=["1", "2", "3", "4", "5"]),
46
+ }
47
+ )
48
+ return datasets.DatasetInfo(
49
+ description=_DESCRIPTION,
50
+ features=features,
51
+ supervised_keys=None,
52
+ homepage="https://github.com/wongnai/wongnai-corpus",
53
+ license=_LICENSE,
54
+ citation=_CITATION,
55
+ )
56
+
57
+ def _split_generators(self, dl_manager):
58
+ my_urls = _URLs[self.config.name]
59
+ data_dir = dl_manager.download_and_extract(my_urls)
60
+ return [
61
+ datasets.SplitGenerator(
62
+ name=datasets.Split.TRAIN,
63
+ gen_kwargs={"filepath": os.path.join(data_dir, "w_review_train.csv"), "split": "train"},
64
+ ),
65
+ datasets.SplitGenerator(
66
+ name=datasets.Split.TEST,
67
+ gen_kwargs={"filepath": os.path.join(data_dir, "w_review_test.csv"), "split": "test"},
68
+ ),
69
+ ]
70
+
71
+ def _generate_examples(self, filepath, split):
72
+ with open(filepath, encoding="utf-8") as f:
73
+ spamreader = csv.reader(f, delimiter=";", quotechar='"')
74
+ for id_, row in enumerate(spamreader):
75
+ yield id_, {"review_body": row[0], "star_rating": row[1]}