Datasets:
data splits added
Browse files- README.md +20 -1
- snappfood-sentiment-analysis.py +0 -55
- Snappfood - Sentiment Analysis.csv → test.csv +2 -2
- train.csv +3 -0
- validation.csv +3 -0
README.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
1 |
---
|
2 |
+
dataset_info:
|
3 |
+
features:
|
4 |
+
- name: comment
|
5 |
+
dtype: string
|
6 |
+
- name: label
|
7 |
+
dtype: string
|
8 |
+
- name: label_id
|
9 |
+
dtype: float64
|
10 |
+
splits:
|
11 |
+
- name: train
|
12 |
+
num_bytes: 9448245
|
13 |
+
num_examples: 52110
|
14 |
+
- name: validation
|
15 |
+
num_bytes: 1499484
|
16 |
+
num_examples: 8337
|
17 |
+
- name: test
|
18 |
+
num_bytes: 1627356
|
19 |
+
num_examples: 9033
|
20 |
+
download_size: 11880991
|
21 |
+
dataset_size: 12575085
|
22 |
---
|
snappfood-sentiment-analysis.py
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
import csv
|
2 |
-
import datasets
|
3 |
-
|
4 |
-
_CITATION = ""
|
5 |
-
|
6 |
-
|
7 |
-
_DESCRIPTION = """ Snappfood sentiment analysis dataset"""
|
8 |
-
|
9 |
-
FILENAME = "Snappfood - Sentiment Analysis.csv"
|
10 |
-
|
11 |
-
class SnappfoodSentiment(datasets.GeneratorBasedBuilder):
|
12 |
-
BUILDER_CONFIGS = [
|
13 |
-
datasets.BuilderConfig(
|
14 |
-
name="snappfood_sentiment",
|
15 |
-
version=datasets.Version("1.0.0", ""),
|
16 |
-
description="snappfood sentiment analysis dataset",
|
17 |
-
)
|
18 |
-
]
|
19 |
-
|
20 |
-
def _info(self):
|
21 |
-
return datasets.DatasetInfo(
|
22 |
-
description=_DESCRIPTION,
|
23 |
-
features=datasets.Features(
|
24 |
-
{
|
25 |
-
"comment": datasets.Value("string"),
|
26 |
-
"label": datasets.Value("string"),
|
27 |
-
"label_id": datasets.Value("float64"),
|
28 |
-
}
|
29 |
-
),
|
30 |
-
# No default supervised_keys.
|
31 |
-
supervised_keys=None,
|
32 |
-
homepage="https://www.kaggle.com/datasets/soheiltehranipour/snappfood-persian-sentiment-analysis",
|
33 |
-
citation=_CITATION,
|
34 |
-
)
|
35 |
-
|
36 |
-
def _split_generators(self, dl_manager):
|
37 |
-
dl_dir = dl_manager.download_and_extract(FILENAME)
|
38 |
-
|
39 |
-
return [
|
40 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": dl_dir})
|
41 |
-
]
|
42 |
-
|
43 |
-
def _generate_examples(self, filepath):
|
44 |
-
"""This function returns the examples in the raw (text) form."""
|
45 |
-
try:
|
46 |
-
with open(filepath, encoding="utf-8") as f:
|
47 |
-
reader = csv.DictReader(f, delimiter="\t")
|
48 |
-
for idx, row in enumerate(reader):
|
49 |
-
yield idx, {
|
50 |
-
"comment": row["comment"],
|
51 |
-
"label": row["label"],
|
52 |
-
"label_id": row["label_id"],
|
53 |
-
}
|
54 |
-
except Exception as e:
|
55 |
-
print(e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Snappfood - Sentiment Analysis.csv → test.csv
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1358a285632d0d1a322054fa23837d8f883b96878b0d0b1447b15fb04b153eec
|
3 |
+
size 1537130
|
train.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:00a7254d74895d6860c2878fbb2942fffbac171d4ddf6aced109372c4edb50df
|
3 |
+
size 8927627
|
validation.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5a98e875d08e8a22db934904a3bf7a4bd21ab4208f074a0a590206b69c8a4d44
|
3 |
+
size 1416234
|