system HF staff commited on
Commit
f907935
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,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - he
8
+ licenses:
9
+ - mit
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 10K<n<100K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - text-classification
18
+ task_ids:
19
+ - sentiment-classification
20
+ ---
21
+
22
+ # Dataset Card for HebrewSentiment
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:** https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew
50
+ - **Repository:** https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew
51
+ - **Paper:** http://aclweb.org/anthology/C18-1190
52
+ - **Leaderboard:**
53
+ - **Point of Contact:**
54
+
55
+ ### Dataset Summary
56
+
57
+ HebrewSentiment is a data set consists of 12,804 user comments to posts on the official Facebook page of Israel’s
58
+ president, Mr. Reuven Rivlin. In October 2015, we used the open software application Netvizz (Rieder,
59
+ 2013) to scrape all the comments to all of the president’s posts in the period of June – August 2014,
60
+ the first three months of Rivlin’s presidency.2 While the president’s posts aimed at reconciling tensions
61
+ and called for tolerance and empathy, the sentiment expressed in the comments to the president’s posts
62
+ was polarized between citizens who warmly thanked the president, and citizens that fiercely critiqued his
63
+ policy. Of the 12,804 comments, 370 are neutral; 8,512 are positive, 3,922 negative.
64
+
65
+ Data Annotation:
66
+
67
+ ### Supported Tasks and Leaderboards
68
+
69
+ Sentiment Analysis
70
+
71
+ ### Languages
72
+
73
+ Hebrew
74
+
75
+ ## Dataset Structure
76
+
77
+ tsv format:
78
+ {hebrew_sentence}\t{sentiment_label}
79
+
80
+ ### Data Instances
81
+
82
+ רובי הייתי רוצה לראות ערביה נישאת ליהודי 1
83
+ תמונה יפיפיה-שפו 0
84
+ חייבים לעשות סוג של חרם כשכתבים שונאי ישראל עולים לשידור צריכים להעביר לערוץ אחר ואז תראו מה יעשה כוחו של הרייטינג ( בהקשר לדבריה של רינה מצליח ) 2
85
+
86
+
87
+ ### Data Fields
88
+
89
+ - `text`: The modern hebrew inpput text.
90
+ - `label`: The sentiment label. 0=positive , 1=negative, 2=off-topic.
91
+
92
+ ### Data Splits
93
+
94
+ | | train | test |
95
+ |--------------------------|--------|---------|
96
+ | HebrewSentiment (token) | 10243 | 2559 |
97
+ | HebrewSentiment (morph) | 10243 | 2559 |
98
+
99
+
100
+ ## Dataset Creation
101
+
102
+ ### Curation Rationale
103
+
104
+ [More Information Needed]
105
+
106
+ ### Source Data
107
+
108
+ #### Initial Data Collection and Normalization
109
+
110
+ User comments to posts on the official Facebook page of Israel’s
111
+ president, Mr. Reuven Rivlin. In October 2015, we used the open software application Netvizz (Rieder,
112
+ 2013) to scrape all the comments to all of the president’s posts in the period of June – August 2014,
113
+ the first three months of Rivlin’s presidency.
114
+
115
+ #### Who are the source language producers?
116
+
117
+ [More Information Needed]
118
+
119
+ ### Annotations
120
+
121
+ #### Annotation process
122
+
123
+ A trained researcher examined each comment and determined its sentiment value,
124
+ where comments with an overall positive sentiment were assigned the value 0, comments with an overall
125
+ negative sentiment were assigned the value 1, and comments that are off-topic to the post’s content
126
+ were assigned the value 2. We validated the coding scheme by asking a second trained researcher to
127
+ code the same data. There was substantial agreement between raters (N of agreements: 10623, N of
128
+ disagreements: 2105, Coehn’s Kappa = 0.697, p = 0).
129
+
130
+ #### Who are the annotators?
131
+
132
+ Researchers
133
+
134
+ ### Personal and Sensitive Information
135
+
136
+ [More Information Needed]
137
+
138
+ ## Considerations for Using the Data
139
+
140
+ ### Social Impact of Dataset
141
+
142
+ [More Information Needed]
143
+
144
+ ### Discussion of Biases
145
+
146
+ [More Information Needed]
147
+
148
+ ### Other Known Limitations
149
+
150
+ [More Information Needed]
151
+
152
+ ## Additional Information
153
+
154
+ ### Dataset Curators
155
+
156
+ OMIlab, The Open University of Israel
157
+
158
+ ### Licensing Information
159
+
160
+
161
+ MIT License
162
+
163
+ Copyright (c) 2018 OMIlab, The Open University of Israel
164
+
165
+ Permission is hereby granted, free of charge, to any person obtaining a copy
166
+ of this software and associated documentation files (the "Software"), to deal
167
+ in the Software without restriction, including without limitation the rights
168
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
169
+ copies of the Software, and to permit persons to whom the Software is
170
+ furnished to do so, subject to the following conditions:
171
+
172
+ The above copyright notice and this permission notice shall be included in all
173
+ copies or substantial portions of the Software.
174
+
175
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
176
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
177
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
178
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
179
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
180
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
181
+ SOFTWARE.
182
+
183
+ ### Citation Information
184
+
185
+ @inproceedings{amram-etal-2018-representations,
186
+ title = "Representations and Architectures in Neural Sentiment Analysis for Morphologically Rich Languages: A Case Study from {M}odern {H}ebrew",
187
+ author = "Amram, Adam and
188
+ Ben David, Anat and
189
+ Tsarfaty, Reut",
190
+ booktitle = "Proceedings of the 27th International Conference on Computational Linguistics",
191
+ month = aug,
192
+ year = "2018",
193
+ address = "Santa Fe, New Mexico, USA",
194
+ publisher = "Association for Computational Linguistics",
195
+ url = "https://www.aclweb.org/anthology/C18-1190",
196
+ pages = "2242--2252",
197
+ abstract = "This paper empirically studies the effects of representation choices on neural sentiment analysis for Modern Hebrew, a morphologically rich language (MRL) for which no sentiment analyzer currently exists. We study two dimensions of representational choices: (i) the granularity of the input signal (token-based vs. morpheme-based), and (ii) the level of encoding of vocabulary items (string-based vs. character-based). We hypothesise that for MRLs, languages where multiple meaning-bearing elements may be carried by a single space-delimited token, these choices will have measurable effects on task perfromance, and that these effects may vary for different architectural designs {---} fully-connected, convolutional or recurrent. Specifically, we hypothesize that morpheme-based representations will have advantages in terms of their generalization capacity and task accuracy, due to their better OOV coverage. To empirically study these effects, we develop a new sentiment analysis benchmark for Hebrew, based on 12K social media comments, and provide two instances of these data: in token-based and morpheme-based settings. Our experiments show that representation choices empirical effects vary with architecture type. While fully-connected and convolutional networks slightly prefer token-based settings, RNNs benefit from a morpheme-based representation, in accord with the hypothesis that explicit morphological information may help generalize. Our endeavour also delivers the first state-of-the-art broad-coverage sentiment analyzer for Hebrew, with over 89{\%} accuracy, alongside an established benchmark to further study the effects of linguistic representation choices on neural networks{'} task performance.",
198
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"token": {"description": "HebrewSentiment is a data set consists of 12,804 user comments to posts on the official Facebook page of Israel\u2019s\npresident, Mr. Reuven Rivlin. In October 2015, we used the open software application Netvizz (Rieder,\n2013) to scrape all the comments to all of the president\u2019s posts in the period of June \u2013 August 2014,\nthe first three months of Rivlin\u2019s presidency.2 While the president\u2019s posts aimed at reconciling tensions\nand called for tolerance and empathy, the sentiment expressed in the comments to the president\u2019s posts\nwas polarized between citizens who warmly thanked the president, and citizens that fiercely critiqued his\npolicy. Of the 12,804 comments, 370 are neutral; 8,512 are positive, 3,922 negative.\n\nData Annotation: A trained researcher examined each comment and determined its sentiment value,\nwhere comments with an overall positive sentiment were assigned the value 1, comments with an overall\nnegative sentiment were assigned the value -1, and comments that are off-topic to the post\u2019s content\nwere assigned the value 0. We validated the coding scheme by asking a second trained researcher to\ncode the same data. There was substantial agreement between raters (N of agreements: 10623, N of\ndisagreements: 2105, Coehn\u2019s Kappa = 0.697, p = 0).\n", "citation": "@inproceedings{amram-etal-2018-representations,\n title = \"Representations and Architectures in Neural Sentiment Analysis for Morphologically Rich Languages: A Case Study from {M}odern {H}ebrew\",\n author = \"Amram, Adam and\n Ben David, Anat and\n Tsarfaty, Reut\",\n booktitle = \"Proceedings of the 27th International Conference on Computational Linguistics\",\n month = aug,\n year = \"2018\",\n address = \"Santa Fe, New Mexico, USA\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/C18-1190\",\n pages = \"2242--2252\",\n abstract = \"This paper empirically studies the effects of representation choices on neural sentiment analysis for Modern Hebrew, a morphologically rich language (MRL) for which no sentiment analyzer currently exists. We study two dimensions of representational choices: (i) the granularity of the input signal (token-based vs. morpheme-based), and (ii) the level of encoding of vocabulary items (string-based vs. character-based). We hypothesise that for MRLs, languages where multiple meaning-bearing elements may be carried by a single space-delimited token, these choices will have measurable effects on task perfromance, and that these effects may vary for different architectural designs {---} fully-connected, convolutional or recurrent. Specifically, we hypothesize that morpheme-based representations will have advantages in terms of their generalization capacity and task accuracy, due to their better OOV coverage. To empirically study these effects, we develop a new sentiment analysis benchmark for Hebrew, based on 12K social media comments, and provide two instances of these data: in token-based and morpheme-based settings. Our experiments show that representation choices empirical effects vary with architecture type. While fully-connected and convolutional networks slightly prefer token-based settings, RNNs benefit from a morpheme-based representation, in accord with the hypothesis that explicit morphological information may help generalize. Our endeavour also delivers the first state-of-the-art broad-coverage sentiment analyzer for Hebrew, with over 89% accuracy, alongside an established benchmark to further study the effects of linguistic representation choices on neural networks{'} task performance.\",\n}\n", "homepage": "https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 3, "names": ["pos", "neg", "off-topic"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "hebrew_sentiment", "config_name": "token", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2159738, "num_examples": 10244, "dataset_name": "hebrew_sentiment"}, "test": {"name": "test", "num_bytes": 540883, "num_examples": 2560, "dataset_name": "hebrew_sentiment"}}, "download_checksums": {"https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew/blob/master/data/token_train.tsv?raw=true": {"num_bytes": 2074235, "checksum": "b394fc765f10fde63001c7b92f2bc4bb43278884ee3be07c855724b0634e6aae"}, "https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew/blob/master/data/token_test.tsv?raw=true": {"num_bytes": 519408, "checksum": "0c19097173125fc42fe52b2b4415df19ee818a6d6547ac4bc40da8725924cbc7"}}, "download_size": 2593643, "post_processing_size": null, "dataset_size": 2700621, "size_in_bytes": 5294264}, "morph": {"description": "HebrewSentiment is a data set consists of 12,804 user comments to posts on the official Facebook page of Israel\u2019s\npresident, Mr. Reuven Rivlin. In October 2015, we used the open software application Netvizz (Rieder,\n2013) to scrape all the comments to all of the president\u2019s posts in the period of June \u2013 August 2014,\nthe first three months of Rivlin\u2019s presidency.2 While the president\u2019s posts aimed at reconciling tensions\nand called for tolerance and empathy, the sentiment expressed in the comments to the president\u2019s posts\nwas polarized between citizens who warmly thanked the president, and citizens that fiercely critiqued his\npolicy. Of the 12,804 comments, 370 are neutral; 8,512 are positive, 3,922 negative.\n\nData Annotation: A trained researcher examined each comment and determined its sentiment value,\nwhere comments with an overall positive sentiment were assigned the value 1, comments with an overall\nnegative sentiment were assigned the value -1, and comments that are off-topic to the post\u2019s content\nwere assigned the value 0. We validated the coding scheme by asking a second trained researcher to\ncode the same data. There was substantial agreement between raters (N of agreements: 10623, N of\ndisagreements: 2105, Coehn\u2019s Kappa = 0.697, p = 0).\n", "citation": "@inproceedings{amram-etal-2018-representations,\n title = \"Representations and Architectures in Neural Sentiment Analysis for Morphologically Rich Languages: A Case Study from {M}odern {H}ebrew\",\n author = \"Amram, Adam and\n Ben David, Anat and\n Tsarfaty, Reut\",\n booktitle = \"Proceedings of the 27th International Conference on Computational Linguistics\",\n month = aug,\n year = \"2018\",\n address = \"Santa Fe, New Mexico, USA\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/C18-1190\",\n pages = \"2242--2252\",\n abstract = \"This paper empirically studies the effects of representation choices on neural sentiment analysis for Modern Hebrew, a morphologically rich language (MRL) for which no sentiment analyzer currently exists. We study two dimensions of representational choices: (i) the granularity of the input signal (token-based vs. morpheme-based), and (ii) the level of encoding of vocabulary items (string-based vs. character-based). We hypothesise that for MRLs, languages where multiple meaning-bearing elements may be carried by a single space-delimited token, these choices will have measurable effects on task perfromance, and that these effects may vary for different architectural designs {---} fully-connected, convolutional or recurrent. Specifically, we hypothesize that morpheme-based representations will have advantages in terms of their generalization capacity and task accuracy, due to their better OOV coverage. To empirically study these effects, we develop a new sentiment analysis benchmark for Hebrew, based on 12K social media comments, and provide two instances of these data: in token-based and morpheme-based settings. Our experiments show that representation choices empirical effects vary with architecture type. While fully-connected and convolutional networks slightly prefer token-based settings, RNNs benefit from a morpheme-based representation, in accord with the hypothesis that explicit morphological information may help generalize. Our endeavour also delivers the first state-of-the-art broad-coverage sentiment analyzer for Hebrew, with over 89% accuracy, alongside an established benchmark to further study the effects of linguistic representation choices on neural networks{'} task performance.\",\n}\n", "homepage": "https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 3, "names": ["pos", "neg", "off-topic"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "hebrew_sentiment", "config_name": "morph", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2258128, "num_examples": 10221, "dataset_name": "hebrew_sentiment"}, "test": {"name": "test", "num_bytes": 571401, "num_examples": 2555, "dataset_name": "hebrew_sentiment"}}, "download_checksums": {"https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew/blob/master/data/morph_train.tsv?raw=true": {"num_bytes": 2172705, "checksum": "ee74c6c0984c91a7d2ebb257619574bacdb1cb394c70e84073ac778e5dd24ba5"}, "https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew/blob/master/data/morph_test.tsv?raw=true": {"num_bytes": 549967, "checksum": "6529e8a4cd5c7a593e518b50f7c94ab20e5c753a48ef9484337e8467b4c42213"}}, "download_size": 2722672, "post_processing_size": null, "dataset_size": 2829529, "size_in_bytes": 5552201}}
dummy/morph/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9cd510c42355e8b6dbc6d6cd5cd8468dab32eb77c1d13c7fe396622577152e4c
3
+ size 1189
dummy/token/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2be07d646691254b50eada42c7f862654854b9a099b1d64884bfd0536155f10
3
+ size 1169
hebrew_sentiment.py ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """HebrewSentiment: A Modern Hebrew Sentiment Analysis Dataset."""
2
+
3
+ from __future__ import absolute_import, division, print_function
4
+
5
+ import csv
6
+
7
+ import datasets
8
+
9
+
10
+ _DESCRIPTION = """\
11
+ HebrewSentiment is a data set consists of 12,804 user comments to posts on the official Facebook page of Israel’s
12
+ president, Mr. Reuven Rivlin. In October 2015, we used the open software application Netvizz (Rieder,
13
+ 2013) to scrape all the comments to all of the president’s posts in the period of June – August 2014,
14
+ the first three months of Rivlin’s presidency.2 While the president’s posts aimed at reconciling tensions
15
+ and called for tolerance and empathy, the sentiment expressed in the comments to the president’s posts
16
+ was polarized between citizens who warmly thanked the president, and citizens that fiercely critiqued his
17
+ policy. Of the 12,804 comments, 370 are neutral; 8,512 are positive, 3,922 negative.
18
+
19
+ Data Annotation: A trained researcher examined each comment and determined its sentiment value,
20
+ where comments with an overall positive sentiment were assigned the value 1, comments with an overall
21
+ negative sentiment were assigned the value -1, and comments that are off-topic to the post’s content
22
+ were assigned the value 0. We validated the coding scheme by asking a second trained researcher to
23
+ code the same data. There was substantial agreement between raters (N of agreements: 10623, N of
24
+ disagreements: 2105, Coehn’s Kappa = 0.697, p = 0).
25
+ """
26
+
27
+ _CITATION = """\
28
+ @inproceedings{amram-etal-2018-representations,
29
+ title = "Representations and Architectures in Neural Sentiment Analysis for Morphologically Rich Languages: A Case Study from {M}odern {H}ebrew",
30
+ author = "Amram, Adam and
31
+ Ben David, Anat and
32
+ Tsarfaty, Reut",
33
+ booktitle = "Proceedings of the 27th International Conference on Computational Linguistics",
34
+ month = aug,
35
+ year = "2018",
36
+ address = "Santa Fe, New Mexico, USA",
37
+ publisher = "Association for Computational Linguistics",
38
+ url = "https://www.aclweb.org/anthology/C18-1190",
39
+ pages = "2242--2252",
40
+ abstract = "This paper empirically studies the effects of representation choices on neural sentiment analysis for Modern Hebrew, a morphologically rich language (MRL) for which no sentiment analyzer currently exists. We study two dimensions of representational choices: (i) the granularity of the input signal (token-based vs. morpheme-based), and (ii) the level of encoding of vocabulary items (string-based vs. character-based). We hypothesise that for MRLs, languages where multiple meaning-bearing elements may be carried by a single space-delimited token, these choices will have measurable effects on task perfromance, and that these effects may vary for different architectural designs {---} fully-connected, convolutional or recurrent. Specifically, we hypothesize that morpheme-based representations will have advantages in terms of their generalization capacity and task accuracy, due to their better OOV coverage. To empirically study these effects, we develop a new sentiment analysis benchmark for Hebrew, based on 12K social media comments, and provide two instances of these data: in token-based and morpheme-based settings. Our experiments show that representation choices empirical effects vary with architecture type. While fully-connected and convolutional networks slightly prefer token-based settings, RNNs benefit from a morpheme-based representation, in accord with the hypothesis that explicit morphological information may help generalize. Our endeavour also delivers the first state-of-the-art broad-coverage sentiment analyzer for Hebrew, with over 89% accuracy, alongside an established benchmark to further study the effects of linguistic representation choices on neural networks{'} task performance.",
41
+ }
42
+ """
43
+
44
+ _TRAIN_TOKEN_DOWNLOAD_URL = (
45
+ "https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew/blob/master/data/token_train.tsv?raw=true"
46
+ )
47
+ _TEST_TOKEN_DOWNLOAD_URL = (
48
+ "https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew/blob/master/data/token_test.tsv?raw=true"
49
+ )
50
+ _TRAIN_MORPH_DOWNLOAD_URL = (
51
+ "https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew/blob/master/data/morph_train.tsv?raw=true"
52
+ )
53
+ _TEST_MORPH_DOWNLOAD_URL = (
54
+ "https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew/blob/master/data/morph_test.tsv?raw=true"
55
+ )
56
+
57
+
58
+ class HebrewSentimentConfig(datasets.BuilderConfig):
59
+ """BuilderConfig for HebrewSentiment."""
60
+
61
+ def __init__(self, granularity="token", **kwargs):
62
+ """BuilderConfig for HebrewSentiment.
63
+ Args:
64
+ **kwargs: keyword arguments forwarded to super.
65
+ """
66
+ assert granularity in {"token", "morph"}
67
+ self.granularity = granularity
68
+ super(HebrewSentimentConfig, self).__init__(**kwargs)
69
+
70
+
71
+ class HebrewSentiment(datasets.GeneratorBasedBuilder):
72
+ """HebrewSentiment: A Modern Hebrew Sentiment Analysis Dataset."""
73
+
74
+ BUILDER_CONFIG_CLASS = HebrewSentimentConfig
75
+
76
+ DEFAULT_CONFIG_NAME = "token"
77
+
78
+ BUILDER_CONFIGS = [
79
+ HebrewSentimentConfig(
80
+ name="token",
81
+ version=datasets.Version("1.0.0", ""),
82
+ description="Hebrew Sentiment Dataset with token-based tokenization.",
83
+ granularity="token",
84
+ ),
85
+ HebrewSentimentConfig(
86
+ name="morph",
87
+ version=datasets.Version("1.0.0", ""),
88
+ description="Hebrew Sentiment Dataset with morpheme-based tokenization.",
89
+ granularity="morph",
90
+ ),
91
+ ]
92
+
93
+ def _info(self):
94
+ return datasets.DatasetInfo(
95
+ description=_DESCRIPTION,
96
+ features=datasets.Features(
97
+ {
98
+ "text": datasets.Value("string"),
99
+ "label": datasets.features.ClassLabel(names=["pos", "neg", "off-topic"]),
100
+ }
101
+ ),
102
+ homepage="https://github.com/omilab/Neural-Sentiment-Analyzer-for-Modern-Hebrew",
103
+ citation=_CITATION,
104
+ )
105
+
106
+ def _split_generators(self, dl_manager):
107
+ train_url = _TRAIN_TOKEN_DOWNLOAD_URL if self.config.granularity == "token" else _TRAIN_MORPH_DOWNLOAD_URL
108
+ train_path = dl_manager.download_and_extract(train_url)
109
+ test_url = _TEST_TOKEN_DOWNLOAD_URL if self.config.granularity == "token" else _TEST_MORPH_DOWNLOAD_URL
110
+ test_path = dl_manager.download_and_extract(test_url)
111
+
112
+ return [
113
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
114
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}),
115
+ ]
116
+
117
+ def _generate_examples(self, filepath):
118
+ """Generate Hebrew Sentiment examples."""
119
+ with open(filepath, encoding="utf-8") as csv_file:
120
+ csv_reader = csv.DictReader(csv_file, fieldnames=["text", "label"], delimiter="\t")
121
+ for id_, row in enumerate(csv_reader):
122
+ row["label"] = int(row["label"])
123
+ yield id_, row