Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
sentiment-classification
Languages:
Swedish
Size:
100K - 1M
License:
Commit
·
050e4e3
1
Parent(s):
2df3127
Update parquet files
Browse files- .gitattributes +0 -27
- README.md +0 -182
- dataset_infos.json +0 -1
- plain_text/swedish_reviews-test.parquet +3 -0
- plain_text/swedish_reviews-train.parquet +3 -0
- plain_text/swedish_reviews-validation.parquet +3 -0
- swedish_reviews.py +0 -82
.gitattributes
DELETED
@@ -1,27 +0,0 @@
|
|
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
DELETED
@@ -1,182 +0,0 @@
|
|
1 |
-
---
|
2 |
-
annotations_creators:
|
3 |
-
- found
|
4 |
-
language_creators:
|
5 |
-
- found
|
6 |
-
language:
|
7 |
-
- sv
|
8 |
-
license:
|
9 |
-
- unknown
|
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 |
-
paperswithcode_id: null
|
21 |
-
pretty_name: Swedish Reviews
|
22 |
-
dataset_info:
|
23 |
-
features:
|
24 |
-
- name: text
|
25 |
-
dtype: string
|
26 |
-
- name: label
|
27 |
-
dtype:
|
28 |
-
class_label:
|
29 |
-
names:
|
30 |
-
0: negative
|
31 |
-
1: positive
|
32 |
-
config_name: plain_text
|
33 |
-
splits:
|
34 |
-
- name: test
|
35 |
-
num_bytes: 6296541
|
36 |
-
num_examples: 20697
|
37 |
-
- name: validation
|
38 |
-
num_bytes: 6359227
|
39 |
-
num_examples: 20696
|
40 |
-
- name: train
|
41 |
-
num_bytes: 18842891
|
42 |
-
num_examples: 62089
|
43 |
-
download_size: 11841056
|
44 |
-
dataset_size: 31498659
|
45 |
-
---
|
46 |
-
|
47 |
-
# Dataset Card for Swedish Reviews
|
48 |
-
|
49 |
-
## Table of Contents
|
50 |
-
- [Dataset Description](#dataset-description)
|
51 |
-
- [Dataset Summary](#dataset-summary)
|
52 |
-
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
53 |
-
- [Languages](#languages)
|
54 |
-
- [Dataset Structure](#dataset-structure)
|
55 |
-
- [Data Instances](#data-instances)
|
56 |
-
- [Data Fields](#data-fields)
|
57 |
-
- [Data Splits](#data-splits)
|
58 |
-
- [Dataset Creation](#dataset-creation)
|
59 |
-
- [Curation Rationale](#curation-rationale)
|
60 |
-
- [Source Data](#source-data)
|
61 |
-
- [Annotations](#annotations)
|
62 |
-
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
63 |
-
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
64 |
-
- [Social Impact of Dataset](#social-impact-of-dataset)
|
65 |
-
- [Discussion of Biases](#discussion-of-biases)
|
66 |
-
- [Other Known Limitations](#other-known-limitations)
|
67 |
-
- [Additional Information](#additional-information)
|
68 |
-
- [Dataset Curators](#dataset-curators)
|
69 |
-
- [Licensing Information](#licensing-information)
|
70 |
-
- [Citation Information](#citation-information)
|
71 |
-
- [Contributions](#contributions)
|
72 |
-
|
73 |
-
## Dataset Description
|
74 |
-
|
75 |
-
- **Homepage:** [swedish_reviews homepage](https://github.com/timpal0l/swedish-sentiment)
|
76 |
-
- **Repository:** [swedish_reviews repository](https://github.com/timpal0l/swedish-sentiment)
|
77 |
-
- **Point of Contact:** [Tim Isbister](mailto:[email protected])
|
78 |
-
|
79 |
-
### Dataset Summary
|
80 |
-
|
81 |
-
The dataset is scraped from various Swedish websites where reviews are present. The dataset consists of 103 482 samples split between `train`, `valid` and `test`. It is a sample of the full dataset, where this sample is balanced to the minority class (negative). The original data dump was heavly skewved to positive samples with a 95/5 ratio.
|
82 |
-
|
83 |
-
### Supported Tasks and Leaderboards
|
84 |
-
|
85 |
-
This dataset can be used to evaluate sentiment classification on Swedish.
|
86 |
-
|
87 |
-
### Languages
|
88 |
-
|
89 |
-
The text in the dataset is in Swedish.
|
90 |
-
|
91 |
-
## Dataset Structure
|
92 |
-
|
93 |
-
### Data Instances
|
94 |
-
|
95 |
-
What a sample looks like:
|
96 |
-
```
|
97 |
-
{
|
98 |
-
'text': 'Jag tycker huggingface är ett grymt project!',
|
99 |
-
'label': 1,
|
100 |
-
}
|
101 |
-
```
|
102 |
-
|
103 |
-
### Data Fields
|
104 |
-
|
105 |
-
- `text`: A text where the sentiment expression is present.
|
106 |
-
- `label`: a int representing the label `0`for negative and `1`for positive.
|
107 |
-
|
108 |
-
### Data Splits
|
109 |
-
|
110 |
-
The data is split into a training, validation and test set. The final split sizes are as follow:
|
111 |
-
|
112 |
-
| Train | Valid | Test |
|
113 |
-
| ------ | ----- | ---- |
|
114 |
-
| 62089 | 20696 | 20697 |
|
115 |
-
|
116 |
-
## Dataset Creation
|
117 |
-
|
118 |
-
### Curation Rationale
|
119 |
-
|
120 |
-
[More Information Needed]
|
121 |
-
|
122 |
-
### Source Data
|
123 |
-
|
124 |
-
Various Swedish websites with product reviews.
|
125 |
-
|
126 |
-
#### Initial Data Collection and Normalization
|
127 |
-
|
128 |
-
#### Who are the source language producers?
|
129 |
-
|
130 |
-
Swedish
|
131 |
-
|
132 |
-
### Annotations
|
133 |
-
|
134 |
-
[More Information Needed]
|
135 |
-
|
136 |
-
#### Annotation process
|
137 |
-
|
138 |
-
Automatically annotated based on user reviews on a scale 1-5, where 1-2 is considered `negative` and 4-5 is `positive`, 3 is skipped as it tends to be more neutral.
|
139 |
-
|
140 |
-
#### Who are the annotators?
|
141 |
-
|
142 |
-
The users who have been using the products.
|
143 |
-
|
144 |
-
### Personal and Sensitive Information
|
145 |
-
|
146 |
-
[More Information Needed]
|
147 |
-
|
148 |
-
## Considerations for Using the Data
|
149 |
-
|
150 |
-
[More Information Needed]
|
151 |
-
|
152 |
-
### Social Impact of Dataset
|
153 |
-
|
154 |
-
[More Information Needed]
|
155 |
-
|
156 |
-
### Discussion of Biases
|
157 |
-
|
158 |
-
[More Information Needed]
|
159 |
-
|
160 |
-
### Other Known Limitations
|
161 |
-
|
162 |
-
[More Information Needed]
|
163 |
-
|
164 |
-
## Additional Information
|
165 |
-
|
166 |
-
[More Information Needed]
|
167 |
-
|
168 |
-
### Dataset Curators
|
169 |
-
|
170 |
-
The corpus was scraped by @timpal0l
|
171 |
-
|
172 |
-
### Licensing Information
|
173 |
-
|
174 |
-
Research only.
|
175 |
-
|
176 |
-
### Citation Information
|
177 |
-
|
178 |
-
No paper exists currently.
|
179 |
-
|
180 |
-
### Contributions
|
181 |
-
|
182 |
-
Thanks to [@timpal0l](https://github.com/timpal0l) for adding this dataset.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"plain_text": {"description": "Swedish reviews scarped from various public available websites", "citation": "", "homepage": "https://github.com/timpal0l/swedish-sentiment", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["negative", "positive"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "task_templates": [{"task": "text-classification", "text_column": "text", "label_column": "label", "labels": ["negative", "positive"]}], "builder_name": "swedish_reviews", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 6296541, "num_examples": 20697, "dataset_name": "swedish_reviews"}, "validation": {"name": "validation", "num_bytes": 6359227, "num_examples": 20696, "dataset_name": "swedish_reviews"}, "train": {"name": "train", "num_bytes": 18842891, "num_examples": 62089, "dataset_name": "swedish_reviews"}}, "download_checksums": {"https://raw.githubusercontent.com/timpal0l/swedish-sentiment/main/swedish_sentiment.zip": {"num_bytes": 11841056, "checksum": "1bf3b7111af2bd1c43b30e32201d35b70ebacb80cd505666383142183e46ca98"}}, "download_size": 11841056, "post_processing_size": null, "dataset_size": 31498659, "size_in_bytes": 43339715}}
|
|
|
|
plain_text/swedish_reviews-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2b50151fe2281bbaf6b3b1b8cb85e9b84473ba928e89dae9c6fbf5539768fddb
|
3 |
+
size 3905562
|
plain_text/swedish_reviews-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cef70e3627720b70369dee0736311e7057c08b46b7601be6d60b77e4fd99a423
|
3 |
+
size 11760701
|
plain_text/swedish_reviews-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c699bf7d3ac62a5e2ed0904a20e6b168db6f7b71ee9c39283d7c69e67993334d
|
3 |
+
size 3956504
|
swedish_reviews.py
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
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 |
-
|
16 |
-
# Lint as: python3
|
17 |
-
|
18 |
-
|
19 |
-
import csv
|
20 |
-
import os
|
21 |
-
|
22 |
-
import datasets
|
23 |
-
from datasets.tasks import TextClassification
|
24 |
-
|
25 |
-
|
26 |
-
_DOWNLOAD_URL = "https://raw.githubusercontent.com/timpal0l/swedish-sentiment/main/swedish_sentiment.zip"
|
27 |
-
_TRAIN_FILE = "train.csv"
|
28 |
-
_VAL_FILE = "dev.csv"
|
29 |
-
_TEST_FILE = "test.csv"
|
30 |
-
|
31 |
-
_CITATION = ""
|
32 |
-
|
33 |
-
_DESCRIPTION = "Swedish reviews scarped from various public available websites"
|
34 |
-
|
35 |
-
|
36 |
-
class SwedishReviews(datasets.GeneratorBasedBuilder):
|
37 |
-
BUILDER_CONFIGS = [
|
38 |
-
datasets.BuilderConfig(
|
39 |
-
name="plain_text",
|
40 |
-
version=datasets.Version("1.0.0", ""),
|
41 |
-
description="Plain text import of the Swedish Reviews dataset",
|
42 |
-
)
|
43 |
-
]
|
44 |
-
|
45 |
-
def _info(self):
|
46 |
-
return datasets.DatasetInfo(
|
47 |
-
description=_DESCRIPTION,
|
48 |
-
features=datasets.Features(
|
49 |
-
{"text": datasets.Value("string"), "label": datasets.ClassLabel(names=["negative", "positive"])}
|
50 |
-
),
|
51 |
-
supervised_keys=None,
|
52 |
-
homepage="https://github.com/timpal0l/swedish-sentiment",
|
53 |
-
citation=_CITATION,
|
54 |
-
task_templates=[TextClassification(text_column="text", label_column="label")],
|
55 |
-
)
|
56 |
-
|
57 |
-
def _split_generators(self, dl_manager):
|
58 |
-
dl_dir = dl_manager.download_and_extract(_DOWNLOAD_URL)
|
59 |
-
return [
|
60 |
-
datasets.SplitGenerator(
|
61 |
-
name=datasets.Split.TEST,
|
62 |
-
gen_kwargs={"filepath": os.path.join(dl_dir, _TEST_FILE)},
|
63 |
-
),
|
64 |
-
datasets.SplitGenerator(
|
65 |
-
name=datasets.Split.VALIDATION,
|
66 |
-
gen_kwargs={"filepath": os.path.join(dl_dir, _VAL_FILE)},
|
67 |
-
),
|
68 |
-
datasets.SplitGenerator(
|
69 |
-
name=datasets.Split.TRAIN,
|
70 |
-
gen_kwargs={"filepath": os.path.join(dl_dir, _TRAIN_FILE)},
|
71 |
-
),
|
72 |
-
]
|
73 |
-
|
74 |
-
def _generate_examples(self, filepath):
|
75 |
-
"""This function returns the examples in the raw (text) form."""
|
76 |
-
with open(filepath, encoding="utf-8") as f:
|
77 |
-
reader = csv.DictReader(f)
|
78 |
-
for idx, row in enumerate(reader):
|
79 |
-
yield idx, {
|
80 |
-
"text": row["text"],
|
81 |
-
"label": row["sentiment"],
|
82 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|