# [ENAP] Reconhecimento de Entidades Nomeadas — Data

来源：https://www.kaggle.com/competitions/enap-reconhecimento-de-entidades-nomeadas/data

本地 Meta Kaggle 快照；不是本次实时页面。

# Dataset Description

## Base de treinamento

A base de treinamento contém o `id`, os `tokens` e o `ner_tags` em uma lista. 


|  id  | tokens                                                                                                  | ner_tags                              |
|------|---------------------------------------------------------------------------------------------------------|---------------------------------------|
| 0  | ['EU', 'rejects', 'German', 'call', 'to', 'boycott', 'British', 'lamb', '.']                           | [3, 0, 7, 0, 0, 0, 7, 0, 0]           |
| 1  | ['Peter', 'Blackburn']                                                                                  | [1, 2]                                |
| 2  | ['BRUSSELS', '1996-08-22']                                                                              | [5, 0]                                |
| 3  | ['The', 'European', 'Commission', 'said', 'on', 'Thursday', 'it', 'disagreed', 'with', 'German', 'advice', 'to', 'consumers', 'to', 'shun', 'British', 'lamb', 'until', 'scientists', 'determine', 'whether', 'mad', 'cow', 'disease', 'can', 'be', 'transmitted', 'to', 'sheep', '.'] | [0, 3, 4, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
| 4  | ['Germany', "'s", 'representative', 'to', 'the', 'European', 'Union', "'s", 'veterinary', 'committee', 'Werner', 'Zwingmann', 'said', 'on', 'Wednesday', 'consumers', 'should', 'buy', 'sheepmeat', 'from', 'countries', 'other', 'than', 'Britain', 'until', 'the', 'scientific', 'advice', 'was', 'clearer', '.'] | [5, 0, 0, 0, 0, 3, 4, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0] |

<br>A base de treinamento pode ser acessada com as seguintes linhas de código:

```python
!pip install -q datasets 
from datasets import load_dataset
train_dataset = load_dataset("conll2003", split="train")
```
As informações relevantes para a tarefa de NER são as chaves `tokens` e `ner_tags`.

```python
words = train_dataset['tokens']
ner_tags = train_dataset['ner_tags']
```
Exemplo de amostra de treinamento:

```python
>>> words[0]
['EU', 'rejects', 'German', 'call', 'to', 'boycott', 'British', 'lamb', '.']
>>> ner_tags[0]
[3, 0, 7, 0, 0, 0, 7, 0, 0]
```

## Base de teste

A base de teste contém o `id` e os `tokens` em uma lista. 

| id   | tokens                                       |
|------|----------------------------------------------|
| 2619 | ['(', '52.76', '/', '53.18', ')']           |
| 456  | ['WESTERN', 'CONFERENCE']                   |
| 102  | ['Wasim', 'Akram', 'b', 'Harris', '4']      |
| 3037 | ['Mansfield', '21', '5', '9', '7', '21', '22', '24'] |
| 1126 | ['--', 'New', 'York', 'Commodities', 'Desk', ',', '212-859-1640'] |

<br>A base de teste pode ser lida com as seguintes linhas de código:

```python
import pandas as pd
from datasets import Dataset

test_dataset = pd.read_csv('test.csv')
test_dataset = Dataset.from_pandas(test_dataset)
```

A informação relevante para a tarefa de NER são os tokens:

```python
words = test_dataset['tokens']
```