Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
sentiment-classification
Languages:
Arabic
Size:
10K - 100K
Tags:
sarcasm-detection
License:
Convert dataset to Parquet
#4
by
albertvillanova
HF staff
- opened
- README.md +11 -4
- ar_sarcasm.py +0 -110
- data.zip → data/test-00000-of-00001.parquet +2 -2
- data/train-00000-of-00001.parquet +3 -0
- dataset_infos.json +0 -1
README.md
CHANGED
@@ -58,13 +58,20 @@ dataset_info:
|
|
58 |
dtype: string
|
59 |
splits:
|
60 |
- name: train
|
61 |
-
num_bytes:
|
62 |
num_examples: 8437
|
63 |
- name: test
|
64 |
-
num_bytes:
|
65 |
num_examples: 2110
|
66 |
-
download_size:
|
67 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
---
|
69 |
|
70 |
# Dataset Card for ArSarcasm
|
|
|
58 |
dtype: string
|
59 |
splits:
|
60 |
- name: train
|
61 |
+
num_bytes: 1829159
|
62 |
num_examples: 8437
|
63 |
- name: test
|
64 |
+
num_bytes: 458210
|
65 |
num_examples: 2110
|
66 |
+
download_size: 1180619
|
67 |
+
dataset_size: 2287369
|
68 |
+
configs:
|
69 |
+
- config_name: default
|
70 |
+
data_files:
|
71 |
+
- split: train
|
72 |
+
path: data/train-*
|
73 |
+
- split: test
|
74 |
+
path: data/test-*
|
75 |
---
|
76 |
|
77 |
# Dataset Card for ArSarcasm
|
ar_sarcasm.py
DELETED
@@ -1,110 +0,0 @@
|
|
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 |
-
|
16 |
-
|
17 |
-
import csv
|
18 |
-
import os
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
|
22 |
-
|
23 |
-
# no BibTeX citation
|
24 |
-
_CITATION = """@inproceedings{abu-farha-magdy-2020-arabic,
|
25 |
-
title = "From {A}rabic Sentiment Analysis to Sarcasm Detection: The {A}r{S}arcasm Dataset",
|
26 |
-
author = "Abu Farha, Ibrahim and Magdy, Walid",
|
27 |
-
booktitle = "Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection",
|
28 |
-
month = may,
|
29 |
-
year = "2020",
|
30 |
-
address = "Marseille, France",
|
31 |
-
publisher = "European Language Resource Association",
|
32 |
-
url = "https://www.aclweb.org/anthology/2020.osact-1.5",
|
33 |
-
pages = "32--39",
|
34 |
-
language = "English",
|
35 |
-
ISBN = "979-10-95546-51-1",
|
36 |
-
}"""
|
37 |
-
|
38 |
-
_DESCRIPTION = """\
|
39 |
-
ArSarcasm is a new Arabic sarcasm detection dataset.
|
40 |
-
The dataset was created using previously available Arabic sentiment analysis datasets (SemEval 2017 and ASTD)
|
41 |
-
and adds sarcasm and dialect labels to them. The dataset contains 10,547 tweets, 1,682 (16%) of which are sarcastic.
|
42 |
-
"""
|
43 |
-
|
44 |
-
_LICENSE = "MIT"
|
45 |
-
|
46 |
-
# From: https://github.com/iabufarha/ArSarcasm/archive/master.zip
|
47 |
-
_URLs = {
|
48 |
-
"default": "data.zip",
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
class ArSarcasm(datasets.GeneratorBasedBuilder):
|
53 |
-
VERSION = datasets.Version("1.0.0")
|
54 |
-
|
55 |
-
def _info(self):
|
56 |
-
features = datasets.Features(
|
57 |
-
{
|
58 |
-
"dialect": datasets.ClassLabel(names=["egypt", "gulf", "levant", "magreb", "msa"]),
|
59 |
-
"sarcasm": datasets.ClassLabel(names=["non-sarcastic", "sarcastic"]),
|
60 |
-
"sentiment": datasets.ClassLabel(names=["negative", "neutral", "positive"]),
|
61 |
-
"original_sentiment": datasets.ClassLabel(names=["negative", "neutral", "positive"]),
|
62 |
-
"tweet": datasets.Value("string"),
|
63 |
-
"source": datasets.Value("string"),
|
64 |
-
}
|
65 |
-
)
|
66 |
-
return datasets.DatasetInfo(
|
67 |
-
description=_DESCRIPTION,
|
68 |
-
features=features,
|
69 |
-
supervised_keys=None,
|
70 |
-
homepage="https://github.com/iabufarha/ArSarcasm",
|
71 |
-
license=_LICENSE,
|
72 |
-
citation=_CITATION,
|
73 |
-
)
|
74 |
-
|
75 |
-
def _split_generators(self, dl_manager):
|
76 |
-
my_urls = _URLs[self.config.name]
|
77 |
-
data_dir = dl_manager.download_and_extract(my_urls)
|
78 |
-
|
79 |
-
return [
|
80 |
-
datasets.SplitGenerator(
|
81 |
-
name=datasets.Split.TRAIN,
|
82 |
-
gen_kwargs={
|
83 |
-
"filepath": os.path.join(data_dir, "ArSarcasm-master", "dataset", "ArSarcasm_train.csv"),
|
84 |
-
},
|
85 |
-
),
|
86 |
-
datasets.SplitGenerator(
|
87 |
-
name=datasets.Split.TEST,
|
88 |
-
gen_kwargs={
|
89 |
-
"filepath": os.path.join(data_dir, "ArSarcasm-master", "dataset", "ArSarcasm_test.csv"),
|
90 |
-
},
|
91 |
-
),
|
92 |
-
]
|
93 |
-
|
94 |
-
def _generate_examples(self, filepath):
|
95 |
-
with open(filepath, encoding="utf-8") as f:
|
96 |
-
rdr = csv.reader(f, delimiter=",")
|
97 |
-
next(rdr)
|
98 |
-
for id_, row in enumerate(rdr):
|
99 |
-
if len(row) < 6:
|
100 |
-
continue
|
101 |
-
if row[4][0] == '"' and row[4][-1] == '"':
|
102 |
-
row[4] = row[4][1:-1]
|
103 |
-
yield id_, {
|
104 |
-
"dialect": row[0],
|
105 |
-
"sarcasm": "sarcastic" if row[1] == "True" else "non-sarcastic",
|
106 |
-
"sentiment": row[2],
|
107 |
-
"original_sentiment": row[3],
|
108 |
-
"tweet": row[4],
|
109 |
-
"source": row[5],
|
110 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.zip → data/test-00000-of-00001.parquet
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:cc52d603c68a4b886ffba5a1674a2dc34797449add6aa6ceb0ff1b38f4fef023
|
3 |
+
size 239166
|
data/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a1841c0864a1de32495e8040b409f5ffc1cdafffb27b117c7f716eba2db82c93
|
3 |
+
size 941453
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"default": {"description": "ArSarcasm is a new Arabic sarcasm detection dataset.\nThe dataset was created using previously available Arabic sentiment analysis datasets (SemEval 2017 and ASTD)\n and adds sarcasm and dialect labels to them. The dataset contains 10,547 tweets, 1,682 (16%) of which are sarcastic.\n", "citation": "@inproceedings{abu-farha-magdy-2020-arabic,\n title = \"From {A}rabic Sentiment Analysis to Sarcasm Detection: The {A}r{S}arcasm Dataset\",\n author = \"Abu Farha, Ibrahim and Magdy, Walid\",\n booktitle = \"Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection\",\n month = may,\n year = \"2020\",\n address = \"Marseille, France\",\n publisher = \"European Language Resource Association\",\n url = \"https://www.aclweb.org/anthology/2020.osact-1.5\",\n pages = \"32--39\",\n language = \"English\",\n ISBN = \"979-10-95546-51-1\",\n}", "homepage": "https://github.com/iabufarha/ArSarcasm", "license": "MIT", "features": {"dialect": {"num_classes": 5, "names": ["egypt", "gulf", "levant", "magreb", "msa"], "names_file": null, "id": null, "_type": "ClassLabel"}, "sarcasm": {"num_classes": 2, "names": ["non-sarcastic", "sarcastic"], "names_file": null, "id": null, "_type": "ClassLabel"}, "sentiment": {"num_classes": 3, "names": ["negative", "neutral", "positive"], "names_file": null, "id": null, "_type": "ClassLabel"}, "original_sentiment": {"num_classes": 3, "names": ["negative", "neutral", "positive"], "names_file": null, "id": null, "_type": "ClassLabel"}, "tweet": {"dtype": "string", "id": null, "_type": "Value"}, "source": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ar_sarcasm", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1829167, "num_examples": 8437, "dataset_name": "ar_sarcasm"}, "test": {"name": "test", "num_bytes": 458218, "num_examples": 2110, "dataset_name": "ar_sarcasm"}}, "download_checksums": {"https://github.com/iabufarha/ArSarcasm/archive/master.zip": {"num_bytes": 750717, "checksum": "a148877c4c933827d83b6e679880eeccf58b751c5ed5785f2f5a93aa950d0d41"}}, "download_size": 750717, "post_processing_size": null, "dataset_size": 2287385, "size_in_bytes": 3038102}}
|
|
|
|