Commit
•
cb7fa03
1
Parent(s):
3f756ab
Convert dataset to Parquet (#4)
Browse files- Convert dataset to Parquet (c671344ae6d7bb6a45d5745a503e4a5baebc4be8)
- Delete loading script (bdd45d206343823a016721e750044ce246b171ef)
- README.md +16 -6
- dbrd.py +0 -112
- plain_text/test-00000-of-00001.parquet +3 -0
- plain_text/train-00000-of-00001.parquet +3 -0
- plain_text/unsupervised-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -24,6 +24,7 @@ task_ids:
|
|
24 |
paperswithcode_id: dbrd
|
25 |
pretty_name: DBRD
|
26 |
dataset_info:
|
|
|
27 |
features:
|
28 |
- name: text
|
29 |
dtype: string
|
@@ -33,19 +34,28 @@ dataset_info:
|
|
33 |
names:
|
34 |
'0': neg
|
35 |
'1': pos
|
36 |
-
config_name: plain_text
|
37 |
splits:
|
38 |
- name: train
|
39 |
-
num_bytes:
|
40 |
num_examples: 20028
|
41 |
- name: test
|
42 |
-
num_bytes:
|
43 |
num_examples: 2224
|
44 |
- name: unsupervised
|
45 |
-
num_bytes:
|
46 |
num_examples: 96264
|
47 |
-
download_size:
|
48 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
---
|
50 |
|
51 |
# Dataset Card for DBRD
|
|
|
24 |
paperswithcode_id: dbrd
|
25 |
pretty_name: DBRD
|
26 |
dataset_info:
|
27 |
+
config_name: plain_text
|
28 |
features:
|
29 |
- name: text
|
30 |
dtype: string
|
|
|
34 |
names:
|
35 |
'0': neg
|
36 |
'1': pos
|
|
|
37 |
splits:
|
38 |
- name: train
|
39 |
+
num_bytes: 29496321
|
40 |
num_examples: 20028
|
41 |
- name: test
|
42 |
+
num_bytes: 3246239
|
43 |
num_examples: 2224
|
44 |
- name: unsupervised
|
45 |
+
num_bytes: 152732991
|
46 |
num_examples: 96264
|
47 |
+
download_size: 116489037
|
48 |
+
dataset_size: 185475551
|
49 |
+
configs:
|
50 |
+
- config_name: plain_text
|
51 |
+
data_files:
|
52 |
+
- split: train
|
53 |
+
path: plain_text/train-*
|
54 |
+
- split: test
|
55 |
+
path: plain_text/test-*
|
56 |
+
- split: unsupervised
|
57 |
+
path: plain_text/unsupervised-*
|
58 |
+
default: true
|
59 |
---
|
60 |
|
61 |
# Dataset Card for DBRD
|
dbrd.py
DELETED
@@ -1,112 +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 |
-
"""Dutch Book Review Dataset"""
|
18 |
-
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
from datasets.tasks import TextClassification
|
22 |
-
|
23 |
-
|
24 |
-
_DESCRIPTION = """\
|
25 |
-
The Dutch Book Review Dataset (DBRD) contains over 110k book reviews of which \
|
26 |
-
22k have associated binary sentiment polarity labels. It is intended as a \
|
27 |
-
benchmark for sentiment classification in Dutch and created due to a lack of \
|
28 |
-
annotated datasets in Dutch that are suitable for this task.
|
29 |
-
"""
|
30 |
-
|
31 |
-
_CITATION = """\
|
32 |
-
@article{DBLP:journals/corr/abs-1910-00896,
|
33 |
-
author = {Benjamin van der Burgh and
|
34 |
-
Suzan Verberne},
|
35 |
-
title = {The merits of Universal Language Model Fine-tuning for Small Datasets
|
36 |
-
- a case with Dutch book reviews},
|
37 |
-
journal = {CoRR},
|
38 |
-
volume = {abs/1910.00896},
|
39 |
-
year = {2019},
|
40 |
-
url = {http://arxiv.org/abs/1910.00896},
|
41 |
-
archivePrefix = {arXiv},
|
42 |
-
eprint = {1910.00896},
|
43 |
-
timestamp = {Fri, 04 Oct 2019 12:28:06 +0200},
|
44 |
-
biburl = {https://dblp.org/rec/journals/corr/abs-1910-00896.bib},
|
45 |
-
bibsource = {dblp computer science bibliography, https://dblp.org}
|
46 |
-
}
|
47 |
-
"""
|
48 |
-
|
49 |
-
_DOWNLOAD_URL = "https://github.com/benjaminvdb/DBRD/releases/download/v3.0/DBRD_v3.tgz"
|
50 |
-
|
51 |
-
|
52 |
-
class DBRDConfig(datasets.BuilderConfig):
|
53 |
-
"""BuilderConfig for DBRD."""
|
54 |
-
|
55 |
-
def __init__(self, **kwargs):
|
56 |
-
"""BuilderConfig for DBRD.
|
57 |
-
|
58 |
-
Args:
|
59 |
-
**kwargs: keyword arguments forwarded to super.
|
60 |
-
"""
|
61 |
-
super(DBRDConfig, self).__init__(version=datasets.Version("3.0.0", ""), **kwargs)
|
62 |
-
|
63 |
-
|
64 |
-
class DBRD(datasets.GeneratorBasedBuilder):
|
65 |
-
"""Dutch Book Review Dataset."""
|
66 |
-
|
67 |
-
BUILDER_CONFIGS = [
|
68 |
-
DBRDConfig(
|
69 |
-
name="plain_text",
|
70 |
-
description="Plain text",
|
71 |
-
)
|
72 |
-
]
|
73 |
-
|
74 |
-
def _info(self):
|
75 |
-
return datasets.DatasetInfo(
|
76 |
-
description=_DESCRIPTION,
|
77 |
-
features=datasets.Features(
|
78 |
-
{"text": datasets.Value("string"), "label": datasets.features.ClassLabel(names=["neg", "pos"])}
|
79 |
-
),
|
80 |
-
supervised_keys=None,
|
81 |
-
homepage="https://github.com/benjaminvdb/DBRD",
|
82 |
-
citation=_CITATION,
|
83 |
-
task_templates=[TextClassification(text_column="text", label_column="label")],
|
84 |
-
)
|
85 |
-
|
86 |
-
def _split_generators(self, dl_manager):
|
87 |
-
archive = dl_manager.download(_DOWNLOAD_URL)
|
88 |
-
return [
|
89 |
-
datasets.SplitGenerator(
|
90 |
-
name=datasets.Split.TRAIN, gen_kwargs={"files": dl_manager.iter_archive(archive), "split": "train"}
|
91 |
-
),
|
92 |
-
datasets.SplitGenerator(
|
93 |
-
name=datasets.Split.TEST, gen_kwargs={"files": dl_manager.iter_archive(archive), "split": "test"}
|
94 |
-
),
|
95 |
-
datasets.SplitGenerator(
|
96 |
-
name=datasets.Split("unsupervised"),
|
97 |
-
gen_kwargs={"files": dl_manager.iter_archive(archive), "split": "unsup", "labeled": False},
|
98 |
-
),
|
99 |
-
]
|
100 |
-
|
101 |
-
def _generate_examples(self, files, split, labeled=True):
|
102 |
-
"""Generate DBRD examples."""
|
103 |
-
# For labeled examples, extract the label from the path.
|
104 |
-
if labeled:
|
105 |
-
for path, f in files:
|
106 |
-
if path.startswith(f"DBRD/{split}"):
|
107 |
-
label = {"pos": 1, "neg": 0}[path.split("/")[2]]
|
108 |
-
yield path, {"text": f.read().decode("utf-8"), "label": label}
|
109 |
-
else:
|
110 |
-
for path, f in files:
|
111 |
-
if path.startswith(f"DBRD/{split}"):
|
112 |
-
yield path, {"text": f.read().decode("utf-8"), "label": -1}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plain_text/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:28ec1d27ebcbdbd17b0724baa54afcb74c365d2bb0f08f05e3f21c249a5e8d8a
|
3 |
+
size 2057593
|
plain_text/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:61d360f0db2475f5e03070377347d41350579a8034fc6fda9d1999cacb9e313f
|
3 |
+
size 18558956
|
plain_text/unsupervised-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3865799b9b2a30c21a15d631106f6e3955c3040ed19288bd85c0d98f4b0b9eaf
|
3 |
+
size 95872488
|