Datasets:
Commit
•
738ab93
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
- dane.py +283 -0
- dataset_infos.json +1 -0
- dummy/0.0.0/dummy_data.zip +3 -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 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- da
|
8 |
+
licenses:
|
9 |
+
- cc-by-sa-4-0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 1K<n<10K
|
14 |
+
source_datasets: []
|
15 |
+
task_categories:
|
16 |
+
- structure-prediction
|
17 |
+
task_ids:
|
18 |
+
- named-entity-recognition
|
19 |
+
---
|
20 |
+
|
21 |
+
# Dataset Card for [Dataset Name]
|
22 |
+
|
23 |
+
## Table of Contents
|
24 |
+
- [Dataset Description](#dataset-description)
|
25 |
+
- [Dataset Summary](#dataset-summary)
|
26 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
27 |
+
- [Languages](#languages)
|
28 |
+
- [Dataset Structure](#dataset-structure)
|
29 |
+
- [Data Instances](#data-instances)
|
30 |
+
- [Data Fields](#data-instances)
|
31 |
+
- [Data Splits](#data-instances)
|
32 |
+
- [Dataset Creation](#dataset-creation)
|
33 |
+
- [Curation Rationale](#curation-rationale)
|
34 |
+
- [Source Data](#source-data)
|
35 |
+
- [Annotations](#annotations)
|
36 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
37 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
38 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
39 |
+
- [Discussion of Biases](#discussion-of-biases)
|
40 |
+
- [Other Known Limitations](#other-known-limitations)
|
41 |
+
- [Additional Information](#additional-information)
|
42 |
+
- [Dataset Curators](#dataset-curators)
|
43 |
+
- [Licensing Information](#licensing-information)
|
44 |
+
- [Citation Information](#citation-information)
|
45 |
+
|
46 |
+
## Dataset Description
|
47 |
+
|
48 |
+
- **Homepage:** [Github](https://github.com/alexandrainst/danlp/blob/master/docs/docs/datasets.md#dane)
|
49 |
+
- **Repository:** [Github](https://github.com/alexandrainst/danlp)
|
50 |
+
- **Paper:** [Aclweb](https://www.aclweb.org/anthology/2020.lrec-1.565)
|
51 |
+
- **Leaderboard:**
|
52 |
+
- **Point of Contact:**
|
53 |
+
|
54 |
+
### Dataset Summary
|
55 |
+
|
56 |
+
[More Information Needed]
|
57 |
+
|
58 |
+
### Supported Tasks and Leaderboards
|
59 |
+
|
60 |
+
[More Information Needed]
|
61 |
+
|
62 |
+
### Languages
|
63 |
+
|
64 |
+
[More Information Needed]
|
65 |
+
|
66 |
+
## Dataset Structure
|
67 |
+
|
68 |
+
### Data Instances
|
69 |
+
|
70 |
+
[More Information Needed]
|
71 |
+
|
72 |
+
### Data Fields
|
73 |
+
|
74 |
+
Data Fields:
|
75 |
+
- q_id: a string question identifier for each example, corresponding to its ID in the Pushshift.io Reddit submission dumps.
|
76 |
+
- subreddit: One of explainlikeimfive, askscience, or AskHistorians, indicating which subreddit the question came from
|
77 |
+
- title: title of the question, with URLs extracted and replaced by URL_n tokens
|
78 |
+
- title_urls: list of the extracted URLs, the nth element of the list was replaced by URL_n
|
79 |
+
- sent_id: a string identifier for each example
|
80 |
+
- text: a string, the original sentence (not tokenized)
|
81 |
+
- tok_ids: a list of ids (int), one for each token
|
82 |
+
- tokens: a list of strings, the tokens
|
83 |
+
- lemmas: a list of strings, the lemmas of the tokens
|
84 |
+
- pos_tags: a list of strings, the part-of-speech tags of the tokens
|
85 |
+
- morph_tags: a list of strings, the morphological tags of the tokens
|
86 |
+
- dep_ids: a list of ids (int), the id of the head of the incoming dependency for each token
|
87 |
+
- dep_labels: a list of strings, the dependency labels
|
88 |
+
- ner_tags: a list of strings, the named entity tags (BIO format)
|
89 |
+
|
90 |
+
### Data Splits
|
91 |
+
|
92 |
+
[More Information Needed]
|
93 |
+
|
94 |
+
## Dataset Creation
|
95 |
+
|
96 |
+
### Curation Rationale
|
97 |
+
|
98 |
+
[More Information Needed]
|
99 |
+
|
100 |
+
### Source Data
|
101 |
+
|
102 |
+
#### Initial Data Collection and Normalization
|
103 |
+
|
104 |
+
[More Information Needed]
|
105 |
+
|
106 |
+
#### Who are the source language producers?
|
107 |
+
|
108 |
+
[More Information Needed]
|
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 |
+
[More Information Needed]
|
143 |
+
|
144 |
+
### Licensing Information
|
145 |
+
|
146 |
+
[More Information Needed]
|
147 |
+
|
148 |
+
### Citation Information
|
149 |
+
|
150 |
+
[More Information Needed]
|
dane.py
ADDED
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""DaNE: named entity annotation for the Danish Universal Dependencies
|
16 |
+
treebank using the CoNLL-2003 annotation scheme."""
|
17 |
+
|
18 |
+
from __future__ import absolute_import, division, print_function
|
19 |
+
|
20 |
+
import os
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
|
24 |
+
|
25 |
+
_CITATION = """\
|
26 |
+
@inproceedings{hvingelby-etal-2020-dane,
|
27 |
+
title = "{D}a{NE}: A Named Entity Resource for {D}anish",
|
28 |
+
author = "Hvingelby, Rasmus and
|
29 |
+
Pauli, Amalie Brogaard and
|
30 |
+
Barrett, Maria and
|
31 |
+
Rosted, Christina and
|
32 |
+
Lidegaard, Lasse Malm and
|
33 |
+
Søgaard, Anders",
|
34 |
+
booktitle = "Proceedings of the 12th Language Resources and Evaluation Conference",
|
35 |
+
month = may,
|
36 |
+
year = "2020",
|
37 |
+
address = "Marseille, France",
|
38 |
+
publisher = "European Language Resources Association",
|
39 |
+
url = "https://www.aclweb.org/anthology/2020.lrec-1.565",
|
40 |
+
pages = "4597--4604",
|
41 |
+
abstract = "We present a named entity annotation for the Danish Universal Dependencies treebank using the CoNLL-2003 annotation scheme: DaNE. It is the largest publicly available, Danish named entity gold annotation. We evaluate the quality of our annotations intrinsically by double annotating the entire treebank and extrinsically by comparing our annotations to a recently released named entity annotation of the validation and test sections of the Danish Universal Dependencies treebank. We benchmark the new resource by training and evaluating competitive architectures for supervised named entity recognition (NER), including FLAIR, monolingual (Danish) BERT and multilingual BERT. We explore cross-lingual transfer in multilingual BERT from five related languages in zero-shot and direct transfer setups, and we show that even with our modestly-sized training set, we improve Danish NER over a recent cross-lingual approach, as well as over zero-shot transfer from five related languages. Using multilingual BERT, we achieve higher performance by fine-tuning on both DaNE and a larger Bokm{\aa}l (Norwegian) training set compared to only using DaNE. However, the highest performance isachieved by using a Danish BERT fine-tuned on DaNE. Our dataset enables improvements and applicability for Danish NER beyond cross-lingual methods. We employ a thorough error analysis of the predictions of the best models for seen and unseen entities, as well as their robustness on un-capitalized text. The annotated dataset and all the trained models are made publicly available.",
|
42 |
+
language = "English",
|
43 |
+
ISBN = "979-10-95546-34-4",
|
44 |
+
}
|
45 |
+
"""
|
46 |
+
|
47 |
+
_DESCRIPTION = """\
|
48 |
+
The DaNE dataset has been annotated with Named Entities for PER, ORG and LOC
|
49 |
+
by the Alexandra Institute.
|
50 |
+
It is a reannotation of the UD-DDT (Universal Dependency - Danish Dependency Treebank)
|
51 |
+
which has annotations for dependency parsing and part-of-speech (POS) tagging.
|
52 |
+
The Danish UD treebank (Johannsen et al., 2015, UD-DDT) is a conversion of
|
53 |
+
the Danish Dependency Treebank (Buch-Kromann et al. 2003) based on texts
|
54 |
+
from Parole (Britt, 1998).
|
55 |
+
"""
|
56 |
+
|
57 |
+
_HOMEPAGE = "https://github.com/alexandrainst/danlp/blob/master/docs/docs/datasets.md#dane"
|
58 |
+
|
59 |
+
_LICENSE = "CC BY-SA 4.0"
|
60 |
+
|
61 |
+
# The HuggingFace dataset library don't host the datasets but only point to the original files
|
62 |
+
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
63 |
+
_URL = "https://danlp.alexandra.dk/304bd159d5de/datasets/ddt.zip"
|
64 |
+
|
65 |
+
|
66 |
+
class Dane(datasets.GeneratorBasedBuilder):
|
67 |
+
"""DaNE dataset"""
|
68 |
+
|
69 |
+
def _info(self):
|
70 |
+
features = datasets.Features(
|
71 |
+
{
|
72 |
+
"sent_id": datasets.Value("string"),
|
73 |
+
"text": datasets.Value("string"),
|
74 |
+
"tok_ids": datasets.Sequence(datasets.Value("int64")),
|
75 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
76 |
+
"lemmas": datasets.Sequence(datasets.Value("string")),
|
77 |
+
"pos_tags": datasets.Sequence(
|
78 |
+
datasets.features.ClassLabel(
|
79 |
+
names=[
|
80 |
+
"NUM",
|
81 |
+
"CCONJ",
|
82 |
+
"PRON",
|
83 |
+
"VERB",
|
84 |
+
"INTJ",
|
85 |
+
"AUX",
|
86 |
+
"ADJ",
|
87 |
+
"PROPN",
|
88 |
+
"PART",
|
89 |
+
"ADV",
|
90 |
+
"PUNCT",
|
91 |
+
"ADP",
|
92 |
+
"NOUN",
|
93 |
+
"X",
|
94 |
+
"DET",
|
95 |
+
"SYM",
|
96 |
+
"SCONJ",
|
97 |
+
]
|
98 |
+
)
|
99 |
+
),
|
100 |
+
"morph_tags": datasets.Sequence(datasets.Value("string")),
|
101 |
+
"dep_ids": datasets.Sequence(datasets.Value("int64")),
|
102 |
+
"dep_labels": datasets.Sequence(
|
103 |
+
datasets.ClassLabel(
|
104 |
+
names=[
|
105 |
+
"parataxis",
|
106 |
+
"mark",
|
107 |
+
"nummod",
|
108 |
+
"discourse",
|
109 |
+
"compound:prt",
|
110 |
+
"reparandum",
|
111 |
+
"vocative",
|
112 |
+
"list",
|
113 |
+
"obj",
|
114 |
+
"dep",
|
115 |
+
"det",
|
116 |
+
"obl:loc",
|
117 |
+
"flat",
|
118 |
+
"iobj",
|
119 |
+
"cop",
|
120 |
+
"expl",
|
121 |
+
"obl",
|
122 |
+
"conj",
|
123 |
+
"nmod",
|
124 |
+
"root",
|
125 |
+
"acl:relcl",
|
126 |
+
"goeswith",
|
127 |
+
"appos",
|
128 |
+
"fixed",
|
129 |
+
"obl:tmod",
|
130 |
+
"xcomp",
|
131 |
+
"advmod",
|
132 |
+
"nmod:poss",
|
133 |
+
"aux",
|
134 |
+
"ccomp",
|
135 |
+
"amod",
|
136 |
+
"cc",
|
137 |
+
"advcl",
|
138 |
+
"nsubj",
|
139 |
+
"punct",
|
140 |
+
"case",
|
141 |
+
]
|
142 |
+
)
|
143 |
+
),
|
144 |
+
"ner_tags": datasets.Sequence(
|
145 |
+
datasets.features.ClassLabel(
|
146 |
+
names=[
|
147 |
+
"O",
|
148 |
+
"B-PER",
|
149 |
+
"I-PER",
|
150 |
+
"B-ORG",
|
151 |
+
"I-ORG",
|
152 |
+
"B-LOC",
|
153 |
+
"I-LOC",
|
154 |
+
"B-MISC",
|
155 |
+
"I-MISC",
|
156 |
+
]
|
157 |
+
)
|
158 |
+
),
|
159 |
+
}
|
160 |
+
)
|
161 |
+
|
162 |
+
return datasets.DatasetInfo(
|
163 |
+
# This is the description that will appear on the datasets page.
|
164 |
+
description=_DESCRIPTION,
|
165 |
+
# This defines the different columns of the dataset and their types
|
166 |
+
features=features, # Here we define them above because they are different between the two configurations
|
167 |
+
# If there's a common (input, target) tuple from the features,
|
168 |
+
# specify them here. They'll be used if as_supervised=True in
|
169 |
+
# builder.as_dataset.
|
170 |
+
supervised_keys=None,
|
171 |
+
# Homepage of the dataset for documentation
|
172 |
+
homepage=_HOMEPAGE,
|
173 |
+
# License for the dataset if available
|
174 |
+
license=_LICENSE,
|
175 |
+
# Citation for the dataset
|
176 |
+
citation=_CITATION,
|
177 |
+
)
|
178 |
+
|
179 |
+
def _split_generators(self, dl_manager):
|
180 |
+
"""Returns SplitGenerators."""
|
181 |
+
# TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
|
182 |
+
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
183 |
+
|
184 |
+
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
|
185 |
+
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
186 |
+
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
187 |
+
data_dir = dl_manager.download_and_extract(_URL)
|
188 |
+
return [
|
189 |
+
datasets.SplitGenerator(
|
190 |
+
name=datasets.Split.TRAIN,
|
191 |
+
# These kwargs will be passed to _generate_examples
|
192 |
+
gen_kwargs={
|
193 |
+
"filepath": os.path.join(data_dir, "ddt.train.conllu"),
|
194 |
+
"split": "train",
|
195 |
+
},
|
196 |
+
),
|
197 |
+
datasets.SplitGenerator(
|
198 |
+
name=datasets.Split.TEST,
|
199 |
+
# These kwargs will be passed to _generate_examples
|
200 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "ddt.test.conllu"), "split": "test"},
|
201 |
+
),
|
202 |
+
datasets.SplitGenerator(
|
203 |
+
name=datasets.Split.VALIDATION,
|
204 |
+
# These kwargs will be passed to _generate_examples
|
205 |
+
gen_kwargs={
|
206 |
+
"filepath": os.path.join(data_dir, "ddt.dev.conllu"),
|
207 |
+
"split": "dev",
|
208 |
+
},
|
209 |
+
),
|
210 |
+
]
|
211 |
+
|
212 |
+
def _generate_examples(self, filepath, split):
|
213 |
+
""" Yields examples. """
|
214 |
+
|
215 |
+
with open(filepath, encoding="utf-8") as f:
|
216 |
+
guid = 0
|
217 |
+
sent_id = ""
|
218 |
+
text = ""
|
219 |
+
tok_ids = []
|
220 |
+
tokens = []
|
221 |
+
lemmas = []
|
222 |
+
pos_tags = []
|
223 |
+
morph_tags = []
|
224 |
+
dephead_ids = []
|
225 |
+
dep_labels = []
|
226 |
+
ner_tags = []
|
227 |
+
for line in f:
|
228 |
+
if line.startswith("#"):
|
229 |
+
var, val = line.split(" = ", maxsplit=1)
|
230 |
+
var = var.replace("# ", "")
|
231 |
+
if var == "sent_id":
|
232 |
+
sent_id = val
|
233 |
+
elif var == "text":
|
234 |
+
text = val
|
235 |
+
elif line == "" or line == "\n":
|
236 |
+
if tokens:
|
237 |
+
yield guid, {
|
238 |
+
"sent_id": sent_id,
|
239 |
+
"text": text,
|
240 |
+
"tok_ids": tok_ids,
|
241 |
+
"tokens": tokens,
|
242 |
+
"lemmas": lemmas,
|
243 |
+
"pos_tags": pos_tags,
|
244 |
+
"morph_tags": morph_tags,
|
245 |
+
"dep_ids": dephead_ids,
|
246 |
+
"dep_labels": dep_labels,
|
247 |
+
"ner_tags": ner_tags,
|
248 |
+
}
|
249 |
+
guid += 1
|
250 |
+
sent_id = ""
|
251 |
+
text = ""
|
252 |
+
tok_ids = []
|
253 |
+
tokens = []
|
254 |
+
lemmas = []
|
255 |
+
pos_tags = []
|
256 |
+
morph_tags = []
|
257 |
+
dephead_ids = []
|
258 |
+
dep_labels = []
|
259 |
+
ner_tags = []
|
260 |
+
else:
|
261 |
+
# conllu tokens tab space separated
|
262 |
+
splits = line.split("\t")
|
263 |
+
tok_ids.append(int(splits[0]))
|
264 |
+
tokens.append(splits[1])
|
265 |
+
lemmas.append(splits[2])
|
266 |
+
pos_tags.append(splits[3])
|
267 |
+
morph_tags.append(splits[5])
|
268 |
+
dephead_ids.append(splits[6])
|
269 |
+
dep_labels.append(splits[7])
|
270 |
+
ner_tags.append(splits[9].rstrip().replace("name=", "").split("|")[0])
|
271 |
+
# last example
|
272 |
+
yield guid, {
|
273 |
+
"sent_id": sent_id,
|
274 |
+
"text": text,
|
275 |
+
"tok_ids": tok_ids,
|
276 |
+
"tokens": tokens,
|
277 |
+
"lemmas": lemmas,
|
278 |
+
"pos_tags": pos_tags,
|
279 |
+
"morph_tags": morph_tags,
|
280 |
+
"dep_ids": dephead_ids,
|
281 |
+
"dep_labels": dep_labels,
|
282 |
+
"ner_tags": ner_tags,
|
283 |
+
}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "The DaNE dataset has been annotated with Named Entities for PER, ORG and LOC\nby the Alexandra Institute.\nIt is a reannotation of the UD-DDT (Universal Dependency - Danish Dependency Treebank)\nwhich has annotations for dependency parsing and part-of-speech (POS) tagging.\nThe Danish UD treebank (Johannsen et al., 2015, UD-DDT) is a conversion of\nthe Danish Dependency Treebank (Buch-Kromann et al. 2003) based on texts\nfrom Parole (Britt, 1998).\n", "citation": "@inproceedings{hvingelby-etal-2020-dane,\n title = \"{D}a{NE}: A Named Entity Resource for {D}anish\",\n author = \"Hvingelby, Rasmus and\n Pauli, Amalie Brogaard and\n Barrett, Maria and\n Rosted, Christina and\n Lidegaard, Lasse Malm and\n S\u00f8gaard, Anders\",\n booktitle = \"Proceedings of the 12th Language Resources and Evaluation Conference\",\n month = may,\n year = \"2020\",\n address = \"Marseille, France\",\n publisher = \"European Language Resources Association\",\n url = \"https://www.aclweb.org/anthology/2020.lrec-1.565\",\n pages = \"4597--4604\",\n abstract = \"We present a named entity annotation for the Danish Universal Dependencies treebank using the CoNLL-2003 annotation scheme: DaNE. It is the largest publicly available, Danish named entity gold annotation. We evaluate the quality of our annotations intrinsically by double annotating the entire treebank and extrinsically by comparing our annotations to a recently released named entity annotation of the validation and test sections of the Danish Universal Dependencies treebank. We benchmark the new resource by training and evaluating competitive architectures for supervised named entity recognition (NER), including FLAIR, monolingual (Danish) BERT and multilingual BERT. We explore cross-lingual transfer in multilingual BERT from five related languages in zero-shot and direct transfer setups, and we show that even with our modestly-sized training set, we improve Danish NER over a recent cross-lingual approach, as well as over zero-shot transfer from five related languages. Using multilingual BERT, we achieve higher performance by fine-tuning on both DaNE and a larger Bokm{\u0007a}l (Norwegian) training set compared to only using DaNE. However, the highest performance isachieved by using a Danish BERT fine-tuned on DaNE. Our dataset enables improvements and applicability for Danish NER beyond cross-lingual methods. We employ a thorough error analysis of the predictions of the best models for seen and unseen entities, as well as their robustness on un-capitalized text. The annotated dataset and all the trained models are made publicly available.\",\n language = \"English\",\n ISBN = \"979-10-95546-34-4\",\n}\n", "homepage": "https://github.com/alexandrainst/danlp/blob/master/docs/docs/datasets.md#dane", "license": "CC BY-SA 4.0", "features": {"sent_id": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "tok_ids": {"feature": {"dtype": "int64", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "lemmas": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"num_classes": 17, "names": ["NUM", "CCONJ", "PRON", "VERB", "INTJ", "AUX", "ADJ", "PROPN", "PART", "ADV", "PUNCT", "ADP", "NOUN", "X", "DET", "SYM", "SCONJ"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}, "morph_tags": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "dep_ids": {"feature": {"dtype": "int64", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "dep_labels": {"feature": {"num_classes": 36, "names": ["parataxis", "mark", "nummod", "discourse", "compound:prt", "reparandum", "vocative", "list", "obj", "dep", "det", "obl:loc", "flat", "iobj", "cop", "expl", "obl", "conj", "nmod", "root", "acl:relcl", "goeswith", "appos", "fixed", "obl:tmod", "xcomp", "advmod", "nmod:poss", "aux", "ccomp", "amod", "cc", "advcl", "nsubj", "punct", "case"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}, "ner_tags": {"feature": {"num_classes": 9, "names": ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "dane", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7311252, "num_examples": 4384, "dataset_name": "dane"}, "test": {"name": "test", "num_bytes": 909739, "num_examples": 566, "dataset_name": "dane"}, "validation": {"name": "validation", "num_bytes": 940453, "num_examples": 565, "dataset_name": "dane"}}, "download_checksums": {"https://danlp.alexandra.dk/304bd159d5de/datasets/ddt.zip": {"num_bytes": 1209710, "checksum": "df97f3eaa396fd52bf35060c63960aebefaa47e5e6125fb75fe3be098384ebd2"}}, "download_size": 1209710, "post_processing_size": null, "dataset_size": 9161444, "size_in_bytes": 10371154}}
|
dummy/0.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2728398104f34c673650609096893af36809edd933dbdf53ebf3119a516bba84
|
3 |
+
size 1333
|