Albert Sawczyn commited on
Commit
d0dc513
1 Parent(s): fa2dc33

add README.md

Browse files
Files changed (1) hide show
  1. README.md +141 -0
README.md ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - other
6
+ languages:
7
+ - pl
8
+ licenses:
9
+ - cc-by-sa-4.0
10
+ multilinguality:
11
+ - monolingual
12
+ pretty_name: 'Polemo2'
13
+ size_categories:
14
+ - 8K
15
+ - 1K<n<10K
16
+ source_datasets:
17
+ - original
18
+ task_categories:
19
+ - text-classification
20
+ task_ids:
21
+ - sentiment-classification
22
+ ---
23
+
24
+ # Polemo2
25
+
26
+ ## Description
27
+
28
+ The PolEmo2.0 is a dataset of online consumer reviews from four domains: medicine, hotels, products, and university. It is human-annotated on a level of full reviews and individual sentences. Current version (PolEmo 2.0) contains 8,216 reviews having 57,466 sentences. Each text and sentence was manually annotated with sentiment in the 2+1 scheme, which gives a total of 197,046 annotations. About 85% of the reviews are from the medicine and hotel domains. Each review is annotated with four labels: positive, negative, neutral, or ambiguous.
29
+
30
+ ## Tasks (input, output and metrics)
31
+
32
+ The task is to predict the correct label of the review.
33
+
34
+ **Input** ('*text*' column): sentence
35
+
36
+ **Output** ('*target*' column): label for sentence sentiment ('zero': neutral, 'minus': negative, 'plus': positive, 'amb': ambiguous)
37
+
38
+ **Domain**: Online reviews
39
+
40
+ **Measurements**: Accuracy, F1 Macro
41
+
42
+ **Example**:
43
+ *Na samym wejściu hotel śmierdzi . W pokojach jest pleśń na ścianach , brudny dywan . W łazience śmierdzi chemią , hotel nie grzeje w pokojach panuje chłód . Wyposażenie pokoju jest stare , kran się rusza , drzwi na balkon nie domykają się . Jedzenie jest w małych ilościach i nie smaczne . Nie polecam nikomu tego hotelu .* → **1 (negative)**
44
+
45
+ ## Data splits
46
+
47
+ | Subset | Cardinality |
48
+ |--------|------------:|
49
+ | train | 6573 |
50
+ | val | 823 |
51
+ | test | 820 |
52
+
53
+ ## Class distribution in train
54
+
55
+ | Class | Fraction |
56
+ |-------|---------:|
57
+ | zero | 0.147726 |
58
+ | minus | 0.375628 |
59
+ | plus | 0.277499 |
60
+ | amb | 0.199148 |
61
+
62
+ ## Citation
63
+
64
+ ```
65
+ @inproceedings{kocon-etal-2019-multi,
66
+ title = "Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews",
67
+ author = "Koco{\'n}, Jan and
68
+ Mi{\l}kowski, Piotr and
69
+ Za{\'s}ko-Zieli{\'n}ska, Monika",
70
+ booktitle = "Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)",
71
+ month = nov,
72
+ year = "2019",
73
+ address = "Hong Kong, China",
74
+ publisher = "Association for Computational Linguistics",
75
+ url = "https://aclanthology.org/K19-1092",
76
+ doi = "10.18653/v1/K19-1092",
77
+ pages = "980--991",
78
+ abstract = "In this article we present an extended version of PolEmo {--} a corpus of consumer reviews from 4 domains: medicine, hotels, products and school. Current version (PolEmo 2.0) contains 8,216 reviews having 57,466 sentences. Each text and sentence was manually annotated with sentiment in 2+1 scheme, which gives a total of 197,046 annotations. We obtained a high value of Positive Specific Agreement, which is 0.91 for texts and 0.88 for sentences. PolEmo 2.0 is publicly available under a Creative Commons copyright license. We explored recent deep learning approaches for the recognition of sentiment, such as Bi-directional Long Short-Term Memory (BiLSTM) and Bidirectional Encoder Representations from Transformers (BERT).",
79
+ }
80
+ ```
81
+
82
+ ## License
83
+
84
+ ```
85
+ Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
86
+ ```
87
+
88
+ ## Links
89
+
90
+ [HuggingFace](https://huggingface.co/datasets/clarin-pl/polemo2-official)
91
+
92
+ [Source](https://clarin-pl.eu/dspace/handle/11321/710)
93
+
94
+ [Paper](https://aclanthology.org/K19-1092/)
95
+
96
+ ## Examples
97
+
98
+ ### Loading
99
+
100
+ ```python
101
+ from pprint import pprint
102
+
103
+ from datasets import load_dataset
104
+
105
+ dataset = load_dataset("clarin-pl/polemo2-official")
106
+ pprint(dataset['train'][0])
107
+
108
+ # {'target': 1,
109
+ # 'text': 'Na samym wejściu hotel śmierdzi . W pokojach jest pleśń na ścianach '
110
+ # ', brudny dywan . W łazience śmierdzi chemią , hotel nie grzeje w '
111
+ # 'pokojach panuje chłód . Wyposażenie pokoju jest stare , kran się '
112
+ # 'rusza , drzwi na balkon nie domykają się . Jedzenie jest w małych '
113
+ # 'ilościach i nie smaczne . Nie polecam nikomu tego hotelu .'}
114
+ ```
115
+
116
+ ### Evaluation
117
+
118
+ ```python
119
+ import random
120
+ from pprint import pprint
121
+
122
+ from datasets import load_dataset, load_metric
123
+
124
+ dataset = load_dataset("clarin-pl/polemo2-official")
125
+ references = dataset["test"]["target"]
126
+
127
+ # generate random predictions
128
+ predictions = [random.randrange(max(references) + 1) for _ in range(len(references))]
129
+
130
+ acc = load_metric("accuracy")
131
+ f1 = load_metric("f1")
132
+
133
+ acc_score = acc.compute(predictions=predictions, references=references)
134
+ f1_score = f1.compute(predictions=predictions, references=references, average='macro')
135
+
136
+ pprint(acc_score)
137
+ pprint(f1_score)
138
+
139
+ # {'accuracy': 0.2475609756097561}
140
+ # {'f1': 0.23747048177471738}
141
+ ```