system HF staff commited on
Commit
27da5b3
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,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - crowdsourced
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - other-yelp-licence
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 100K<n<1M
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - text-classification
18
+ task_ids:
19
+ - sentiment-classification
20
+ ---
21
+
22
+ # Dataset Card for YelpReviewFull
23
+
24
+ ## Table of Contents
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-instances)
32
+ - [Data Splits](#data-instances)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+
47
+ ## Dataset Description
48
+
49
+ - **Homepage:** [Yelp](https://www.yelp.com/dataset)
50
+ - **Repository:** [Crepe](https://github.com/zhangxiangxiao/Crepe)
51
+ - **Paper:** [Character-level Convolutional Networks for Text Classification](https://arxiv.org/abs/1509.01626)
52
+ - **Point of Contact:** [Xiang Zhang](mailto:xiang.zhang@nyu.edu)
53
+
54
+ ### Dataset Summary
55
+
56
+ The Yelp reviews dataset consists of reviews from Yelp.
57
+ It is extracted from the Yelp Dataset Challenge 2015 data.
58
+
59
+ ### Supported Tasks and Leaderboards
60
+
61
+ - `text-classification`, `sentiment-classification`: The dataset is mainly used for text classification: given the text, predict the sentiment.
62
+
63
+ ### Languages
64
+
65
+ The reviews were mainly written in english.
66
+
67
+ ## Dataset Structure
68
+
69
+ ### Data Instances
70
+
71
+ A typical data point, comprises of a text and the corresponding label.
72
+
73
+ An example from the YelpReviewFull test set looks as follows:
74
+ ```
75
+ {
76
+ 'label': 0,
77
+ 'text': 'I got \'new\' tires from them and within two weeks got a flat. I took my car to a local mechanic to see if i could get the hole patched, but they said the reason I had a flat was because the previous patch had blown - WAIT, WHAT? I just got the tire and never needed to have it patched? This was supposed to be a new tire. \\nI took the tire over to Flynn\'s and they told me that someone punctured my tire, then tried to patch it. So there are resentful tire slashers? I find that very unlikely. After arguing with the guy and telling him that his logic was far fetched he said he\'d give me a new tire \\"this time\\". \\nI will never go back to Flynn\'s b/c of the way this guy treated me and the simple fact that they gave me a used tire!'
78
+ }
79
+ ```
80
+
81
+ ### Data Fields
82
+
83
+ - 'text': The review texts are escaped using double quotes ("), and any internal double quote is escaped by 2 double quotes (""). New lines are escaped by a backslash followed with an "n" character, that is "\n".
84
+ - 'label': Corresponds to the score associated with the review (between 1 and 5).
85
+
86
+ ### Data Splits
87
+
88
+ The Yelp reviews full star dataset is constructed by randomly taking 130,000 training samples and 10,000 testing samples for each review star from 1 to 5.
89
+ In total there are 650,000 trainig samples and 50,000 testing samples.
90
+
91
+ ## Dataset Creation
92
+
93
+ ### Curation Rationale
94
+
95
+ The Yelp reviews full star dataset is constructed by Xiang Zhang (xiang.zhang@nyu.edu) from the Yelp Dataset Challenge 2015. It is first used as a text classification benchmark in the following paper: Xiang Zhang, Junbo Zhao, Yann LeCun. Character-level Convolutional Networks for Text Classification. Advances in Neural Information Processing Systems 28 (NIPS 2015).
96
+
97
+ ### Source Data
98
+
99
+ #### Initial Data Collection and Normalization
100
+
101
+ [More Information Needed]
102
+
103
+ #### Who are the source language producers?
104
+
105
+ [More Information Needed]
106
+
107
+ ### Annotations
108
+
109
+ #### Annotation process
110
+
111
+ [More Information Needed]
112
+
113
+ #### Who are the annotators?
114
+
115
+ [More Information Needed]
116
+
117
+ ### Personal and Sensitive Information
118
+
119
+ [More Information Needed]
120
+
121
+ ## Considerations for Using the Data
122
+
123
+ ### Social Impact of Dataset
124
+
125
+ [More Information Needed]
126
+
127
+ ### Discussion of Biases
128
+
129
+ [More Information Needed]
130
+
131
+ ### Other Known Limitations
132
+
133
+ [More Information Needed]
134
+
135
+ ## Additional Information
136
+
137
+ ### Dataset Curators
138
+
139
+ [More Information Needed]
140
+
141
+ ### Licensing Information
142
+
143
+ You can check the official [yelp-dataset-agreement](https://s3-media3.fl.yelpcdn.com/assets/srv0/engineering_pages/bea5c1e92bf3/assets/vendor/yelp-dataset-agreement.pdf).
144
+
145
+ ### Citation Information
146
+
147
+ Xiang Zhang, Junbo Zhao, Yann LeCun. Character-level Convolutional Networks for Text Classification. Advances in Neural Information Processing Systems 28 (NIPS 2015).
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
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 (xiang.zhang@nyu.edu) 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"], "names_file": null, "id": null, "_type": "ClassLabel"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "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": 483811814, "num_examples": 650000, "dataset_name": "yelp_review_full"}, "test": {"name": "test", "num_bytes": 37271208, "num_examples": 50000, "dataset_name": "yelp_review_full"}}, "download_checksums": {"https://drive.google.com/uc?export=download&id=0Bz8a_Dbh9QhbZlU4dXhHTFhZQU0": {"num_bytes": 196146693, "checksum": "9f4dd0a449885e1b5679cf79cd03f06f157190e53f4af4a325aa7bcc9381bee7"}}, "download_size": 196146693, "post_processing_size": null, "dataset_size": 521083022, "size_in_bytes": 717229715}}
dummy/yelp_review_full/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65e877f1d4c2e54d9faf195168ab5dcdd2f7a8f7ee21987cbeccdb7c32b2fde1
3
+ size 4946
yelp_review_full.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import csv
20
+ import os
21
+
22
+ import datasets
23
+
24
+
25
+ _CITATION = """\
26
+ @inproceedings{zhang2015character,
27
+ title={Character-level convolutional networks for text classification},
28
+ author={Zhang, Xiang and Zhao, Junbo and LeCun, Yann},
29
+ booktitle={Advances in neural information processing systems},
30
+ pages={649--657},
31
+ year={2015}
32
+ }
33
+ """
34
+
35
+ _DESCRIPTION = """\
36
+ The Yelp reviews dataset consists of reviews from Yelp. It is extracted from the Yelp Dataset Challenge 2015 data.
37
+ The Yelp reviews full star dataset is constructed by Xiang Zhang (xiang.zhang@nyu.edu) from the above dataset.
38
+ It is first used as a text classification benchmark in the following paper: Xiang Zhang, Junbo Zhao, Yann LeCun.
39
+ Character-level Convolutional Networks for Text Classification. Advances in Neural Information Processing Systems 28 (NIPS 2015).
40
+ """
41
+
42
+ _HOMEPAGE = "https://www.yelp.com/dataset"
43
+
44
+ _LICENSE = "https://s3-media3.fl.yelpcdn.com/assets/srv0/engineering_pages/bea5c1e92bf3/assets/vendor/yelp-dataset-agreement.pdf"
45
+
46
+ _URLs = {
47
+ "yelp_review_full": "https://drive.google.com/uc?export=download&id=0Bz8a_Dbh9QhbZlU4dXhHTFhZQU0",
48
+ }
49
+
50
+
51
+ class YelpReviewFullConfig(datasets.BuilderConfig):
52
+ """BuilderConfig for YelpReviewFull."""
53
+
54
+ def __init__(self, **kwargs):
55
+ """BuilderConfig for YelpReviewFull.
56
+
57
+ Args:
58
+ **kwargs: keyword arguments forwarded to super.
59
+ """
60
+ super(YelpReviewFullConfig, self).__init__(**kwargs)
61
+
62
+
63
+ class YelpReviewFull(datasets.GeneratorBasedBuilder):
64
+ """Yelp Review Full Star Dataset 2015."""
65
+
66
+ VERSION = datasets.Version("1.0.0")
67
+
68
+ BUILDER_CONFIGS = [
69
+ YelpReviewFullConfig(
70
+ name="yelp_review_full", version=VERSION, description="Yelp Review Full Star Dataset 2015"
71
+ ),
72
+ ]
73
+
74
+ def _info(self):
75
+ features = datasets.Features(
76
+ {
77
+ "label": datasets.features.ClassLabel(
78
+ names=[
79
+ "1 star",
80
+ "2 star",
81
+ "3 stars",
82
+ "4 stars",
83
+ "5 stars",
84
+ ]
85
+ ),
86
+ "text": datasets.Value("string"),
87
+ }
88
+ )
89
+ return datasets.DatasetInfo(
90
+ description=_DESCRIPTION,
91
+ features=features,
92
+ supervised_keys=None,
93
+ homepage=_HOMEPAGE,
94
+ license=_LICENSE,
95
+ citation=_CITATION,
96
+ )
97
+
98
+ def _split_generators(self, dl_manager):
99
+ """Returns SplitGenerators."""
100
+ my_urls = _URLs[self.config.name]
101
+ data_dir = dl_manager.download_and_extract(my_urls)
102
+ return [
103
+ datasets.SplitGenerator(
104
+ name=datasets.Split.TRAIN,
105
+ gen_kwargs={
106
+ "filepath": os.path.join(data_dir, "yelp_review_full_csv", "train.csv"),
107
+ "split": "train",
108
+ },
109
+ ),
110
+ datasets.SplitGenerator(
111
+ name=datasets.Split.TEST,
112
+ gen_kwargs={"filepath": os.path.join(data_dir, "yelp_review_full_csv", "test.csv"), "split": "test"},
113
+ ),
114
+ ]
115
+
116
+ def _generate_examples(self, filepath, split):
117
+ """ Yields examples. """
118
+
119
+ with open(filepath, encoding="utf-8") as f:
120
+ data = csv.reader(f, delimiter=",", quoting=csv.QUOTE_NONNUMERIC)
121
+ for id_, row in enumerate(data):
122
+ yield id_, {
123
+ "text": row[1],
124
+ "label": int(row[0]) - 1,
125
+ }