Add WNUT 17 NER dataset
State: closed | Author: stefan-it (CONTRIBUTOR)

Hi,

this PR adds the WNUT 17 dataset to `nlp`.

> Emerging and Rare entity recognition
> 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 summarisation), 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 entity kktny hard to detect and resolve. This task will evaluate the ability to detect and classify novel, emerging, singleton named entities in noisy text.
> 
> 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.

More information about the dataset can be found on the [shared task page](https://noisy-text.github.io/2017/emerging-rare-entities.html).

Dataset is taken is taken from their [GitHub repository](https://github.com/leondz/emerging_entities_17), because the data provided in this repository contains minor fixes in the dataset format.

## Usage

Then the WNUT 17 dataset can be used in `nlp` like this:

```python
import nlp

wnut_17 = nlp.load_dataset("./datasets/wnut_17/wnut_17.py")

print(wnut_17)
```

This outputs:

```txt
'train': Dataset(schema: {'id': 'string', 'tokens': 'list<item: string>', 'labels': 'list<item: string>'}, num_rows: 3394)
'validation': Dataset(schema: {'id': 'string', 'tokens': 'list<item: string>', 'labels': 'list<item: string>'}, num_rows: 1009)
'test': Dataset(schema: {'id': 'string', 'tokens': 'list<item: string>', 'labels': 'list<item: string>'}, num_rows: 1287)
```

Number are identical with the ones in [this paper](https://www.ijcai.org/Proceedings/2019/0702.pdf) and are the same as using the `dataset` reader in Flair.

## Features

The following feature format is used to represent a sentence in the WNUT 17 dataset:

| Feature | Example | Description
| ---- | ---- | -----------------
| `id` | `0` | Number (id) of current sentence
| `tokens` | `["AHFA", "extends", "deadline"]` | List of tokens (strings) for a sentence
| `labels` | `["B-group", "O", "O"]` | List of labels (outer span)

The following labels are used in WNUT 17:

```txt
O
B-corporation
I-corporation
B-location
I-location
B-product
I-product
B-person
I-person
B-group
I-group
B-creative-work
I-creative-work
```

Comments: The PR looks awesome! 
Since you have already added a dataset I imagine the tests as described in 5. of https://github.com/huggingface/nlp/blob/master/CONTRIBUTING.md#how-to-add-a-dataset all pass, right @stefan-it ?

I think we are then good to merge this :-) @lhoestq 

Nice !

One thing though: I saw that you copied the `dataset_info.json` (one split info), which is different from the `dataset_infos.json` (split infos of all configs) that we expect.

Could you generate the `dataset_infos.json` file using this command please ?
```
python nlp-cli test datasets/wnut_17 --save_infos --all_configs
```

Hi @patrickvonplaten I just rebased onto latest `master` version and executed the commands. All tests passed then :)

@lhoestq thanks for that hint! I've generated and added the `dataset_infos.json` and deleted `dataset_info.json`.

Awesome ! I guess it's ready to be merged now :)