Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
topic-classification
Languages:
German
Size:
10K - 100K
License:
Commit
·
17c3445
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 +150 -0
- dataset_infos.json +1 -0
- dummy/1.1.0/dummy_data.zip +3 -0
- gnad10.py +87 -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,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- de
|
8 |
+
licenses:
|
9 |
+
- cc-by-nc-sa-4-0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- extended|other-from-One-Million-Posts-Corpus
|
16 |
+
task_categories:
|
17 |
+
- text-classification
|
18 |
+
task_ids:
|
19 |
+
- topic-classification
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for 10k German News Articles Datasets
|
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-instances)
|
32 |
+
- [Data Splits](#data-instances)
|
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: [10k German News Article Dataset](https://tblock.github.io/10kGNAD/)**
|
50 |
+
- **Repository: [10k German News Article Dataset](https://github.com/tblock/10kGNAD)()**
|
51 |
+
- **Point of Contact: [Steven Liu](stevhliu@gmail.com)**
|
52 |
+
|
53 |
+
### Dataset Summary
|
54 |
+
|
55 |
+
The 10k German News Article Dataset consists of 10273 German language news articles from the online Austrian
|
56 |
+
newspaper website DER Standard. Each news article has been classified into one of 9 categories by professional
|
57 |
+
forum moderators employed by the newspaper. This dataset is extended from the original
|
58 |
+
[One Million Posts Corpus](https://ofai.github.io/million-post-corpus/). The dataset was created to support
|
59 |
+
topic classification in German because a classifier effective on a English dataset may not be as effective on
|
60 |
+
a German dataset due to higher inflections and longer compound words. Additionally, this dataset can be used
|
61 |
+
as a benchmark dataset for German topic classification.
|
62 |
+
|
63 |
+
### Supported Tasks and Leaderboards
|
64 |
+
|
65 |
+
This dataset can be used to train a model, like [BERT](https://huggingface.co/bert-base-uncased) for `topic classification` on German news articles. There are 9 possible categories.
|
66 |
+
|
67 |
+
### Languages
|
68 |
+
|
69 |
+
The text is in German and it comes from an online Austrian newspaper website. The BCP-47 code for German is
|
70 |
+
`de-DE`.
|
71 |
+
|
72 |
+
## Dataset Structure
|
73 |
+
|
74 |
+
### Data Instances
|
75 |
+
|
76 |
+
An example data instance contains a German news article (title and article are concatenated) and it's corresponding topic category.
|
77 |
+
|
78 |
+
```
|
79 |
+
{'text': ''Die Gewerkschaft GPA-djp lanciert den "All-in-Rechner" und findet, dass die Vertragsform auf die Führungsebene beschränkt gehört. Wien – Die Gewerkschaft GPA-djp sieht Handlungsbedarf bei sogenannten All-in-Verträgen.'
|
80 |
+
'label': 'Wirtschaft'
|
81 |
+
}
|
82 |
+
```
|
83 |
+
|
84 |
+
### Data Fields
|
85 |
+
|
86 |
+
* `text`: contains the title and content of the article
|
87 |
+
* `label`: can be one of 9 possible topic categories (`Web`, `Panorama`, `International`, `Wirtschaft`, `Sport`, `Inland`, `Etat`, `Wissenschaft`, `Kultur`)
|
88 |
+
|
89 |
+
### Data Splits
|
90 |
+
|
91 |
+
The data is split into a training set consisting of 9245 articles and a test set consisting of 1028 articles.
|
92 |
+
|
93 |
+
## Dataset Creation
|
94 |
+
|
95 |
+
### Curation Rationale
|
96 |
+
|
97 |
+
The dataset was created to support topic classification in the German language. English text classification datasets are common ([AG News](https://huggingface.co/datasets/ag_news) and [20 Newsgroup](https://huggingface.co/datasets/newsgroup)), but German datasets are less common. A classifier trained on an English dataset may not work as well on a set of German text due to grammatical differences. Thus there is a need for a German dataset for effectively assessing model performance.
|
98 |
+
|
99 |
+
### Source Data
|
100 |
+
|
101 |
+
#### Initial Data Collection and Normalization
|
102 |
+
|
103 |
+
The 10k German News Article Dataset is extended from the One Million Posts Corpus. 10273 German news articles were collected from this larger corpus. In the One Million Posts Corpus, each article has a topic path like
|
104 |
+
`Newsroom/Wirtschaft/Wirtschaftpolitik/Finanzmaerkte/Griechenlandkrise`. The 10kGNAD uses the second part of the topic path as the topic label. Article title and texts are concatenated into one text and author names are removed to avoid keyword classification on authors who write frequently on a particular topic.
|
105 |
+
|
106 |
+
#### Who are the source language producers?
|
107 |
+
|
108 |
+
The language producers are the authors of the Austrian newspaper website DER Standard.
|
109 |
+
|
110 |
+
### Annotations
|
111 |
+
|
112 |
+
#### Annotation process
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
#### Who are the annotators?
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
### Personal and Sensitive Information
|
121 |
+
|
122 |
+
[More Information Needed]
|
123 |
+
|
124 |
+
## Considerations for Using the Data
|
125 |
+
|
126 |
+
### Social Impact of Dataset
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
### Discussion of Biases
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
### Other Known Limitations
|
135 |
+
|
136 |
+
[More Information Needed]
|
137 |
+
|
138 |
+
## Additional Information
|
139 |
+
|
140 |
+
### Dataset Curators
|
141 |
+
|
142 |
+
This dataset was curated by Timo Block.
|
143 |
+
|
144 |
+
### Licensing Information
|
145 |
+
|
146 |
+
This dataset is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license.
|
147 |
+
|
148 |
+
### Citation Information
|
149 |
+
|
150 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "This dataset is intended to advance topic classification for German texts. A classifier that is efffective in\nEnglish may not be effective in German dataset because it has a higher inflection and longer compound words.\nThe 10kGNAD dataset contains 10273 German news articles from an Austrian online newspaper categorized into\n9 categories. Article titles and text are concatenated together and authors are removed to avoid a keyword-like\nclassification on authors that write frequently about one category. This dataset can be used as a benchmark\nfor German topic classification.\n", "citation": "", "homepage": "https://tblock.github.io/10kGNAD/", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 9, "names": ["Web", "Panorama", "International", "Wirtschaft", "Sport", "Inland", "Etat", "Wissenschaft", "Kultur"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "gnad10", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 24418224, "num_examples": 9245, "dataset_name": "gnad10"}, "test": {"name": "test", "num_bytes": 2756405, "num_examples": 1028, "dataset_name": "gnad10"}}, "download_checksums": {"https://raw.githubusercontent.com/tblock/10kGNAD/master/train.csv": {"num_bytes": 24405789, "checksum": "e0c0fa6ffd83e351173a800b3879f8a1a31a97058ec8615bed8becfc475cc607"}, "https://raw.githubusercontent.com/tblock/10kGNAD/master/test.csv": {"num_bytes": 2755020, "checksum": "68ba71a01919261f36b362b6a31e7fa34255dde102a5586db23d72eae2e41514"}}, "download_size": 27160809, "post_processing_size": null, "dataset_size": 27174629, "size_in_bytes": 54335438}}
|
dummy/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:21ac65c4337b49147ae0fc15597688189f1fc6993b8a092670d501ec8edec739
|
3 |
+
size 12193
|
gnad10.py
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""Ten Thousand German News Articles 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 dataset is intended to advance topic classification for German texts. A classifier that is efffective in
|
26 |
+
English may not be effective in German dataset because it has a higher inflection and longer compound words.
|
27 |
+
The 10kGNAD dataset contains 10273 German news articles from an Austrian online newspaper categorized into
|
28 |
+
9 categories. Article titles and text are concatenated together and authors are removed to avoid a keyword-like
|
29 |
+
classification on authors that write frequently about one category. This dataset can be used as a benchmark
|
30 |
+
for German topic classification.
|
31 |
+
"""
|
32 |
+
|
33 |
+
_HOMEPAGE = "https://tblock.github.io/10kGNAD/"
|
34 |
+
|
35 |
+
_LICENSE = "Creative Commons Attribution-NonCommercial-ShareAlike 4.0"
|
36 |
+
|
37 |
+
_TRAIN_DOWNLOAD_URL = "https://raw.githubusercontent.com/tblock/10kGNAD/master/train.csv"
|
38 |
+
_TEST_DOWNLOAD_URL = "https://raw.githubusercontent.com/tblock/10kGNAD/master/test.csv"
|
39 |
+
|
40 |
+
|
41 |
+
class Gnad10(datasets.GeneratorBasedBuilder):
|
42 |
+
"""10k German news articles for topic classification"""
|
43 |
+
|
44 |
+
VERSION = datasets.Version("1.1.0")
|
45 |
+
|
46 |
+
def _info(self):
|
47 |
+
return datasets.DatasetInfo(
|
48 |
+
description=_DESCRIPTION,
|
49 |
+
features=datasets.Features(
|
50 |
+
{
|
51 |
+
"text": datasets.Value("string"),
|
52 |
+
"label": datasets.features.ClassLabel(
|
53 |
+
names=[
|
54 |
+
"Web",
|
55 |
+
"Panorama",
|
56 |
+
"International",
|
57 |
+
"Wirtschaft",
|
58 |
+
"Sport",
|
59 |
+
"Inland",
|
60 |
+
"Etat",
|
61 |
+
"Wissenschaft",
|
62 |
+
"Kultur",
|
63 |
+
]
|
64 |
+
),
|
65 |
+
}
|
66 |
+
),
|
67 |
+
homepage="https://tblock.github.io/10kGNAD/",
|
68 |
+
)
|
69 |
+
|
70 |
+
def _split_generators(self, dl_manager):
|
71 |
+
"""Returns SplitGenerators."""
|
72 |
+
|
73 |
+
train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
|
74 |
+
test_path = dl_manager.download_and_extract(_TEST_DOWNLOAD_URL)
|
75 |
+
return [
|
76 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
|
77 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}),
|
78 |
+
]
|
79 |
+
|
80 |
+
def _generate_examples(self, filepath):
|
81 |
+
"""Generate German news articles examples. """
|
82 |
+
|
83 |
+
with open(filepath, encoding="utf-8") as csv_file:
|
84 |
+
csv_reader = csv.reader(csv_file, delimiter=";", quotechar="'", quoting=csv.QUOTE_ALL)
|
85 |
+
for id_, row in enumerate(csv_reader):
|
86 |
+
label, text = row
|
87 |
+
yield id_, {"text": text, "label": label}
|