Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
sentiment-classification
Languages:
English
Size:
100K - 1M
ArXiv:
License:
Convert dataset to Parquet
#4
by
albertvillanova
HF staff
- opened
- README.md +10 -2
- dataset_infos.json +0 -1
- yelp_review_full.py +0 -124
- yelp_review_full/test-00000-of-00001.parquet +3 -0
- yelp_review_full/train-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -20,6 +20,7 @@ task_ids:
|
|
20 |
pretty_name: YelpReviewFull
|
21 |
license_details: yelp-licence
|
22 |
dataset_info:
|
|
|
23 |
features:
|
24 |
- name: label
|
25 |
dtype:
|
@@ -32,7 +33,6 @@ dataset_info:
|
|
32 |
'4': 5 stars
|
33 |
- name: text
|
34 |
dtype: string
|
35 |
-
config_name: yelp_review_full
|
36 |
splits:
|
37 |
- name: train
|
38 |
num_bytes: 483811554
|
@@ -40,8 +40,16 @@ dataset_info:
|
|
40 |
- name: test
|
41 |
num_bytes: 37271188
|
42 |
num_examples: 50000
|
43 |
-
download_size:
|
44 |
dataset_size: 521082742
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
train-eval-index:
|
46 |
- config: yelp_review_full
|
47 |
task: text-classification
|
|
|
20 |
pretty_name: YelpReviewFull
|
21 |
license_details: yelp-licence
|
22 |
dataset_info:
|
23 |
+
config_name: yelp_review_full
|
24 |
features:
|
25 |
- name: label
|
26 |
dtype:
|
|
|
33 |
'4': 5 stars
|
34 |
- name: text
|
35 |
dtype: string
|
|
|
36 |
splits:
|
37 |
- name: train
|
38 |
num_bytes: 483811554
|
|
|
40 |
- name: test
|
41 |
num_bytes: 37271188
|
42 |
num_examples: 50000
|
43 |
+
download_size: 322952369
|
44 |
dataset_size: 521082742
|
45 |
+
configs:
|
46 |
+
- config_name: yelp_review_full
|
47 |
+
data_files:
|
48 |
+
- split: train
|
49 |
+
path: yelp_review_full/train-*
|
50 |
+
- split: test
|
51 |
+
path: yelp_review_full/test-*
|
52 |
+
default: true
|
53 |
train-eval-index:
|
54 |
- config: yelp_review_full
|
55 |
task: text-classification
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"yelp_review_full": {"description": "The Yelp reviews dataset consists of reviews from Yelp. It is extracted from the Yelp Dataset Challenge 2015 data.\nThe Yelp reviews full star dataset is constructed by Xiang Zhang ([email protected]) from the above dataset.\nIt is first used as a text classification benchmark in the following paper: Xiang Zhang, Junbo Zhao, Yann LeCun.\nCharacter-level Convolutional Networks for Text Classification. Advances in Neural Information Processing Systems 28 (NIPS 2015).\n", "citation": "@inproceedings{zhang2015character,\n title={Character-level convolutional networks for text classification},\n author={Zhang, Xiang and Zhao, Junbo and LeCun, Yann},\n booktitle={Advances in neural information processing systems},\n pages={649--657},\n year={2015}\n}\n", "homepage": "https://www.yelp.com/dataset", "license": "https://s3-media3.fl.yelpcdn.com/assets/srv0/engineering_pages/bea5c1e92bf3/assets/vendor/yelp-dataset-agreement.pdf", "features": {"label": {"num_classes": 5, "names": ["1 star", "2 star", "3 stars", "4 stars", "5 stars"], "id": null, "_type": "ClassLabel"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": [{"task": "text-classification", "text_column": "text", "label_column": "label"}], "builder_name": "yelp_review_full", "config_name": "yelp_review_full", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 483811554, "num_examples": 650000, "dataset_name": "yelp_review_full"}, "test": {"name": "test", "num_bytes": 37271188, "num_examples": 50000, "dataset_name": "yelp_review_full"}}, "download_checksums": {"https://s3.amazonaws.com/fast-ai-nlp/yelp_review_full_csv.tgz": {"num_bytes": 196146755, "checksum": "56006b0a17a370f1e366504b1f2c3e3754e4a3dda17d3e718a885c552869a559"}}, "download_size": 196146755, "post_processing_size": null, "dataset_size": 521082742, "size_in_bytes": 717229497}}
|
|
|
|
yelp_review_full.py
DELETED
@@ -1,124 +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 |
-
"""The Yelp Review Full dataset for text classification."""
|
16 |
-
|
17 |
-
|
18 |
-
import csv
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
from datasets.tasks import TextClassification
|
22 |
-
|
23 |
-
|
24 |
-
_CITATION = """\
|
25 |
-
@inproceedings{zhang2015character,
|
26 |
-
title={Character-level convolutional networks for text classification},
|
27 |
-
author={Zhang, Xiang and Zhao, Junbo and LeCun, Yann},
|
28 |
-
booktitle={Advances in neural information processing systems},
|
29 |
-
pages={649--657},
|
30 |
-
year={2015}
|
31 |
-
}
|
32 |
-
"""
|
33 |
-
|
34 |
-
_DESCRIPTION = """\
|
35 |
-
The Yelp reviews dataset consists of reviews from Yelp. It is extracted from the Yelp Dataset Challenge 2015 data.
|
36 |
-
The Yelp reviews full star dataset is constructed by Xiang Zhang ([email protected]) from the above dataset.
|
37 |
-
It is first used as a text classification benchmark in the following paper: Xiang Zhang, Junbo Zhao, Yann LeCun.
|
38 |
-
Character-level Convolutional Networks for Text Classification. Advances in Neural Information Processing Systems 28 (NIPS 2015).
|
39 |
-
"""
|
40 |
-
|
41 |
-
_HOMEPAGE = "https://www.yelp.com/dataset"
|
42 |
-
|
43 |
-
_LICENSE = "https://s3-media3.fl.yelpcdn.com/assets/srv0/engineering_pages/bea5c1e92bf3/assets/vendor/yelp-dataset-agreement.pdf"
|
44 |
-
|
45 |
-
_URLs = {
|
46 |
-
"yelp_review_full": "https://s3.amazonaws.com/fast-ai-nlp/yelp_review_full_csv.tgz",
|
47 |
-
}
|
48 |
-
|
49 |
-
|
50 |
-
class YelpReviewFullConfig(datasets.BuilderConfig):
|
51 |
-
"""BuilderConfig for YelpReviewFull."""
|
52 |
-
|
53 |
-
def __init__(self, **kwargs):
|
54 |
-
"""BuilderConfig for YelpReviewFull.
|
55 |
-
|
56 |
-
Args:
|
57 |
-
**kwargs: keyword arguments forwarded to super.
|
58 |
-
"""
|
59 |
-
super(YelpReviewFullConfig, self).__init__(**kwargs)
|
60 |
-
|
61 |
-
|
62 |
-
class YelpReviewFull(datasets.GeneratorBasedBuilder):
|
63 |
-
"""Yelp Review Full Star Dataset 2015."""
|
64 |
-
|
65 |
-
VERSION = datasets.Version("1.0.0")
|
66 |
-
|
67 |
-
BUILDER_CONFIGS = [
|
68 |
-
YelpReviewFullConfig(
|
69 |
-
name="yelp_review_full", version=VERSION, description="Yelp Review Full Star Dataset 2015"
|
70 |
-
),
|
71 |
-
]
|
72 |
-
|
73 |
-
def _info(self):
|
74 |
-
features = datasets.Features(
|
75 |
-
{
|
76 |
-
"label": datasets.features.ClassLabel(
|
77 |
-
names=[
|
78 |
-
"1 star",
|
79 |
-
"2 star",
|
80 |
-
"3 stars",
|
81 |
-
"4 stars",
|
82 |
-
"5 stars",
|
83 |
-
]
|
84 |
-
),
|
85 |
-
"text": datasets.Value("string"),
|
86 |
-
}
|
87 |
-
)
|
88 |
-
return datasets.DatasetInfo(
|
89 |
-
description=_DESCRIPTION,
|
90 |
-
features=features,
|
91 |
-
supervised_keys=None,
|
92 |
-
homepage=_HOMEPAGE,
|
93 |
-
license=_LICENSE,
|
94 |
-
citation=_CITATION,
|
95 |
-
task_templates=[TextClassification(text_column="text", label_column="label")],
|
96 |
-
)
|
97 |
-
|
98 |
-
def _split_generators(self, dl_manager):
|
99 |
-
"""Returns SplitGenerators."""
|
100 |
-
my_urls = _URLs[self.config.name]
|
101 |
-
archive = dl_manager.download(my_urls)
|
102 |
-
return [
|
103 |
-
datasets.SplitGenerator(
|
104 |
-
name=datasets.Split.TRAIN,
|
105 |
-
gen_kwargs={"filepath": "yelp_review_full_csv/train.csv", "files": dl_manager.iter_archive(archive)},
|
106 |
-
),
|
107 |
-
datasets.SplitGenerator(
|
108 |
-
name=datasets.Split.TEST,
|
109 |
-
gen_kwargs={"filepath": "yelp_review_full_csv/test.csv", "files": dl_manager.iter_archive(archive)},
|
110 |
-
),
|
111 |
-
]
|
112 |
-
|
113 |
-
def _generate_examples(self, filepath, files):
|
114 |
-
"""Yields examples."""
|
115 |
-
for path, f in files:
|
116 |
-
if path == filepath:
|
117 |
-
csvfile = (line.decode("utf-8") for line in f)
|
118 |
-
data = csv.reader(csvfile, delimiter=",", quoting=csv.QUOTE_NONNUMERIC)
|
119 |
-
for id_, row in enumerate(data):
|
120 |
-
yield id_, {
|
121 |
-
"text": row[1],
|
122 |
-
"label": int(row[0]) - 1,
|
123 |
-
}
|
124 |
-
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yelp_review_full/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bf06d5969bff93ecd4a6d4b330643761ce108b42e9b8a894cf82c9df02a08540
|
3 |
+
size 23515519
|
yelp_review_full/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da3ca3dcc52b1e2e44195b53668610d645a59010a985dd45aa12e1109cd44601
|
3 |
+
size 299436850
|