BertForTokenClassification for NER . what is the conclusion of  this output ?
## ❓ Questions & Help

<!-- A clear and concise description of the question. -->
Hi ,
Im trying to perform NER using BertForTokenClassification  .I saw this sample code in transformers GIT page. 

from transformers import BertForTokenClassification
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = BertForTokenClassification.from_pretrained('bert-base-uncased')
input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute")).unsqueeze(0)  # Batch size 1
labels = torch.tensor([1] * input_ids.size(1)).unsqueeze(0)  # Batch size 1
print(labels)
outputs = model(input_ids, labels=labels)
loss, scores = outputs[:2]



output loss:
tensor(0.5975, grad_fn=<NllLossBackward>)

output scores:

tensor([[[-0.1622,  0.1824],
         [-0.1552, -0.0534],
         [-0.3032, -0.1166],
         [-0.2453, -0.1182],
         [-0.4388, -0.1898],
         [-0.3159, -0.1067]]], grad_fn=<AddBackward0>)

1.When i printed the loss and score i got below values .Now how should i infer this output ? what dose these value represent for  performing NER ? what should i do to get the NER tags for the sentence "Hello, my dog is cute" .


2.i referred few NER codes in GIT using BERT  and they have  humongous line of code written for performing the NER . Is there any simple way to perform NER using bert ?  like how Flair library has very simple method for performing the NER task ? 


Why not just use flair? Flair has integrated BERT.<|||||>BERT was performing sentence embedding better than Flair(tired all different type of stacked embedding ) but  less when compared to USC . Flair had a functionality that gave NER tagging directly .  i was expecting the same will would be available in BERT but its not available directly .It would be good if BERT gives a direct plug and play functionality for NER task  . <|||||>@ajbot2019 

1. compute prediction list
https://github.com/huggingface/transformers/blob/master/examples/run_ner.py#L242

2. print it with 
https://github.com/huggingface/transformers/blob/master/examples/run_ner.py#L503

shell scripts to train and evaluate for CoNLL 2003 (english) dataset.
https://github.com/dsindex/transformers_examples
this may help you.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
