Datasets:
Tasks:
Token Classification
Modalities:
Text
Sub-tasks:
named-entity-recognition
Languages:
English
Size:
1K - 10K
ArXiv:
License:
update
Browse files- README.md +89 -0
- dataset/test.json +0 -0
- dataset/train.json +0 -0
- dataset/valid.json +0 -0
- tweebank_ner.py +86 -0
README.md
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
'tokens': ['@paulwalk', 'It', "'s", 'the', 'view', 'from', 'where', 'I', "'m", 'living', 'for', 'two', 'weeks', '.', 'Empire', 'State', 'Building', '=', 'ESB', '.', 'Pretty', 'bad', 'storm', 'here', 'last', 'evening', '.'],
|
40 |
+
'tags': [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 3, 9, 9, 12, 3, 12, 12, 12, 12, 12, 12, 12, 12]
|
41 |
+
}
|
42 |
+
```
|
43 |
+
|
44 |
+
### Label ID
|
45 |
+
The label2id dictionary can be found at [here](https://huggingface.co/datasets/tner/wnut2017/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 |
+
|wnut2017 | 2395| 1009|1287|
|
69 |
+
|
70 |
+
### Citation Information
|
71 |
+
|
72 |
+
```
|
73 |
+
@inproceedings{derczynski-etal-2017-results,
|
74 |
+
title = "Results of the {WNUT}2017 Shared Task on Novel and Emerging Entity Recognition",
|
75 |
+
author = "Derczynski, Leon and
|
76 |
+
Nichols, Eric and
|
77 |
+
van Erp, Marieke and
|
78 |
+
Limsopatham, Nut",
|
79 |
+
booktitle = "Proceedings of the 3rd Workshop on Noisy User-generated Text",
|
80 |
+
month = sep,
|
81 |
+
year = "2017",
|
82 |
+
address = "Copenhagen, Denmark",
|
83 |
+
publisher = "Association for Computational Linguistics",
|
84 |
+
url = "https://aclanthology.org/W17-4418",
|
85 |
+
doi = "10.18653/v1/W17-4418",
|
86 |
+
pages = "140--147",
|
87 |
+
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.",
|
88 |
+
}
|
89 |
+
```
|
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
|
|
tweebank_ner.py
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 = """[Tweebank NER](https://arxiv.org/abs/2201.07281)"""
|
8 |
+
_NAME = "tweebank_ner"
|
9 |
+
_VERSION = "1.0.0"
|
10 |
+
_CITATION = """
|
11 |
+
@article{DBLP:journals/corr/abs-2201-07281,
|
12 |
+
author = {Hang Jiang and
|
13 |
+
Yining Hua and
|
14 |
+
Doug Beeferman and
|
15 |
+
Deb Roy},
|
16 |
+
title = {Annotating the Tweebank Corpus on Named Entity Recognition and Building
|
17 |
+
{NLP} Models for Social Media Analysis},
|
18 |
+
journal = {CoRR},
|
19 |
+
volume = {abs/2201.07281},
|
20 |
+
year = {2022},
|
21 |
+
url = {https://arxiv.org/abs/2201.07281},
|
22 |
+
eprinttype = {arXiv},
|
23 |
+
eprint = {2201.07281},
|
24 |
+
timestamp = {Fri, 21 Jan 2022 13:57:15 +0100},
|
25 |
+
biburl = {https://dblp.org/rec/journals/corr/abs-2201-07281.bib},
|
26 |
+
bibsource = {dblp computer science bibliography, https://dblp.org}
|
27 |
+
}
|
28 |
+
"""
|
29 |
+
|
30 |
+
_HOME_PAGE = "https://github.com/asahi417/tner"
|
31 |
+
_URL = f'https://huggingface.co/datasets/tner/{_NAME}/raw/main/dataset'
|
32 |
+
_URLS = {
|
33 |
+
str(datasets.Split.TEST): [f'{_URL}/test.json'],
|
34 |
+
str(datasets.Split.TRAIN): [f'{_URL}/train.json'],
|
35 |
+
str(datasets.Split.VALIDATION): [f'{_URL}/valid.json'],
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
class TweebankNERConfig(datasets.BuilderConfig):
|
40 |
+
"""BuilderConfig"""
|
41 |
+
|
42 |
+
def __init__(self, **kwargs):
|
43 |
+
"""BuilderConfig.
|
44 |
+
|
45 |
+
Args:
|
46 |
+
**kwargs: keyword arguments forwarded to super.
|
47 |
+
"""
|
48 |
+
super(TweebankNERConfig, self).__init__(**kwargs)
|
49 |
+
|
50 |
+
|
51 |
+
class TweebankNER(datasets.GeneratorBasedBuilder):
|
52 |
+
"""Dataset."""
|
53 |
+
|
54 |
+
BUILDER_CONFIGS = [
|
55 |
+
TweebankNERConfig(name=_NAME, version=datasets.Version(_VERSION), description=_DESCRIPTION),
|
56 |
+
]
|
57 |
+
|
58 |
+
def _split_generators(self, dl_manager):
|
59 |
+
downloaded_file = dl_manager.download_and_extract(_URLS)
|
60 |
+
return [datasets.SplitGenerator(name=i, gen_kwargs={"filepaths": downloaded_file[str(i)]})
|
61 |
+
for i in [datasets.Split.TRAIN, datasets.Split.VALIDATION, datasets.Split.TEST]]
|
62 |
+
|
63 |
+
def _generate_examples(self, filepaths):
|
64 |
+
_key = 0
|
65 |
+
for filepath in filepaths:
|
66 |
+
logger.info(f"generating examples from = {filepath}")
|
67 |
+
with open(filepath, encoding="utf-8") as f:
|
68 |
+
_list = [i for i in f.read().split('\n') if len(i) > 0]
|
69 |
+
for i in _list:
|
70 |
+
data = json.loads(i)
|
71 |
+
yield _key, data
|
72 |
+
_key += 1
|
73 |
+
|
74 |
+
def _info(self):
|
75 |
+
return datasets.DatasetInfo(
|
76 |
+
description=_DESCRIPTION,
|
77 |
+
features=datasets.Features(
|
78 |
+
{
|
79 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
80 |
+
"tags": datasets.Sequence(datasets.Value("int32")),
|
81 |
+
}
|
82 |
+
),
|
83 |
+
supervised_keys=None,
|
84 |
+
homepage=_HOME_PAGE,
|
85 |
+
citation=_CITATION,
|
86 |
+
)
|