system HF staff commited on
Commit
a4b90e0
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.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
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"germeval_14": {"description": "The GermEval 2014 NER Shared Task builds on a new dataset with German Named Entity annotation with the following properties: - The data was sampled from German Wikipedia and News Corpora as a collection of citations. - The dataset covers over 31,000 sentences corresponding to over 590,000 tokens. - The NER annotation uses the NoSta-D guidelines, which extend the T\u00fcbingen Treebank guidelines, using four main NER categories with sub-structure, and annotating embeddings among NEs such as [ORG FC Kickers [LOC Darmstadt]].\n", "citation": "@inproceedings{benikova-etal-2014-nosta,\n title = {NoSta-D Named Entity Annotation for German: Guidelines and Dataset},\n author = {Benikova, Darina and\n Biemann, Chris and\n Reznicek, Marc},\n booktitle = {Proceedings of the Ninth International Conference on Language Resources and Evaluation ({LREC}'14)},\n month = {may},\n year = {2014},\n address = {Reykjavik, Iceland},\n publisher = {European Language Resources Association (ELRA)},\n url = {http://www.lrec-conf.org/proceedings/lrec2014/pdf/276_Paper.pdf},\n pages = {2524--2531},\n}\n", "homepage": "https://sites.google.com/site/germeval2014ner/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "source": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "labels": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "nested-labels": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "germ_eval14", "config_name": "germeval_14", "version": {"version_str": "2.0.0", "description": null, "datasets_version_to_prepare": null, "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 11305075, "num_examples": 24000, "dataset_name": "germ_eval14"}, "validation": {"name": "validation", "num_bytes": 1036186, "num_examples": 2200, "dataset_name": "germ_eval14"}, "test": {"name": "test", "num_bytes": 2407839, "num_examples": 5100, "dataset_name": "germ_eval14"}}, "download_checksums": {"https://drive.google.com/uc?export=download&id=1Jjhbal535VVz2ap4v4r_rN1UEHTdLK5P": {"num_bytes": 7882358, "checksum": "1e5a803d81f5fe6ade54700a7e8e9107a45edba80469d42e41a360550d1758e7"}, "https://drive.google.com/uc?export=download&id=1ZfRcQThdtAR5PPRjIDtrVP7BtXSCUBbm": {"num_bytes": 723876, "checksum": "d69d1347847e3ac0d1bfd14d7e5c0713dcb82899624301ced6df807dbb070056"}, "https://drive.google.com/uc?export=download&id=1u9mb7kNJHWQCWyweMDRMuTFoOHOfeBTH": {"num_bytes": 1682738, "checksum": "9405e49532379f3aee048851d116b35823d31c04e9521b87a9c4e6572c269097"}}, "download_size": 10288972, "post_processing_size": null, "dataset_size": 14749100, "size_in_bytes": 25038072}}
dummy/germeval_14/2.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43927bbe42ad2e816c846698795af3706e9f650b28e2e692024d9a03616c85f6
3
+ size 12583
germeval_14.py ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 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
+ """The GermEval 2014 NER Shared Task dataset."""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import csv
22
+ import logging
23
+
24
+ import datasets
25
+
26
+
27
+ _CITATION = """\
28
+ @inproceedings{benikova-etal-2014-nosta,
29
+ title = {NoSta-D Named Entity Annotation for German: Guidelines and Dataset},
30
+ author = {Benikova, Darina and
31
+ Biemann, Chris and
32
+ Reznicek, Marc},
33
+ booktitle = {Proceedings of the Ninth International Conference on Language Resources and Evaluation ({LREC}'14)},
34
+ month = {may},
35
+ year = {2014},
36
+ address = {Reykjavik, Iceland},
37
+ publisher = {European Language Resources Association (ELRA)},
38
+ url = {http://www.lrec-conf.org/proceedings/lrec2014/pdf/276_Paper.pdf},
39
+ pages = {2524--2531},
40
+ }
41
+ """
42
+
43
+ _DESCRIPTION = """\
44
+ The GermEval 2014 NER Shared Task builds on a new dataset with German Named Entity annotation with the following properties:\
45
+ - The data was sampled from German Wikipedia and News Corpora as a collection of citations.\
46
+ - The dataset covers over 31,000 sentences corresponding to over 590,000 tokens.\
47
+ - The NER annotation uses the NoSta-D guidelines, which extend the Tübingen Treebank guidelines,\
48
+ using four main NER categories with sub-structure, and annotating embeddings among NEs\
49
+ such as [ORG FC Kickers [LOC Darmstadt]].
50
+ """
51
+
52
+ _URLS = {
53
+ "train": "https://drive.google.com/uc?export=download&id=1Jjhbal535VVz2ap4v4r_rN1UEHTdLK5P",
54
+ "dev": "https://drive.google.com/uc?export=download&id=1ZfRcQThdtAR5PPRjIDtrVP7BtXSCUBbm",
55
+ "test": "https://drive.google.com/uc?export=download&id=1u9mb7kNJHWQCWyweMDRMuTFoOHOfeBTH",
56
+ }
57
+
58
+
59
+ class GermEval14Config(datasets.BuilderConfig):
60
+ """BuilderConfig for GermEval 2014."""
61
+
62
+ def __init__(self, **kwargs):
63
+ """BuilderConfig for GermEval 2014.
64
+
65
+ Args:
66
+ **kwargs: keyword arguments forwarded to super.
67
+ """
68
+ super(GermEval14Config, self).__init__(**kwargs)
69
+
70
+
71
+ class GermEval14(datasets.GeneratorBasedBuilder):
72
+ """GermEval 2014 NER Shared Task dataset."""
73
+
74
+ BUILDER_CONFIGS = [
75
+ GermEval14Config(
76
+ name="germeval_14", version=datasets.Version("2.0.0"), description="GermEval 2014 NER Shared Task dataset"
77
+ ),
78
+ ]
79
+
80
+ def _info(self):
81
+ return datasets.DatasetInfo(
82
+ description=_DESCRIPTION,
83
+ features=datasets.Features(
84
+ {
85
+ "id": datasets.Value("string"),
86
+ "source": datasets.Value("string"),
87
+ "tokens": datasets.Sequence(datasets.Value("string")),
88
+ "labels": datasets.Sequence(datasets.Value("string")),
89
+ "nested-labels": datasets.Sequence(datasets.Value("string")),
90
+ }
91
+ ),
92
+ supervised_keys=None,
93
+ homepage="https://sites.google.com/site/germeval2014ner/",
94
+ citation=_CITATION,
95
+ )
96
+
97
+ def _split_generators(self, dl_manager):
98
+ """Returns SplitGenerators."""
99
+ downloaded_files = dl_manager.download_and_extract(_URLS)
100
+
101
+ return [
102
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
103
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
104
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
105
+ ]
106
+
107
+ def _generate_examples(self, filepath):
108
+ logging.info("⏳ Generating examples from = %s", filepath)
109
+ with open(filepath, encoding="utf-8") as f:
110
+ data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
111
+ current_source = ""
112
+ current_tokens = []
113
+ current_labels = []
114
+ current_nested_labels = []
115
+ sentence_counter = 0
116
+ for row in data:
117
+ if row:
118
+ if row[0] == "#":
119
+ current_source = " ".join(row[1:])
120
+ continue
121
+ id_, token, label, nested_label = row[:4]
122
+ current_tokens.append(token)
123
+ current_labels.append(label)
124
+ current_nested_labels.append(nested_label)
125
+ else:
126
+ # New sentence
127
+ if not current_tokens:
128
+ # Consecutive empty lines will cause empty sentences
129
+ continue
130
+ assert len(current_tokens) == len(current_labels), "💔 between len of tokens & labels"
131
+ assert len(current_labels) == len(current_nested_labels), "💔 between len of labels & nested labels"
132
+ assert current_source, "💥 Source for new sentence was not set"
133
+ sentence = (
134
+ sentence_counter,
135
+ {
136
+ "id": str(sentence_counter),
137
+ "tokens": current_tokens,
138
+ "labels": current_labels,
139
+ "nested-labels": current_nested_labels,
140
+ "source": current_source,
141
+ },
142
+ )
143
+ sentence_counter += 1
144
+ current_tokens = []
145
+ current_labels = []
146
+ current_nested_labels = []
147
+ current_source = ""
148
+ yield sentence
149
+ # Don't forget last sentence in dataset 🧐
150
+ yield sentence_counter, {
151
+ "id": str(sentence_counter),
152
+ "tokens": current_tokens,
153
+ "labels": current_labels,
154
+ "nested-labels": current_nested_labels,
155
+ "source": current_source,
156
+ }