Datasets:
Commit
•
9a76195
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 +208 -0
- conll2002.py +227 -0
- dataset_infos.json +1 -0
- dummy/es/1.0.0/dummy_data.zip +3 -0
- dummy/nl/1.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,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
es:
|
8 |
+
- es
|
9 |
+
nl:
|
10 |
+
- nl
|
11 |
+
licenses:
|
12 |
+
- unknown
|
13 |
+
multilinguality:
|
14 |
+
- multilingual
|
15 |
+
size_categories:
|
16 |
+
- 10K<n<100K
|
17 |
+
source_datasets:
|
18 |
+
- original
|
19 |
+
task_categories:
|
20 |
+
- structure-prediction
|
21 |
+
task_ids:
|
22 |
+
- named-entity-recognition
|
23 |
+
- parsing
|
24 |
+
---
|
25 |
+
|
26 |
+
# Dataset Card Creation Guide
|
27 |
+
|
28 |
+
## Table of Contents
|
29 |
+
- [Dataset Description](#dataset-description)
|
30 |
+
- [Dataset Summary](#dataset-summary)
|
31 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
32 |
+
- [Languages](#languages)
|
33 |
+
- [Dataset Structure](#dataset-structure)
|
34 |
+
- [Data Instances](#data-instances)
|
35 |
+
- [Data Fields](#data-instances)
|
36 |
+
- [Data Splits](#data-instances)
|
37 |
+
- [Dataset Creation](#dataset-creation)
|
38 |
+
- [Curation Rationale](#curation-rationale)
|
39 |
+
- [Source Data](#source-data)
|
40 |
+
- [Annotations](#annotations)
|
41 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
42 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
43 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
44 |
+
- [Discussion of Biases](#discussion-of-biases)
|
45 |
+
- [Other Known Limitations](#other-known-limitations)
|
46 |
+
- [Additional Information](#additional-information)
|
47 |
+
- [Dataset Curators](#dataset-curators)
|
48 |
+
- [Licensing Information](#licensing-information)
|
49 |
+
- [Citation Information](#citation-information)
|
50 |
+
|
51 |
+
## Dataset Description
|
52 |
+
|
53 |
+
- **Homepage:** [homepage](https://www.clips.uantwerpen.be/conll2002/ner/)
|
54 |
+
- **Repository:** [github](https://github.com/teropa/nlp/tree/master/resources/corpora/conll2002)
|
55 |
+
- **Paper:** [paper](https://www.aclweb.org/anthology/W02-2024/)
|
56 |
+
- **Point of Contact:** erikt@uia.ua.ac.be
|
57 |
+
|
58 |
+
### Dataset Summary
|
59 |
+
|
60 |
+
Named entities are phrases that contain the names of persons, organizations, locations, times and quantities. Example:
|
61 |
+
|
62 |
+
[PER Wolff] , currently a journalist in [LOC Argentina] , played with [PER Del Bosque] in the final years of the seventies in [ORG Real Madrid] .
|
63 |
+
|
64 |
+
The shared task of CoNLL-2002 concerns language-independent named entity recognition. We will concentrate on four types of named entities: persons, locations, organizations and names of miscellaneous entities that do not belong to the previous three groups. The participants of the shared task will be offered training and test data for at least two languages. They will use the data for developing a named-entity recognition system that includes a machine learning component. Information sources other than the training data may be used in this shared task. We are especially interested in methods that can use additional unannotated data for improving their performance (for example co-training).
|
65 |
+
|
66 |
+
### Supported Tasks and Leaderboards
|
67 |
+
|
68 |
+
Named Entity Recognition (NER) is a subtask of Information Extraction. Different NER systems were evaluated as a part of the Sixth Message Understanding Conference in 1995 (MUC6). The target language was English. The participating systems performed well. However, many of them used language-specific resources for performing the task and it is unknown how they would have performed on another language than English.
|
69 |
+
|
70 |
+
After 1995 NER systems have been developed for some European languages and a few Asian languages. There have been at least two studies that have applied one NER system to different languages. Palmer and Day [PD97] have used statistical methods for finding named entities in newswire articles in Chinese, English, French, Japanese, Portuguese and Spanish. They found that the difficulty of the NER task was different for the six languages but that a large part of the task could be performed with simple methods. Cucerzan and Yarowsky [CY99] used both morphological and contextual clues for identifying named entities in English, Greek, Hindi, Rumanian and Turkish. With minimal supervision, they obtained overall F measures between 40 and 70, depending on the languages used.
|
71 |
+
|
72 |
+
- `named-entity-recognition`: The performance in this task is measured with [F1](https://huggingface.co/metrics/f1) (higher is better). A named entity is correct only if it is an exact match of the corresponding entity in the data.
|
73 |
+
- `parsing`: The performance in this task is measured with [F1](https://huggingface.co/metrics/f1) (higher is better). A part-of-speech tag is correct only if it is equal to the corresponding tag in the data.
|
74 |
+
|
75 |
+
### Languages
|
76 |
+
|
77 |
+
There are two languages available : Spanish (es) and Dutch (nl).
|
78 |
+
|
79 |
+
## Dataset Structure
|
80 |
+
|
81 |
+
### Data Instances
|
82 |
+
|
83 |
+
The examples look like this :
|
84 |
+
|
85 |
+
```
|
86 |
+
{'id': '0',
|
87 |
+
'ner_tags': [5, 6, 0, 0, 0, 0, 3, 0, 0],
|
88 |
+
'pos_tags': [4, 28, 13, 59, 28, 21, 29, 22, 20],
|
89 |
+
'tokens': ['La', 'Coruña', ',', '23', 'may', '(', 'EFECOM', ')', '.']
|
90 |
+
}
|
91 |
+
```
|
92 |
+
|
93 |
+
### Data Fields
|
94 |
+
|
95 |
+
- `id`: id of the sample
|
96 |
+
- `tokens`: the tokens of the example text
|
97 |
+
- `ner_tags`: the NER tags of each token
|
98 |
+
- `pos_tags`: the POS tags of each token
|
99 |
+
|
100 |
+
|
101 |
+
The POS tags correspond to this list for Spanish:
|
102 |
+
|
103 |
+
```
|
104 |
+
'AO', 'AQ', 'CC', 'CS', 'DA', 'DE', 'DD', 'DI', 'DN', 'DP', 'DT', 'Faa', 'Fat', 'Fc', 'Fd', 'Fe', 'Fg', 'Fh', 'Fia', 'Fit', 'Fp', 'Fpa', 'Fpt', 'Fs', 'Ft', 'Fx', 'Fz', 'I', 'NC', 'NP', 'P0', 'PD', 'PI', 'PN', 'PP', 'PR', 'PT', 'PX', 'RG', 'RN', 'SP', 'VAI', 'VAM', 'VAN', 'VAP', 'VAS', 'VMG', 'VMI', 'VMM', 'VMN', 'VMP', 'VMS', 'VSG', 'VSI', 'VSM', 'VSN', 'VSP', 'VSS', 'Y', 'Z'
|
105 |
+
```
|
106 |
+
|
107 |
+
And this list for Dutch:
|
108 |
+
|
109 |
+
```
|
110 |
+
'Adj', 'Adv', 'Art', 'Conj', 'Int', 'Misc', 'N', 'Num', 'Prep', 'Pron', 'Punc', 'V'
|
111 |
+
```
|
112 |
+
|
113 |
+
The NER tags correspond to this list:
|
114 |
+
```
|
115 |
+
"O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC",
|
116 |
+
```
|
117 |
+
|
118 |
+
The NER tags have the same format as in the chunking task: a B denotes the first item of a phrase and an I any non-initial word. There are four types of phrases: person names (PER), organizations (ORG), locations (LOC) and miscellaneous names (MISC).
|
119 |
+
|
120 |
+
It is assumed that named entities are non-recursive and non-overlapping. In case a named entity is embedded in another named entity usually, only the top level entity is marked.
|
121 |
+
|
122 |
+
### Data Splits
|
123 |
+
|
124 |
+
For both configurations (Spanish and Dutch), there are three splits.
|
125 |
+
|
126 |
+
The original splits were named `train`, `testa` and `testb` and they correspond to the `train`, `validation` and `test` splits.
|
127 |
+
|
128 |
+
The splits have the following sizes :
|
129 |
+
|
130 |
+
| | Tain | Valid | Test |
|
131 |
+
| ----- | ------ | ----- | ---- |
|
132 |
+
| N. Examples (Spanish) | 8324 | 1916 | 1518 |
|
133 |
+
| N. Examples (Dutch) | 15807 | 2896 | 5196 |
|
134 |
+
|
135 |
+
## Dataset Creation
|
136 |
+
|
137 |
+
### Curation Rationale
|
138 |
+
|
139 |
+
The dataset was introduced to introduce new resources to two languages that were under-served for statistical machine learning at the time, Dutch and Spanish.
|
140 |
+
|
141 |
+
[More Information Needed]
|
142 |
+
|
143 |
+
### Source Data
|
144 |
+
|
145 |
+
The Spanish data is a collection of news wire articles made available by the Spanish EFE News Agency. The articles are from May 2000.
|
146 |
+
|
147 |
+
The Dutch data consist of four editions of the Belgian newspaper "De Morgen" of 2000 (June 2, July 1, August 1 and September 1).
|
148 |
+
|
149 |
+
#### Initial Data Collection and Normalization
|
150 |
+
|
151 |
+
The articles were word-tokenized, information on the exact pre-processing pipeline is unavailable.
|
152 |
+
|
153 |
+
#### Who are the source language producers?
|
154 |
+
|
155 |
+
The source language was produced by journalists and writers employed by the news agency and newspaper mentioned above.
|
156 |
+
|
157 |
+
### Annotations
|
158 |
+
|
159 |
+
#### Annotation process
|
160 |
+
|
161 |
+
For the Dutch data, the annotator has followed the MITRE and SAIC guidelines for named entity recognition (Chinchor et al., 1999) as well as possible.
|
162 |
+
|
163 |
+
#### Who are the annotators?
|
164 |
+
|
165 |
+
The Spanish data annotation was carried out by the TALP Research Center of the Technical University of Catalonia (UPC) and the Center of Language and Computation (CLiC) of the University of Barcelona (UB).
|
166 |
+
|
167 |
+
The Dutch data was annotated as a part of the Atranos project at the University of Antwerp.
|
168 |
+
|
169 |
+
### Personal and Sensitive Information
|
170 |
+
|
171 |
+
The data is sourced from newspaper source and only contains mentions of public figures or individuals
|
172 |
+
|
173 |
+
## Considerations for Using the Data
|
174 |
+
|
175 |
+
### Social Impact of Dataset
|
176 |
+
|
177 |
+
Named Entity Recognition systems can be used to efficiently index news text, allowing to easily gather all information pertaining to an organization or individual. Making such resources widely available in languages other than English can support better research and user experience for a larger part of the world's population. At the same time, better indexing and discoverability can also enable surveillance by state actors.
|
178 |
+
|
179 |
+
### Discussion of Biases
|
180 |
+
|
181 |
+
News text reproduces the biases of society, and any system trained on news data should be cognizant of these limitations and the risk for models to learn spurious correlations in this context, for example between a person's gender and their occupation.
|
182 |
+
|
183 |
+
### Other Known Limitations
|
184 |
+
|
185 |
+
Users should keep in mind that the dataset only contains news text, which might limit the applicability of the developed systems to other domains.
|
186 |
+
|
187 |
+
## Additional Information
|
188 |
+
|
189 |
+
### Dataset Curators
|
190 |
+
|
191 |
+
The annotation of the Spanish data was funded by the European Commission through the NAMIC project (IST-1999-12392).
|
192 |
+
|
193 |
+
### Licensing Information
|
194 |
+
|
195 |
+
The licensing status of the data, especially the news source text, is unknown.
|
196 |
+
|
197 |
+
### Citation Information
|
198 |
+
|
199 |
+
Provide the [BibTex](http://www.bibtex.org/)-formatted reference for the dataset. For example:
|
200 |
+
```
|
201 |
+
@inproceedings{tjong-kim-sang-2002-introduction,
|
202 |
+
title = "Introduction to the {C}o{NLL}-2002 Shared Task: Language-Independent Named Entity Recognition",
|
203 |
+
author = "Tjong Kim Sang, Erik F.",
|
204 |
+
booktitle = "{COLING}-02: The 6th Conference on Natural Language Learning 2002 ({C}o{NLL}-2002)",
|
205 |
+
year = "2002",
|
206 |
+
url = "https://www.aclweb.org/anthology/W02-2024",
|
207 |
+
}
|
208 |
+
```
|
conll2002.py
ADDED
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""Introduction to the CoNLL-2002 Shared Task: Language-Independent Named Entity Recognition"""
|
18 |
+
|
19 |
+
import logging
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@inproceedings{tjong-kim-sang-2002-introduction,
|
26 |
+
title = "Introduction to the {C}o{NLL}-2002 Shared Task: Language-Independent Named Entity Recognition",
|
27 |
+
author = "Tjong Kim Sang, Erik F.",
|
28 |
+
booktitle = "{COLING}-02: The 6th Conference on Natural Language Learning 2002 ({C}o{NLL}-2002)",
|
29 |
+
year = "2002",
|
30 |
+
url = "https://www.aclweb.org/anthology/W02-2024",
|
31 |
+
}
|
32 |
+
"""
|
33 |
+
|
34 |
+
_DESCRIPTION = """\
|
35 |
+
Named entities are phrases that contain the names of persons, organizations, locations, times and quantities.
|
36 |
+
|
37 |
+
Example:
|
38 |
+
[PER Wolff] , currently a journalist in [LOC Argentina] , played with [PER Del Bosque] in the final years of the seventies in [ORG Real Madrid] .
|
39 |
+
|
40 |
+
The shared task of CoNLL-2002 concerns language-independent named entity recognition.
|
41 |
+
We will concentrate on four types of named entities: persons, locations, organizations and names of miscellaneous entities that do not belong to the previous three groups.
|
42 |
+
The participants of the shared task will be offered training and test data for at least two languages.
|
43 |
+
They will use the data for developing a named-entity recognition system that includes a machine learning component.
|
44 |
+
Information sources other than the training data may be used in this shared task.
|
45 |
+
We are especially interested in methods that can use additional unannotated data for improving their performance (for example co-training).
|
46 |
+
|
47 |
+
The train/validation/test sets are available in Spanish and Dutch.
|
48 |
+
|
49 |
+
For more details see https://www.clips.uantwerpen.be/conll2002/ner/ and https://www.aclweb.org/anthology/W02-2024/
|
50 |
+
"""
|
51 |
+
|
52 |
+
_URL = "https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/"
|
53 |
+
_ES_TRAINING_FILE = "esp.train"
|
54 |
+
_ES_DEV_FILE = "esp.testa"
|
55 |
+
_ES_TEST_FILE = "esp.testb"
|
56 |
+
_NL_TRAINING_FILE = "ned.train"
|
57 |
+
_NL_DEV_FILE = "ned.testa"
|
58 |
+
_NL_TEST_FILE = "ned.testb"
|
59 |
+
|
60 |
+
|
61 |
+
class Conll2002Config(datasets.BuilderConfig):
|
62 |
+
"""BuilderConfig for Conll2002"""
|
63 |
+
|
64 |
+
def __init__(self, **kwargs):
|
65 |
+
"""BuilderConfig forConll2002.
|
66 |
+
|
67 |
+
Args:
|
68 |
+
**kwargs: keyword arguments forwarded to super.
|
69 |
+
"""
|
70 |
+
super(Conll2002Config, self).__init__(**kwargs)
|
71 |
+
|
72 |
+
|
73 |
+
class Conll2002(datasets.GeneratorBasedBuilder):
|
74 |
+
"""Conll2002 dataset."""
|
75 |
+
|
76 |
+
BUILDER_CONFIGS = [
|
77 |
+
Conll2002Config(name="es", version=datasets.Version("1.0.0"), description="Conll2002 Spanish dataset"),
|
78 |
+
Conll2002Config(name="nl", version=datasets.Version("1.0.0"), description="Conll2002 Dutch dataset"),
|
79 |
+
]
|
80 |
+
|
81 |
+
def _info(self):
|
82 |
+
return datasets.DatasetInfo(
|
83 |
+
description=_DESCRIPTION,
|
84 |
+
features=datasets.Features(
|
85 |
+
{
|
86 |
+
"id": datasets.Value("string"),
|
87 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
88 |
+
"pos_tags": datasets.Sequence(
|
89 |
+
datasets.features.ClassLabel(
|
90 |
+
names=[
|
91 |
+
"AO",
|
92 |
+
"AQ",
|
93 |
+
"CC",
|
94 |
+
"CS",
|
95 |
+
"DA",
|
96 |
+
"DE",
|
97 |
+
"DD",
|
98 |
+
"DI",
|
99 |
+
"DN",
|
100 |
+
"DP",
|
101 |
+
"DT",
|
102 |
+
"Faa",
|
103 |
+
"Fat",
|
104 |
+
"Fc",
|
105 |
+
"Fd",
|
106 |
+
"Fe",
|
107 |
+
"Fg",
|
108 |
+
"Fh",
|
109 |
+
"Fia",
|
110 |
+
"Fit",
|
111 |
+
"Fp",
|
112 |
+
"Fpa",
|
113 |
+
"Fpt",
|
114 |
+
"Fs",
|
115 |
+
"Ft",
|
116 |
+
"Fx",
|
117 |
+
"Fz",
|
118 |
+
"I",
|
119 |
+
"NC",
|
120 |
+
"NP",
|
121 |
+
"P0",
|
122 |
+
"PD",
|
123 |
+
"PI",
|
124 |
+
"PN",
|
125 |
+
"PP",
|
126 |
+
"PR",
|
127 |
+
"PT",
|
128 |
+
"PX",
|
129 |
+
"RG",
|
130 |
+
"RN",
|
131 |
+
"SP",
|
132 |
+
"VAI",
|
133 |
+
"VAM",
|
134 |
+
"VAN",
|
135 |
+
"VAP",
|
136 |
+
"VAS",
|
137 |
+
"VMG",
|
138 |
+
"VMI",
|
139 |
+
"VMM",
|
140 |
+
"VMN",
|
141 |
+
"VMP",
|
142 |
+
"VMS",
|
143 |
+
"VSG",
|
144 |
+
"VSI",
|
145 |
+
"VSM",
|
146 |
+
"VSN",
|
147 |
+
"VSP",
|
148 |
+
"VSS",
|
149 |
+
"Y",
|
150 |
+
"Z",
|
151 |
+
]
|
152 |
+
)
|
153 |
+
if self.config.name == "es"
|
154 |
+
else datasets.features.ClassLabel(
|
155 |
+
names=["Adj", "Adv", "Art", "Conj", "Int", "Misc", "N", "Num", "Prep", "Pron", "Punc", "V"]
|
156 |
+
)
|
157 |
+
),
|
158 |
+
"ner_tags": datasets.Sequence(
|
159 |
+
datasets.features.ClassLabel(
|
160 |
+
names=[
|
161 |
+
"O",
|
162 |
+
"B-PER",
|
163 |
+
"I-PER",
|
164 |
+
"B-ORG",
|
165 |
+
"I-ORG",
|
166 |
+
"B-LOC",
|
167 |
+
"I-LOC",
|
168 |
+
"B-MISC",
|
169 |
+
"I-MISC",
|
170 |
+
]
|
171 |
+
)
|
172 |
+
),
|
173 |
+
}
|
174 |
+
),
|
175 |
+
supervised_keys=None,
|
176 |
+
homepage="https://www.aclweb.org/anthology/W02-2024/",
|
177 |
+
citation=_CITATION,
|
178 |
+
)
|
179 |
+
|
180 |
+
def _split_generators(self, dl_manager):
|
181 |
+
"""Returns SplitGenerators."""
|
182 |
+
urls_to_download = {
|
183 |
+
"train": f"{_URL}{_ES_TRAINING_FILE if self.config.name == 'es' else _NL_TRAINING_FILE}",
|
184 |
+
"dev": f"{_URL}{_ES_DEV_FILE if self.config.name == 'es' else _NL_DEV_FILE}",
|
185 |
+
"test": f"{_URL}{_ES_TEST_FILE if self.config.name == 'es' else _NL_TEST_FILE}",
|
186 |
+
}
|
187 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
188 |
+
|
189 |
+
return [
|
190 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
191 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
|
192 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
193 |
+
]
|
194 |
+
|
195 |
+
def _generate_examples(self, filepath):
|
196 |
+
logging.info("⏳ Generating examples from = %s", filepath)
|
197 |
+
with open(filepath, encoding="utf-8") as f:
|
198 |
+
guid = 0
|
199 |
+
tokens = []
|
200 |
+
pos_tags = []
|
201 |
+
ner_tags = []
|
202 |
+
for line in f:
|
203 |
+
if line.startswith("-DOCSTART-") or line == "" or line == "\n":
|
204 |
+
if tokens:
|
205 |
+
yield guid, {
|
206 |
+
"id": str(guid),
|
207 |
+
"tokens": tokens,
|
208 |
+
"pos_tags": pos_tags,
|
209 |
+
"ner_tags": ner_tags,
|
210 |
+
}
|
211 |
+
guid += 1
|
212 |
+
tokens = []
|
213 |
+
pos_tags = []
|
214 |
+
ner_tags = []
|
215 |
+
else:
|
216 |
+
# conll2002 tokens are space separated
|
217 |
+
splits = line.split(" ")
|
218 |
+
tokens.append(splits[0])
|
219 |
+
pos_tags.append(splits[1])
|
220 |
+
ner_tags.append(splits[2].rstrip())
|
221 |
+
# last example
|
222 |
+
yield guid, {
|
223 |
+
"id": str(guid),
|
224 |
+
"tokens": tokens,
|
225 |
+
"pos_tags": pos_tags,
|
226 |
+
"ner_tags": ner_tags,
|
227 |
+
}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"es": {"description": "Named entities are phrases that contain the names of persons, organizations, locations, times and quantities.\n\nExample:\n[PER Wolff] , currently a journalist in [LOC Argentina] , played with [PER Del Bosque] in the final years of the seventies in [ORG Real Madrid] .\n\nThe shared task of CoNLL-2002 concerns language-independent named entity recognition.\nWe will concentrate on four types of named entities: persons, locations, organizations and names of miscellaneous entities that do not belong to the previous three groups.\nThe participants of the shared task will be offered training and test data for at least two languages.\nThey will use the data for developing a named-entity recognition system that includes a machine learning component.\nInformation sources other than the training data may be used in this shared task.\nWe are especially interested in methods that can use additional unannotated data for improving their performance (for example co-training).\n\nThe train/validation/test sets are available in Spanish and Dutch.\n\nFor more details see https://www.clips.uantwerpen.be/conll2002/ner/ and https://www.aclweb.org/anthology/W02-2024/\n", "citation": "@inproceedings{tjong-kim-sang-2002-introduction,\n title = \"Introduction to the {C}o{NLL}-2002 Shared Task: Language-Independent Named Entity Recognition\",\n author = \"Tjong Kim Sang, Erik F.\",\n booktitle = \"{COLING}-02: The 6th Conference on Natural Language Learning 2002 ({C}o{NLL}-2002)\",\n year = \"2002\",\n url = \"https://www.aclweb.org/anthology/W02-2024\",\n}\n", "homepage": "https://www.aclweb.org/anthology/W02-2024/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"num_classes": 60, "names": ["AO", "AQ", "CC", "CS", "DA", "DE", "DD", "DI", "DN", "DP", "DT", "Faa", "Fat", "Fc", "Fd", "Fe", "Fg", "Fh", "Fia", "Fit", "Fp", "Fpa", "Fpt", "Fs", "Ft", "Fx", "Fz", "I", "NC", "NP", "P0", "PD", "PI", "PN", "PP", "PR", "PT", "PX", "RG", "RN", "SP", "VAI", "VAM", "VAN", "VAP", "VAS", "VMG", "VMI", "VMM", "VMN", "VMP", "VMS", "VSG", "VSI", "VSM", "VSN", "VSP", "VSS", "Y", "Z"], "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": "conll2002", "config_name": "es", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 6672173, "num_examples": 8324, "dataset_name": "conll2002"}, "validation": {"name": "validation", "num_bytes": 1333784, "num_examples": 1916, "dataset_name": "conll2002"}, "test": {"name": "test", "num_bytes": 1294156, "num_examples": 1518, "dataset_name": "conll2002"}}, "download_checksums": {"https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/esp.train": {"num_bytes": 2970825, "checksum": "a20d95cab7d88a19a86f8c1ad6329325c99fbd9529ed978cbd7e31d4b01b4008"}, "https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/esp.testa": {"num_bytes": 594058, "checksum": "85c17793b77881c53d19017d9d0f1e6fb98b7ddcab54a5f24b05ed1793103c87"}, "https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/esp.testb": {"num_bytes": 575807, "checksum": "1f8f7a392c6d4979a5592a5794eed43d7869b46da6851bbcde99714149f1d016"}}, "download_size": 4140690, "post_processing_size": null, "dataset_size": 9300113, "size_in_bytes": 13440803}, "nl": {"description": "Named entities are phrases that contain the names of persons, organizations, locations, times and quantities.\n\nExample:\n[PER Wolff] , currently a journalist in [LOC Argentina] , played with [PER Del Bosque] in the final years of the seventies in [ORG Real Madrid] .\n\nThe shared task of CoNLL-2002 concerns language-independent named entity recognition.\nWe will concentrate on four types of named entities: persons, locations, organizations and names of miscellaneous entities that do not belong to the previous three groups.\nThe participants of the shared task will be offered training and test data for at least two languages.\nThey will use the data for developing a named-entity recognition system that includes a machine learning component.\nInformation sources other than the training data may be used in this shared task.\nWe are especially interested in methods that can use additional unannotated data for improving their performance (for example co-training).\n\nThe train/validation/test sets are available in Spanish and Dutch.\n\nFor more details see https://www.clips.uantwerpen.be/conll2002/ner/ and https://www.aclweb.org/anthology/W02-2024/\n", "citation": "@inproceedings{tjong-kim-sang-2002-introduction,\n title = \"Introduction to the {C}o{NLL}-2002 Shared Task: Language-Independent Named Entity Recognition\",\n author = \"Tjong Kim Sang, Erik F.\",\n booktitle = \"{COLING}-02: The 6th Conference on Natural Language Learning 2002 ({C}o{NLL}-2002)\",\n year = \"2002\",\n url = \"https://www.aclweb.org/anthology/W02-2024\",\n}\n", "homepage": "https://www.aclweb.org/anthology/W02-2024/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"num_classes": 12, "names": ["Adj", "Adv", "Art", "Conj", "Int", "Misc", "N", "Num", "Prep", "Pron", "Punc", "V"], "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": "conll2002", "config_name": "nl", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5308959, "num_examples": 15807, "dataset_name": "conll2002"}, "validation": {"name": "validation", "num_bytes": 994298, "num_examples": 2896, "dataset_name": "conll2002"}, "test": {"name": "test", "num_bytes": 1808862, "num_examples": 5196, "dataset_name": "conll2002"}}, "download_checksums": {"https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/ned.train": {"num_bytes": 2377174, "checksum": "0a419dcb356b62c8cff38515675550b3d5dbea9f45a1c4956328dbd5cc7fcdbc"}, "https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/ned.testa": {"num_bytes": 450785, "checksum": "51259d4bfe52462f211d3d0b67173a7ecbfa296e199f6c6bd0895f4c78155057"}, "https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/ned.testb": {"num_bytes": 814282, "checksum": "2aa748edb82e6f9c4d82e57a4bed69ded18cfa4803122c75070335d513517488"}}, "download_size": 3642241, "post_processing_size": null, "dataset_size": 8112119, "size_in_bytes": 11754360}}
|
dummy/es/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a8a354fa86d8514a792bd995048fa04302e868efbe27711c3c691ab47d7f8b6f
|
3 |
+
size 1089
|
dummy/nl/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:26a0a51bc3f4db1f5e342f2084a0c446d8541408e7ec3bda4c9340f5cc3321f8
|
3 |
+
size 1094
|