Datasets:

Task Categories: text-classification
Languages: English
Multilinguality: monolingual
Size Categories: 1K<n<10K
Language Creators: found
Annotations Creators: expert-generated
Source Datasets: original
Licenses: cc-by-4.0
system commited on
Commit
ca8fca8
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,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - cc-by-4-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - n<1K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - text-classification
18
+ task_ids:
19
+ - sentiment-classification
20
+ ---
21
+
22
+ # Dataset Card Creation Guide
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:** N/A
50
+ - **Repository:** [GitHub](https://github.com/google-research-datasets/poem-sentiment)
51
+ - **Paper:** [Investigating Societal Biases in a Poetry Composition System](https://arxiv.org/abs/2011.02686)
52
+ - **Leaderboard:** N/A
53
+ - **Point of Contact:** -
54
+
55
+ ### Dataset Summary
56
+
57
+ Poem Sentiment is a sentiment dataset of poem verses from Project Gutenberg.
58
+ This dataset can be used for tasks such as sentiment classification or style transfer for poems.
59
+
60
+ ### Supported Tasks and Leaderboards
61
+
62
+ [More Information Needed]
63
+
64
+ ### Languages
65
+
66
+ The text in the dataset is in English (`en`).
67
+
68
+ ## Dataset Structure
69
+
70
+ ### Data Instances
71
+ Example of one instance in the dataset.
72
+
73
+ ```{'id': 0, 'label': 2, 'verse_text': 'with pale blue berries. in these peaceful shades--'}```
74
+
75
+ ### Data Fields
76
+
77
+ - `id`: index of the example
78
+ - `verse_text`: The text of the poem verse
79
+ - `label`: The sentiment label. Here
80
+ - 0 = negative
81
+ - 1 = positive
82
+ - 2 = no impact
83
+ - 3 = mixed (both negative and positive)
84
+ > Note: The original dataset uses different label indices (negative = -1, no impact = 0, positive = 1)
85
+
86
+ ### Data Splits
87
+
88
+ The dataset is split into a `train`, `validation`, and `test` split with the following sizes:
89
+
90
+ | | Tain | Valid | Test |
91
+ | ----- | ------ | ----- | ----- |
92
+ | Number of examples | 892 | 105 | 104 |
93
+
94
+
95
+
96
+ [More Information Needed]
97
+ ## Dataset Creation
98
+
99
+ ### Curation Rationale
100
+
101
+ [More Information Needed]
102
+
103
+ ### Source Data
104
+
105
+ [More Information Needed]
106
+
107
+ #### Initial Data Collection and Normalization
108
+
109
+ [More Information Needed]
110
+
111
+ #### Who are the source language producers?
112
+
113
+ [More Information Needed]
114
+
115
+ ### Annotations
116
+
117
+ [More Information Needed]
118
+
119
+ #### Annotation process
120
+
121
+ [More Information Needed]
122
+
123
+ #### Who are the annotators?
124
+
125
+ [More Information Needed]
126
+
127
+ ### Personal and Sensitive Information
128
+
129
+ [More Information Needed]
130
+
131
+ ## Considerations for Using the Data
132
+
133
+ ### Social Impact of Dataset
134
+
135
+ [More Information Needed]
136
+
137
+ ### Discussion of Biases
138
+
139
+ [More Information Needed]
140
+
141
+ ### Other Known Limitations
142
+
143
+ [More Information Needed]
144
+
145
+ ## Additional Information
146
+
147
+ ### Dataset Curators
148
+
149
+ [More Information Needed]
150
+
151
+ ### Licensing Information
152
+
153
+ This work is licensed under a Creative Commons Attribution 4.0 International License
154
+
155
+ ### Citation Information
156
+
157
+ ```
158
+ @misc{sheng2020investigating,
159
+ title={Investigating Societal Biases in a Poetry Composition System},
160
+ author={Emily Sheng and David Uthus},
161
+ year={2020},
162
+ eprint={2011.02686},
163
+ archivePrefix={arXiv},
164
+ primaryClass={cs.CL}
165
+ }
166
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"default": {"description": "Poem Sentiment is a sentiment dataset of poem verses from Project Gutenberg. This dataset can be used for tasks such as sentiment classification or style transfer for poems.\n", "citation": "@misc{sheng2020investigating,\n title={Investigating Societal Biases in a Poetry Composition System},\n author={Emily Sheng and David Uthus},\n year={2020},\n eprint={2011.02686},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://github.com/google-research-datasets/poem-sentiment", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "verse_text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 3, "names": ["negative", "positive", "no_impact"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "poem_sentiment", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 48555, "num_examples": 892, "dataset_name": "poem_sentiment"}, "validation": {"name": "validation", "num_bytes": 5788, "num_examples": 105, "dataset_name": "poem_sentiment"}, "test": {"name": "test", "num_bytes": 5588, "num_examples": 104, "dataset_name": "poem_sentiment"}}, "download_checksums": {"https://raw.githubusercontent.com/google-research-datasets/poem-sentiment/master/data//train.tsv": {"num_bytes": 40567, "checksum": "09503a850796736a8e63504ae2c8de983f57dceebc2342ea93a7f7ad06af56d0"}, "https://raw.githubusercontent.com/google-research-datasets/poem-sentiment/master/data//dev.tsv": {"num_bytes": 4747, "checksum": "0770bd7b80e04c92da82e78f9f93ce35d38b334b4830fca2b9b4d7e174f152e5"}, "https://raw.githubusercontent.com/google-research-datasets/poem-sentiment/master/data//test.tsv": {"num_bytes": 4556, "checksum": "a406d87b62a6b7c9615468a8b66e69c027fa8f2f03a4f8f6c79df26c260de620"}}, "download_size": 49870, "post_processing_size": null, "dataset_size": 59931, "size_in_bytes": 109801}}
dummy/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eca1c5d23c979bee4a312690c71cd2653e0da100f08d61d392766cf075181a11
3
+ size 964
poem_sentiment.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Poem Sentiment: A sentiment dataset of poem verses"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import datasets
20
+
21
+
22
+ _CITATION = """\
23
+ @misc{sheng2020investigating,
24
+ title={Investigating Societal Biases in a Poetry Composition System},
25
+ author={Emily Sheng and David Uthus},
26
+ year={2020},
27
+ eprint={2011.02686},
28
+ archivePrefix={arXiv},
29
+ primaryClass={cs.CL}
30
+ }
31
+ """
32
+
33
+ _DESCRIPTION = """\
34
+ Poem Sentiment is a sentiment dataset of poem verses from Project Gutenberg. \
35
+ This dataset can be used for tasks such as sentiment classification or style transfer for poems.
36
+ """
37
+
38
+
39
+ _HOMEPAGE = "https://github.com/google-research-datasets/poem-sentiment"
40
+
41
+ _BASE_URL = "https://raw.githubusercontent.com/google-research-datasets/poem-sentiment/master/data/"
42
+ _URLS = {
43
+ "train": f"{_BASE_URL}/train.tsv",
44
+ "dev": f"{_BASE_URL}/dev.tsv",
45
+ "test": f"{_BASE_URL}/test.tsv",
46
+ }
47
+ _LABEL_MAPPING = {-1: 0, 0: 2, 1: 1, 2: 3}
48
+
49
+
50
+ class PoemSentiment(datasets.GeneratorBasedBuilder):
51
+ """Poem Sentiment: A sentiment dataset of poem verses"""
52
+
53
+ VERSION = datasets.Version("1.0.0")
54
+
55
+ def _info(self):
56
+ return datasets.DatasetInfo(
57
+ description=_DESCRIPTION,
58
+ features=datasets.Features(
59
+ {
60
+ "id": datasets.Value("int32"),
61
+ "verse_text": datasets.Value("string"),
62
+ "label": datasets.ClassLabel(names=["negative", "positive", "no_impact", "mixed"]),
63
+ }
64
+ ),
65
+ supervised_keys=None,
66
+ homepage=_HOMEPAGE,
67
+ citation=_CITATION,
68
+ )
69
+
70
+ def _split_generators(self, dl_manager):
71
+ downloaded_files = dl_manager.download(_URLS)
72
+ return [
73
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
74
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
75
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
76
+ ]
77
+
78
+ def _generate_examples(self, filepath):
79
+ with open(filepath, encoding="utf-8") as f:
80
+ lines = f.readlines()
81
+ for line in lines:
82
+ fields = line.strip().split("\t")
83
+ idx, verse_text, label = fields
84
+ label = _LABEL_MAPPING[int(label)]
85
+ yield int(idx), {"id": int(idx), "verse_text": verse_text, "label": label}