Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
sentiment-classification
Languages:
Thai
Size:
10K - 100K
License:
Commit
•
cd351eb
1
Parent(s):
e708d45
Convert dataset to Parquet (#4)
Browse files- Convert dataset to Parquet (493f8f11ab4fd56b5c0ec7ad8362149862a2c2c8)
- Delete loading script (de06e6d25eae40d0546a71285a5104949571f31a)
- README.md +11 -4
- data/test-00000-of-00001.parquet +3 -0
- data/train-00000-of-00001.parquet +3 -0
- wongnai_reviews.py +0 -76
README.md
CHANGED
@@ -33,13 +33,20 @@ dataset_info:
|
|
33 |
'4': '5'
|
34 |
splits:
|
35 |
- name: train
|
36 |
-
num_bytes:
|
37 |
num_examples: 40000
|
38 |
- name: test
|
39 |
-
num_bytes:
|
40 |
num_examples: 6203
|
41 |
-
download_size:
|
42 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
---
|
44 |
|
45 |
# Dataset Card for Wongnai_Reviews
|
|
|
33 |
'4': '5'
|
34 |
splits:
|
35 |
- name: train
|
36 |
+
num_bytes: 60691412
|
37 |
num_examples: 40000
|
38 |
- name: test
|
39 |
+
num_bytes: 9913682
|
40 |
num_examples: 6203
|
41 |
+
download_size: 30237219
|
42 |
+
dataset_size: 70605094
|
43 |
+
configs:
|
44 |
+
- config_name: default
|
45 |
+
data_files:
|
46 |
+
- split: train
|
47 |
+
path: data/train-*
|
48 |
+
- split: test
|
49 |
+
path: data/test-*
|
50 |
---
|
51 |
|
52 |
# Dataset Card for Wongnai_Reviews
|
data/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2681c7259e2795f4a2c853eb232efbd8927046cfcfe18f1301cfaea47b744a5f
|
3 |
+
size 4272198
|
data/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d5621f178bfbcd2ed93d305e2f20f13c322b6a2ca29041ceb002058ee1e9ac35
|
3 |
+
size 25965021
|
wongnai_reviews.py
DELETED
@@ -1,76 +0,0 @@
|
|
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 |
-
|
18 |
-
import csv
|
19 |
-
import os
|
20 |
-
|
21 |
-
import datasets
|
22 |
-
from datasets.tasks import TextClassification
|
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 |
-
task_templates=[TextClassification(text_column="review_body", label_column="star_rating")],
|
56 |
-
)
|
57 |
-
|
58 |
-
def _split_generators(self, dl_manager):
|
59 |
-
my_urls = _URLs[self.config.name]
|
60 |
-
data_dir = dl_manager.download_and_extract(my_urls)
|
61 |
-
return [
|
62 |
-
datasets.SplitGenerator(
|
63 |
-
name=datasets.Split.TRAIN,
|
64 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "w_review_train.csv"), "split": "train"},
|
65 |
-
),
|
66 |
-
datasets.SplitGenerator(
|
67 |
-
name=datasets.Split.TEST,
|
68 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "w_review_test.csv"), "split": "test"},
|
69 |
-
),
|
70 |
-
]
|
71 |
-
|
72 |
-
def _generate_examples(self, filepath, split):
|
73 |
-
with open(filepath, encoding="utf-8") as f:
|
74 |
-
spamreader = csv.reader(f, delimiter=";", quotechar='"')
|
75 |
-
for id_, row in enumerate(spamreader):
|
76 |
-
yield id_, {"review_body": row[0], "star_rating": row[1]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|