Datasets:
Update multinerd.py
Browse files- multinerd.py +17 -22
multinerd.py
CHANGED
@@ -4,26 +4,23 @@ from itertools import chain
|
|
4 |
import datasets
|
5 |
|
6 |
logger = datasets.logging.get_logger(__name__)
|
7 |
-
_DESCRIPTION = """[
|
8 |
-
_NAME = "
|
9 |
_VERSION = "1.0.0"
|
10 |
_CITATION = """
|
11 |
-
@inproceedings{tedeschi-
|
12 |
-
title = "{
|
13 |
author = "Tedeschi, Simone and
|
14 |
-
Maiorca, Valentino and
|
15 |
-
Campolungo, Niccol{\`o} and
|
16 |
-
Cecconi, Francesco and
|
17 |
Navigli, Roberto",
|
18 |
-
booktitle = "Findings of the Association for Computational Linguistics:
|
19 |
-
month =
|
20 |
-
year = "
|
21 |
-
address = "
|
22 |
publisher = "Association for Computational Linguistics",
|
23 |
-
url = "https://aclanthology.org/
|
24 |
-
doi = "10.18653/v1/
|
25 |
-
pages = "
|
26 |
-
abstract = "
|
27 |
}
|
28 |
"""
|
29 |
|
@@ -32,14 +29,12 @@ _URL = f'https://huggingface.co/datasets/tner/{_NAME}/resolve/main/dataset'
|
|
32 |
_LANGUAGE = ['de', 'en', 'es', 'fr', 'it', 'nl', 'pl', 'pt', 'ru']
|
33 |
_URLS = {
|
34 |
l: {
|
35 |
-
str(datasets.Split.TEST): [f'{_URL}/{l}
|
36 |
-
str(datasets.Split.TRAIN): [f'{_URL}/{l}/train.jsonl'],
|
37 |
-
str(datasets.Split.VALIDATION): [f'{_URL}/{l}/dev.jsonl']
|
38 |
} for l in _LANGUAGE
|
39 |
}
|
40 |
|
41 |
|
42 |
-
class
|
43 |
"""BuilderConfig"""
|
44 |
|
45 |
def __init__(self, **kwargs):
|
@@ -48,14 +43,14 @@ class WikiNeuralConfig(datasets.BuilderConfig):
|
|
48 |
Args:
|
49 |
**kwargs: keyword arguments forwarded to super.
|
50 |
"""
|
51 |
-
super(
|
52 |
|
53 |
|
54 |
-
class
|
55 |
"""Dataset."""
|
56 |
|
57 |
BUILDER_CONFIGS = [
|
58 |
-
|
59 |
]
|
60 |
|
61 |
def _split_generators(self, dl_manager):
|
|
|
4 |
import datasets
|
5 |
|
6 |
logger = datasets.logging.get_logger(__name__)
|
7 |
+
_DESCRIPTION = """[MultiNERD](https://aclanthology.org/2022.findings-naacl.60/)"""
|
8 |
+
_NAME = "multinerd"
|
9 |
_VERSION = "1.0.0"
|
10 |
_CITATION = """
|
11 |
+
@inproceedings{tedeschi-navigli-2022-multinerd,
|
12 |
+
title = "{M}ulti{NERD}: A Multilingual, Multi-Genre and Fine-Grained Dataset for Named Entity Recognition (and Disambiguation)",
|
13 |
author = "Tedeschi, Simone and
|
|
|
|
|
|
|
14 |
Navigli, Roberto",
|
15 |
+
booktitle = "Findings of the Association for Computational Linguistics: NAACL 2022",
|
16 |
+
month = jul,
|
17 |
+
year = "2022",
|
18 |
+
address = "Seattle, United States",
|
19 |
publisher = "Association for Computational Linguistics",
|
20 |
+
url = "https://aclanthology.org/2022.findings-naacl.60",
|
21 |
+
doi = "10.18653/v1/2022.findings-naacl.60",
|
22 |
+
pages = "801--812",
|
23 |
+
abstract = "Named Entity Recognition (NER) is the task of identifying named entities in texts and classifying them through specific semantic categories, a process which is crucial for a wide range of NLP applications. Current datasets for NER focus mainly on coarse-grained entity types, tend to consider a single textual genre and to cover a narrow set of languages, thus limiting the general applicability of NER systems.In this work, we design a new methodology for automatically producing NER annotations, and address the aforementioned limitations by introducing a novel dataset that covers 10 languages, 15 NER categories and 2 textual genres.We also introduce a manually-annotated test set, and extensively evaluate the quality of our novel dataset on both this new test set and standard benchmarks for NER.In addition, in our dataset, we include: i) disambiguation information to enable the development of multilingual entity linking systems, and ii) image URLs to encourage the creation of multimodal systems.We release our dataset at https://github.com/Babelscape/multinerd.",
|
24 |
}
|
25 |
"""
|
26 |
|
|
|
29 |
_LANGUAGE = ['de', 'en', 'es', 'fr', 'it', 'nl', 'pl', 'pt', 'ru']
|
30 |
_URLS = {
|
31 |
l: {
|
32 |
+
str(datasets.Split.TEST): [f'{_URL}/{l}.jsonl'],
|
|
|
|
|
33 |
} for l in _LANGUAGE
|
34 |
}
|
35 |
|
36 |
|
37 |
+
class MultiNERDConfig(datasets.BuilderConfig):
|
38 |
"""BuilderConfig"""
|
39 |
|
40 |
def __init__(self, **kwargs):
|
|
|
43 |
Args:
|
44 |
**kwargs: keyword arguments forwarded to super.
|
45 |
"""
|
46 |
+
super(MultiNERDConfig, self).__init__(**kwargs)
|
47 |
|
48 |
|
49 |
+
class MultiNERD(datasets.GeneratorBasedBuilder):
|
50 |
"""Dataset."""
|
51 |
|
52 |
BUILDER_CONFIGS = [
|
53 |
+
MultiNERDConfig(name=l, version=datasets.Version(_VERSION), description=f"{_DESCRIPTION} (language: {l})") for l in _LANGUAGE
|
54 |
]
|
55 |
|
56 |
def _split_generators(self, dl_manager):
|