NER Pipeline with CamemBERT not showing entities
Author: laubil
Pull request: no

Hi,

Using NER pipeline with CamemBERT, I am only getting "LABEL_O" and "LABEL_I" as entities.

```
from transformers import pipeline
import torch

nlp = pipeline(task='ner', model="camembert-base", tokenizer="camembert-base", framework='pt', device=0)

sequence = "Lundi, David ira au magasin Printemps de Lille pour acheter du vin."
print(nlp(sequence))
```
output:
`[{'word': '
', 'score': 0.5307311415672302, 'entity': 'LABEL_0'}, {'word': 'Lundi', 'score': 0.537407636642456, 'entity': 'LABEL_1'}, {'word': ',', 'score': 0.5144394040107727, 'entity': 'LABEL_1'}, {'word': 'David', 'score': 0.5270906090736389, 'entity': 'LABEL_1'}, {'word': 'ira', 'score': 0.5355848073959351, 'entity': 'LABEL_1'}, {'word': 'au', 'score': 0.5498790740966797, 'entity': 'LABEL_1'}, {'word': 'magasin', 'score': 0.5076472163200378, 'entity': 'LABEL_1'}, {'word': 'Printemps', 'score': 0.530289351940155, 'entity': 'LABEL_1'}, {'word': 'de', 'score': 0.5026782155036926, 'entity': 'LABEL_0'}, {'word': 'Lille', 'score': 0.5144190192222595, 'entity': 'LABEL_1'}, {'word': 'pour', 'score': 0.5344067215919495, 'entity': 'LABEL_1'}, {'word': 'acheter', 'score': 0.550661563873291, 'entity': 'LABEL_1'}, {'word': 'du', 'score': 0.5307605266571045, 'entity': 'LABEL_1'}, {'word': 'vin', 'score': 0.5279666781425476, 'entity': 'LABEL_1'}, {'word': '.', 'score': 0.5378196835517883, 'entity': 'LABEL_0'}, {'word': '
', 'score': 0.523155927658081, 'entity': 'LABEL_0'}]
`


Entity only takes the LABEL_0 and LABEL_1 values. I would have expected entity to be: "Person", "Location", "Organisation" etc or something along those lines.

set up:
transformers: 2.5.0 (similar outcomes with versions 2.7 and 2.8, but for some reason the word tagging is cleaner in 2.5, a "_" is added in front of the words in 2.7 and 2.8)
Python: 3.6.9
torch: 1.5.0
Linux Ubuntu 18.04

Many thanks for your help!

Comments:
I think this is because Camembert has not been fine-tuned on a NER task yet. 

In the documentation they specify : "The models that this pipeline (ie. ner) can use are models that have been fine-tuned on a token classification task. See the up-to-date list of available models on huggingface.co/models."

If you need to use Camembert for a named entity recognition task you must wait for a model to be uploaded or you can fine-tune it on your own/open data. 

I had missed that point. Thanks a lot!

@ColleterVi Do you have any resouces on how to fine tune camemBert for NER task on a specifie domain dataset.

@MouadBH   I don't have a link but you can just follow the three steps


## Step 1: Create config object according to dataset labels
from transformers import AutoConfig, AutoTokenizer, AutoModelForTokenClassification

config = AutoConfig.from_pretrained("Jean-Baptiste/camembert-base") 
label2id = {
    "I-LOC": 1,
    "I-MISC": 3,
    "I-ORG": 4,
    "I-PER": 2,
    "O": 0,
}
id2label = {y:x for x,y in label2id.items()}
config.__setattr__("id2label", id2label)
config.__setattr__("label2id", label2id)
config.__setattr__("num_labels", 5)

## Step 2: Change the tokenizer config attribute
tokenizer = AutoTokenizer.from_pretrained("camembert-base")
tokenizer.config = config

## Step 3: Change the model config attribute
model = AutoModelForTokenClassification.from_pretrained("Jean-Baptiste/camembert-base", num_labels=6)
model.config = config