Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
sentiment-classification
Languages:
Thai
Size:
10K - 100K
License:
Commit
•
85a79ed
1
Parent(s):
14aa577
Convert dataset to Parquet (#4)
Browse files- Convert dataset to Parquet (dc9080a0da61ee9aecc3045a77fe778d159e831e)
- Delete loading script (27a383a3676384a9a60154169e6bd0cd9597feec)
Co-authored-by: Albert Villanova <[email protected]>
README.md
CHANGED
@@ -19,6 +19,7 @@ task_ids:
|
|
19 |
- sentiment-classification
|
20 |
pretty_name: WisesightSentiment
|
21 |
dataset_info:
|
|
|
22 |
features:
|
23 |
- name: texts
|
24 |
dtype: string
|
@@ -30,19 +31,28 @@ dataset_info:
|
|
30 |
'1': neu
|
31 |
'2': neg
|
32 |
'3': q
|
33 |
-
config_name: wisesight_sentiment
|
34 |
splits:
|
35 |
- name: train
|
36 |
-
num_bytes:
|
37 |
num_examples: 21628
|
38 |
- name: validation
|
39 |
-
num_bytes:
|
40 |
num_examples: 2404
|
41 |
- name: test
|
42 |
-
num_bytes:
|
43 |
num_examples: 2671
|
44 |
-
download_size:
|
45 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
train-eval-index:
|
47 |
- config: wisesight_sentiment
|
48 |
task: text-classification
|
|
|
19 |
- sentiment-classification
|
20 |
pretty_name: WisesightSentiment
|
21 |
dataset_info:
|
22 |
+
config_name: wisesight_sentiment
|
23 |
features:
|
24 |
- name: texts
|
25 |
dtype: string
|
|
|
31 |
'1': neu
|
32 |
'2': neg
|
33 |
'3': q
|
|
|
34 |
splits:
|
35 |
- name: train
|
36 |
+
num_bytes: 5328807
|
37 |
num_examples: 21628
|
38 |
- name: validation
|
39 |
+
num_bytes: 593566
|
40 |
num_examples: 2404
|
41 |
- name: test
|
42 |
+
num_bytes: 662133
|
43 |
num_examples: 2671
|
44 |
+
download_size: 3195627
|
45 |
+
dataset_size: 6584506
|
46 |
+
configs:
|
47 |
+
- config_name: wisesight_sentiment
|
48 |
+
data_files:
|
49 |
+
- split: train
|
50 |
+
path: wisesight_sentiment/train-*
|
51 |
+
- split: validation
|
52 |
+
path: wisesight_sentiment/validation-*
|
53 |
+
- split: test
|
54 |
+
path: wisesight_sentiment/test-*
|
55 |
+
default: true
|
56 |
train-eval-index:
|
57 |
- config: wisesight_sentiment
|
58 |
task: text-classification
|
wisesight_sentiment.py
DELETED
@@ -1,119 +0,0 @@
|
|
1 |
-
"""Wisesight Sentiment Corpus: Social media messages in Thai language with sentiment category (positive, neutral, negative, question)"""
|
2 |
-
|
3 |
-
|
4 |
-
import json
|
5 |
-
import os
|
6 |
-
|
7 |
-
import datasets
|
8 |
-
from datasets.tasks import TextClassification
|
9 |
-
|
10 |
-
|
11 |
-
_CITATION = """\
|
12 |
-
@software{bact_2019_3457447,
|
13 |
-
author = {Suriyawongkul, Arthit and
|
14 |
-
Chuangsuwanich, Ekapol and
|
15 |
-
Chormai, Pattarawat and
|
16 |
-
Polpanumas, Charin},
|
17 |
-
title = {PyThaiNLP/wisesight-sentiment: First release},
|
18 |
-
month = sep,
|
19 |
-
year = 2019,
|
20 |
-
publisher = {Zenodo},
|
21 |
-
version = {v1.0},
|
22 |
-
doi = {10.5281/zenodo.3457447},
|
23 |
-
url = {https://doi.org/10.5281/zenodo.3457447}
|
24 |
-
}
|
25 |
-
"""
|
26 |
-
|
27 |
-
_DESCRIPTION = """\
|
28 |
-
Wisesight Sentiment Corpus: Social media messages in Thai language with sentiment category (positive, neutral, negative, question)
|
29 |
-
* Released to public domain under Creative Commons Zero v1.0 Universal license.
|
30 |
-
* Category (Labels): {"pos": 0, "neu": 1, "neg": 2, "q": 3}
|
31 |
-
* Size: 26,737 messages
|
32 |
-
* Language: Central Thai
|
33 |
-
* Style: Informal and conversational. With some news headlines and advertisement.
|
34 |
-
* Time period: Around 2016 to early 2019. With small amount from other period.
|
35 |
-
* Domains: Mixed. Majority are consumer products and services (restaurants, cosmetics, drinks, car, hotels), with some current affairs.
|
36 |
-
* Privacy:
|
37 |
-
* Only messages that made available to the public on the internet (websites, blogs, social network sites).
|
38 |
-
* For Facebook, this means the public comments (everyone can see) that made on a public page.
|
39 |
-
* Private/protected messages and messages in groups, chat, and inbox are not included.
|
40 |
-
* Alternations and modifications:
|
41 |
-
* Keep in mind that this corpus does not statistically represent anything in the language register.
|
42 |
-
* Large amount of messages are not in their original form. Personal data are removed or masked.
|
43 |
-
* Duplicated, leading, and trailing whitespaces are removed. Other punctuations, symbols, and emojis are kept intact.
|
44 |
-
(Mis)spellings are kept intact.
|
45 |
-
* Messages longer than 2,000 characters are removed.
|
46 |
-
* Long non-Thai messages are removed. Duplicated message (exact match) are removed.
|
47 |
-
* More characteristics of the data can be explore: https://github.com/PyThaiNLP/wisesight-sentiment/blob/master/exploration.ipynb
|
48 |
-
"""
|
49 |
-
|
50 |
-
|
51 |
-
class WisesightSentimentConfig(datasets.BuilderConfig):
|
52 |
-
"""BuilderConfig for WisesightSentiment."""
|
53 |
-
|
54 |
-
def __init__(self, **kwargs):
|
55 |
-
"""BuilderConfig for WisesightSentiment.
|
56 |
-
|
57 |
-
Args:
|
58 |
-
**kwargs: keyword arguments forwarded to super.
|
59 |
-
"""
|
60 |
-
super(WisesightSentimentConfig, self).__init__(**kwargs)
|
61 |
-
|
62 |
-
|
63 |
-
class WisesightSentiment(datasets.GeneratorBasedBuilder):
|
64 |
-
"""Wisesight Sentiment Corpus: Social media messages in Thai language with sentiment category (positive, neutral, negative, question)"""
|
65 |
-
|
66 |
-
_DOWNLOAD_URL = "https://github.com/PyThaiNLP/wisesight-sentiment/raw/master/huggingface/data.zip"
|
67 |
-
_TRAIN_FILE = "train.jsonl"
|
68 |
-
_VAL_FILE = "valid.jsonl"
|
69 |
-
_TEST_FILE = "test.jsonl"
|
70 |
-
|
71 |
-
BUILDER_CONFIGS = [
|
72 |
-
WisesightSentimentConfig(
|
73 |
-
name="wisesight_sentiment",
|
74 |
-
version=datasets.Version("1.0.0"),
|
75 |
-
description="Wisesight Sentiment Corpus: Social media messages in Thai language with sentiment category (positive, neutral, negative, question)",
|
76 |
-
),
|
77 |
-
]
|
78 |
-
|
79 |
-
def _info(self):
|
80 |
-
return datasets.DatasetInfo(
|
81 |
-
description=_DESCRIPTION,
|
82 |
-
features=datasets.Features(
|
83 |
-
{
|
84 |
-
"texts": datasets.Value("string"),
|
85 |
-
"category": datasets.features.ClassLabel(names=["pos", "neu", "neg", "q"]),
|
86 |
-
}
|
87 |
-
),
|
88 |
-
supervised_keys=None,
|
89 |
-
homepage="https://github.com/PyThaiNLP/wisesight-sentiment",
|
90 |
-
citation=_CITATION,
|
91 |
-
task_templates=[TextClassification(text_column="texts", label_column="category")],
|
92 |
-
)
|
93 |
-
|
94 |
-
def _split_generators(self, dl_manager):
|
95 |
-
arch_path = dl_manager.download_and_extract(self._DOWNLOAD_URL)
|
96 |
-
data_dir = os.path.join(arch_path, "data")
|
97 |
-
return [
|
98 |
-
datasets.SplitGenerator(
|
99 |
-
name=datasets.Split.TRAIN,
|
100 |
-
gen_kwargs={"filepath": os.path.join(data_dir, self._TRAIN_FILE)},
|
101 |
-
),
|
102 |
-
datasets.SplitGenerator(
|
103 |
-
name=datasets.Split.VALIDATION,
|
104 |
-
gen_kwargs={"filepath": os.path.join(data_dir, self._VAL_FILE)},
|
105 |
-
),
|
106 |
-
datasets.SplitGenerator(
|
107 |
-
name=datasets.Split.TEST,
|
108 |
-
gen_kwargs={"filepath": os.path.join(data_dir, self._TEST_FILE)},
|
109 |
-
),
|
110 |
-
]
|
111 |
-
|
112 |
-
def _generate_examples(self, filepath):
|
113 |
-
"""Generate WisesightSentiment examples."""
|
114 |
-
with open(filepath, encoding="utf-8") as f:
|
115 |
-
for id_, row in enumerate(f):
|
116 |
-
data = json.loads(row)
|
117 |
-
texts = data["texts"]
|
118 |
-
category = data["category"]
|
119 |
-
yield id_, {"texts": texts, "category": category}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wisesight_sentiment/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bc7fd5d2d17d05e1b4f374c9c7748b80a923df6e1aa3be33b1e57ae98f04b054
|
3 |
+
size 326621
|
wisesight_sentiment/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:80d8a7ca8aafc845d5bd6eb6d348cc75d643c2647733e22e781cd5d8116c443d
|
3 |
+
size 2582961
|
wisesight_sentiment/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4392742837678ef3b77e2343b6ea13abda08e67820fb323931efda320b1141fa
|
3 |
+
size 286045
|