asahi417 commited on
Commit
ecd61a1
1 Parent(s): 08b0ce9
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license:
5
+ - other
6
+ multilinguality:
7
+ - monolingual
8
+ size_categories:
9
+ - 1k<10K
10
+ task_categories:
11
+ - token-classification
12
+ task_ids:
13
+ - named-entity-recognition
14
+ pretty_name: WNUT 2017
15
+ ---
16
+
17
+ # Dataset Card for "tner/wnut2017"
18
+
19
+ ## Dataset Description
20
+
21
+ - **Repository:** [T-NER](https://github.com/asahi417/tner)
22
+ - **Paper:** [https://aclanthology.org/W17-4418/](https://aclanthology.org/W17-4418/)
23
+ - **Dataset:** WNUT 2017
24
+ - **Domain:** Twitter, Reddit, YouTube, and StackExchange
25
+ - **Number of Entity:** 6
26
+
27
+
28
+ ### Dataset Summary
29
+ WNUT 2017 NER dataset formatted in a part of [TNER](https://github.com/asahi417/tner) project.
30
+ - Entity Types: `creative-work`, `corporation`, `group`, `location`, `person`, `product`
31
+
32
+ ## Dataset Structure
33
+
34
+ ### Data Instances
35
+ An example of `train` looks as follows.
36
+
37
+ ```
38
+ {
39
+ 'tags': ['SOCCER','-', 'JAPAN', 'GET', 'LUCKY', 'WIN', ',', 'CHINA', 'IN', 'SURPRISE', 'DEFEAT', '.'],
40
+ 'tokens': [0, 0, 5, 0, 0, 0, 0, 3, 0, 0, 0, 0]
41
+ }
42
+ ```
43
+
44
+ ### Label ID
45
+ The label2id dictionary can be found at [here](https://huggingface.co/datasets/tner/conll2003/raw/main/dataset/label.json).
46
+ ```python
47
+ {
48
+ "B-corporation": 0,
49
+ "B-creative-work": 1,
50
+ "B-group": 2,
51
+ "B-location": 3,
52
+ "B-person": 4,
53
+ "B-product": 5,
54
+ "I-corporation": 6,
55
+ "I-creative-work": 7,
56
+ "I-group": 8,
57
+ "I-location": 9,
58
+ "I-person": 10,
59
+ "I-product": 11,
60
+ "O": 12
61
+ }
62
+ ```
63
+
64
+ ### Data Splits
65
+
66
+ | name |train|validation|test|
67
+ |---------|----:|---------:|---:|
68
+ |conll2003|14041| 3250|3453|
69
+
70
+ ### Licensing Information
71
+
72
+ From the [CoNLL2003 shared task](https://www.clips.uantwerpen.be/conll2003/ner/) page:
73
+
74
+ > The English data is a collection of news wire articles from the Reuters Corpus. The annotation has been done by people of the University of Antwerp. Because of copyright reasons we only make available the annotations. In order to build the complete data sets you will need access to the Reuters Corpus. It can be obtained for research purposes without any charge from NIST.
75
+
76
+ The copyrights are defined below, from the [Reuters Corpus page](https://trec.nist.gov/data/reuters/reuters.html):
77
+
78
+ > The stories in the Reuters Corpus are under the copyright of Reuters Ltd and/or Thomson Reuters, and their use is governed by the following agreements:
79
+ >
80
+ > [Organizational agreement](https://trec.nist.gov/data/reuters/org_appl_reuters_v4.html)
81
+ >
82
+ > This agreement must be signed by the person responsible for the data at your organization, and sent to NIST.
83
+ >
84
+ > [Individual agreement](https://trec.nist.gov/data/reuters/ind_appl_reuters_v4.html)
85
+ >
86
+ > This agreement must be signed by all researchers using the Reuters Corpus at your organization, and kept on file at your organization.
87
+
88
+ ### Citation Information
89
+
90
+ ```
91
+ @inproceedings{tjong-kim-sang-de-meulder-2003-introduction,
92
+ title = "Introduction to the {C}o{NLL}-2003 Shared Task: Language-Independent Named Entity Recognition",
93
+ author = "Tjong Kim Sang, Erik F. and De Meulder, Fien",
94
+ booktitle = "Proceedings of the Seventh Conference on Natural Language Learning at {HLT}-{NAACL} 2003",
95
+ year = "2003",
96
+ url = "https://www.aclweb.org/anthology/W03-0419",
97
+ pages = "142--147",
98
+ }
99
+ ```
dataset/label.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"B-corporation": 0, "B-creative-work": 1, "B-group": 2, "B-location": 3, "B-person": 4, "B-product": 5, "I-corporation": 6, "I-creative-work": 7, "I-group": 8, "I-location": 9, "I-person": 10, "I-product": 11, "O": 12}
dataset/test.json ADDED
The diff for this file is too large to render. See raw diff
 
dataset/train.json ADDED
The diff for this file is too large to render. See raw diff
 
dataset/valid.json ADDED
The diff for this file is too large to render. See raw diff
 
wnut2017.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """ NER dataset compiled by T-NER library https://github.com/asahi417/tner/tree/master/tner """
2
+ import json
3
+ from itertools import chain
4
+ import datasets
5
+
6
+ logger = datasets.logging.get_logger(__name__)
7
+ _DESCRIPTION = """[WNUT 2017 NER dataset](https://aclanthology.org/W17-4418/)"""
8
+ _NAME = "wnut20017"
9
+ _VERSION = "1.0.0"
10
+ _CITATION = """
11
+ @inproceedings{derczynski-etal-2017-results,
12
+ title = "Results of the {WNUT}2017 Shared Task on Novel and Emerging Entity Recognition",
13
+ author = "Derczynski, Leon and
14
+ Nichols, Eric and
15
+ van Erp, Marieke and
16
+ Limsopatham, Nut",
17
+ booktitle = "Proceedings of the 3rd Workshop on Noisy User-generated Text",
18
+ month = sep,
19
+ year = "2017",
20
+ address = "Copenhagen, Denmark",
21
+ publisher = "Association for Computational Linguistics",
22
+ url = "https://aclanthology.org/W17-4418",
23
+ doi = "10.18653/v1/W17-4418",
24
+ pages = "140--147",
25
+ abstract = "This shared task focuses on identifying unusual, previously-unseen entities in the context of emerging discussions. Named entities form the basis of many modern approaches to other tasks (like event clustering and summarization), but recall on them is a real problem in noisy text - even among annotators. This drop tends to be due to novel entities and surface forms. Take for example the tweet {``}so.. kktny in 30 mins?!{''} {--} even human experts find the entity {`}kktny{'} hard to detect and resolve. The goal of this task is to provide a definition of emerging and of rare entities, and based on that, also datasets for detecting these entities. The task as described in this paper evaluated the ability of participating entries to detect and classify novel and emerging named entities in noisy text.",
26
+ }
27
+ """
28
+
29
+ _HOME_PAGE = "https://github.com/asahi417/tner"
30
+ _URL = f'https://huggingface.co/datasets/tner/{_NAME}/raw/main/dataset'
31
+ _URLS = {
32
+ str(datasets.Split.TEST): [f'{_URL}/test.json'],
33
+ str(datasets.Split.TRAIN): [f'{_URL}/train.json'],
34
+ str(datasets.Split.VALIDATION): [f'{_URL}/valid.json'],
35
+ }
36
+
37
+
38
+ class WNUT2017Config(datasets.BuilderConfig):
39
+ """BuilderConfig"""
40
+
41
+ def __init__(self, **kwargs):
42
+ """BuilderConfig.
43
+
44
+ Args:
45
+ **kwargs: keyword arguments forwarded to super.
46
+ """
47
+ super(WNUT2017Config, self).__init__(**kwargs)
48
+
49
+
50
+ class WNUT2017(datasets.GeneratorBasedBuilder):
51
+ """Dataset."""
52
+
53
+ BUILDER_CONFIGS = [
54
+ WNUT2017Config(name=_NAME, version=datasets.Version(_VERSION), description=_DESCRIPTION),
55
+ ]
56
+
57
+ def _split_generators(self, dl_manager):
58
+ downloaded_file = dl_manager.download_and_extract(_URLS)
59
+ return [datasets.SplitGenerator(name=i, gen_kwargs={"filepaths": downloaded_file[str(i)]})
60
+ for i in [datasets.Split.TRAIN, datasets.Split.VALIDATION, datasets.Split.TEST]]
61
+
62
+ def _generate_examples(self, filepaths):
63
+ _key = 0
64
+ for filepath in filepaths:
65
+ logger.info(f"generating examples from = {filepath}")
66
+ with open(filepath, encoding="utf-8") as f:
67
+ _list = [i for i in f.read().split('\n') if len(i) > 0]
68
+ for i in _list:
69
+ data = json.loads(i)
70
+ yield _key, data
71
+ _key += 1
72
+
73
+ def _info(self):
74
+ return datasets.DatasetInfo(
75
+ description=_DESCRIPTION,
76
+ features=datasets.Features(
77
+ {
78
+ "tokens": datasets.Sequence(datasets.Value("string")),
79
+ "tags": datasets.Sequence(datasets.Value("int32")),
80
+ }
81
+ ),
82
+ supervised_keys=None,
83
+ homepage=_HOME_PAGE,
84
+ citation=_CITATION,
85
+ )