Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Languages:
Korean
Size:
1K - 10K
Tags:
sarcasm-detection
License:
Commit
•
d570aaa
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +143 -0
- dataset_infos.json +1 -0
- dummy/1.1.0/dummy_data.zip +3 -0
- kor_sarcasm.py +76 -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,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- ko
|
8 |
+
licenses:
|
9 |
+
- mit
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 1K<n<10K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- text-classification
|
18 |
+
task_ids:
|
19 |
+
- text-classification-other-sarcasm-detection
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for Korean Sarcasm Detection
|
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-fields)
|
32 |
+
- [Data Splits](#data-splits)
|
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: [Korean Sarcasm Detection](https://github.com/SpellOnYou/korean-sarcasm)**
|
50 |
+
- **Repository: [Korean Sarcasm Detection](https://github.com/SpellOnYou/korean-sarcasm)**
|
51 |
+
- **Point of Contact: [Dionne Kim](jiwon.kim.096@gmail.com)**
|
52 |
+
|
53 |
+
### Dataset Summary
|
54 |
+
|
55 |
+
The Korean Sarcasm Dataset was created to detect sarcasm in text, which can significantly alter the original meaning of a sentence. 9319 tweets were collected from Twitter and labeled for `sarcasm` or `not_sarcasm`. These tweets were gathered by querying for: `역설, 아무말, 운수좋은날, 笑, 뭐래 아닙니다, 그럴리없다, 어그로, irony sarcastic, and sarcasm`. The dataset was pre-processed by removing the keyword hashtag, urls and mentions of the user to maintain anonymity.
|
56 |
+
|
57 |
+
### Supported Tasks and Leaderboards
|
58 |
+
|
59 |
+
* `sarcasm_detection`: The dataset can be used to train a model to detect sarcastic tweets. A [BERT](https://huggingface.co/bert-base-uncased) model can be presented with a tweet in Korean and be asked to determine whether it is sarcastic or not.
|
60 |
+
|
61 |
+
### Languages
|
62 |
+
|
63 |
+
The text in the dataset is in Korean and the associated is BCP-47 code is `ko-KR`.
|
64 |
+
|
65 |
+
## Dataset Structure
|
66 |
+
|
67 |
+
### Data Instances
|
68 |
+
|
69 |
+
An example data instance contains a Korean tweet and a label whether it is sarcastic or not. `1` maps to sarcasm and `0` maps to no sarcasm.
|
70 |
+
|
71 |
+
```
|
72 |
+
{
|
73 |
+
"tokens": "[ 수도권 노선 아이템 ] 17 . 신분당선의 #딸기 : 그의 이미지 컬러 혹은 머리 색에서 유래한 아이템이다 . #메트로라이프"
|
74 |
+
"label": 0
|
75 |
+
}
|
76 |
+
```
|
77 |
+
|
78 |
+
### Data Fields
|
79 |
+
|
80 |
+
* `tokens`: contains the text of the tweet
|
81 |
+
* `label`: determines whether the text is sarcastic (`1`: sarcasm, `0`: no sarcasm)
|
82 |
+
|
83 |
+
### Data Splits
|
84 |
+
|
85 |
+
The data is split into a training set comrpised of 9018 tweets and a test set of 301 tweets.
|
86 |
+
|
87 |
+
## Dataset Creation
|
88 |
+
|
89 |
+
### Curation Rationale
|
90 |
+
|
91 |
+
[More Information Needed]
|
92 |
+
|
93 |
+
### Source Data
|
94 |
+
|
95 |
+
#### Initial Data Collection and Normalization
|
96 |
+
|
97 |
+
The dataset was created by gathering HTML data from Twitter. Queries for hashtags that include sarcasm and variants of it were used to return tweets. It was preprocessed by removing the keyword hashtag, urls and mentions of the user to preserve anonymity.
|
98 |
+
|
99 |
+
#### Who are the source language producers?
|
100 |
+
|
101 |
+
The source language producers are Korean Twitter users.
|
102 |
+
|
103 |
+
### Annotations
|
104 |
+
|
105 |
+
#### Annotation process
|
106 |
+
|
107 |
+
Tweets were labeled `1` for sarcasm and `0` for no sarcasm.
|
108 |
+
|
109 |
+
#### Who are the annotators?
|
110 |
+
|
111 |
+
[More Information Needed]
|
112 |
+
|
113 |
+
### Personal and Sensitive Information
|
114 |
+
|
115 |
+
Mentions of the user in a tweet were removed to keep them anonymous.
|
116 |
+
|
117 |
+
## Considerations for Using the Data
|
118 |
+
|
119 |
+
### Social Impact of Dataset
|
120 |
+
|
121 |
+
[More Information Needed]
|
122 |
+
|
123 |
+
### Discussion of Biases
|
124 |
+
|
125 |
+
[More Information Needed]
|
126 |
+
|
127 |
+
### Other Known Limitations
|
128 |
+
|
129 |
+
[More Information Needed]
|
130 |
+
|
131 |
+
## Additional Information
|
132 |
+
|
133 |
+
### Dataset Curators
|
134 |
+
|
135 |
+
This dataset was curated by Dionne Kim.
|
136 |
+
|
137 |
+
### Licensing Information
|
138 |
+
|
139 |
+
This dataset is licensed under the MIT License.
|
140 |
+
|
141 |
+
### Citation Information
|
142 |
+
|
143 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "This is a dataset designed to detect sarcasm in Korean because it distorts the literal meaning of a sentence\nand is highly related to sentiment classification.\n", "citation": "", "homepage": "https://github.com/SpellOnYou/korean-sarcasm", "license": "MIT License", "features": {"tokens": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["no_sarcasm", "sarcasm"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "kor_sarcasm", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1012030, "num_examples": 9000, "dataset_name": "kor_sarcasm"}, "test": {"name": "test", "num_bytes": 32480, "num_examples": 301, "dataset_name": "kor_sarcasm"}}, "download_checksums": {"https://raw.githubusercontent.com/SpellOnYou/korean-sarcasm/master/data/jiwon/train.csv": {"num_bytes": 977993, "checksum": "af62a58789ae591733f81820fb3fc955bb0c6abdfc3bc1390c3293623bc5bfa4"}, "https://raw.githubusercontent.com/SpellOnYou/korean-sarcasm/master/data/jiwon/test.csv": {"num_bytes": 30962, "checksum": "e0879f7f86923eb5b46f0154e8eace0137224cbd021dfdb1d0d44427be16bda9"}}, "download_size": 1008955, "post_processing_size": null, "dataset_size": 1044510, "size_in_bytes": 2053465}}
|
dummy/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:72e6e6e75d0833631c11344673ceb8a39225c09188dccd4421eddfe4a262ddc7
|
3 |
+
size 1017
|
kor_sarcasm.py
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""Korean Sarcasm Detection Dataset"""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import csv
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_DESCRIPTION = """\
|
25 |
+
This is a dataset designed to detect sarcasm in Korean because it distorts the literal meaning of a sentence
|
26 |
+
and is highly related to sentiment classification.
|
27 |
+
"""
|
28 |
+
|
29 |
+
_HOMEPAGE = "https://github.com/SpellOnYou/korean-sarcasm"
|
30 |
+
|
31 |
+
_LICENSE = "MIT License"
|
32 |
+
|
33 |
+
_TRAIN_DOWNLOAD_URL = "https://raw.githubusercontent.com/SpellOnYou/korean-sarcasm/master/data/jiwon/train.csv"
|
34 |
+
_TEST_DOWNLOAD_URL = "https://raw.githubusercontent.com/SpellOnYou/korean-sarcasm/master/data/jiwon/test.csv"
|
35 |
+
|
36 |
+
|
37 |
+
class KorSarcasm(datasets.GeneratorBasedBuilder):
|
38 |
+
"""Korean Sarcasm Detection Dataset"""
|
39 |
+
|
40 |
+
VERSION = datasets.Version("1.1.0")
|
41 |
+
|
42 |
+
def _info(self):
|
43 |
+
|
44 |
+
return datasets.DatasetInfo(
|
45 |
+
description=_DESCRIPTION,
|
46 |
+
features=datasets.Features(
|
47 |
+
{
|
48 |
+
"tokens": datasets.Value("string"),
|
49 |
+
"label": datasets.features.ClassLabel(names=["no_sarcasm", "sarcasm"]),
|
50 |
+
}
|
51 |
+
),
|
52 |
+
supervised_keys=None,
|
53 |
+
homepage=_HOMEPAGE,
|
54 |
+
license=_LICENSE,
|
55 |
+
)
|
56 |
+
|
57 |
+
def _split_generators(self, dl_manager):
|
58 |
+
"""Returns SplitGenerators."""
|
59 |
+
|
60 |
+
train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
|
61 |
+
test_path = dl_manager.download_and_extract(_TEST_DOWNLOAD_URL)
|
62 |
+
return [
|
63 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
|
64 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}),
|
65 |
+
]
|
66 |
+
|
67 |
+
def _generate_examples(self, filepath):
|
68 |
+
"""Generate Korean sarcasm examples"""
|
69 |
+
|
70 |
+
with open(filepath, encoding="utf-8") as csv_file:
|
71 |
+
data = csv.reader(csv_file, delimiter=",")
|
72 |
+
next(data, None)
|
73 |
+
for id_, row in enumerate(data):
|
74 |
+
row = row[1:3]
|
75 |
+
tokens, label = row
|
76 |
+
yield id_, {"tokens": tokens, "label": int(label)}
|