# How to train a model for ner pipeline \[RoBERTa\]

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-train-a-model-for-ner-pipeline-roberta%2F7913%3E%5C
**Category:** Beginners\
**Created:** [July 2, 2021, 2:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-train-a-model-for-ner-pipeline-roberta%2F7913 "2021-07-02T14:22:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrija](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Andrija](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAndrija)%5C
**Post date:** [July 2, 2021, 2:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-train-a-model-for-ner-pipeline-roberta%2F7913%2F1 "2021-07-02T14:22:22Z")

</div>

Greetings,

I have followed the post to train a new model at [How to train a new language model from scratch using Transformers and Tokenizers](https://huggingface.co/blog/how-to-train).  
The result of that training is that made a model **RobertaForMaskedLM** that was then uploaded to huggingface model **Andrija/SRoBERTa**  
(For now this is just a experimental run with smaller dataset and 1 epoch)

However I am interested how would I train the model such as when I load the model and choose “NER” aka “token-classification” in this instance it would be a RobertaForTokenClassification) as pipeline that it won’t give a warning that it is not trained (which I know it is not).

How would I accomplish such a task? I feel I am asking a stupid question, however if you could help I would appreciate it.

Should I just load the model and “finetune” just to train the head

I found some relevant post and I follow the same things and tried to accomplish that **[colab code](https://colab.research.google.com/drive/1ziFKZ6I-678Ync63HpZHLAn9WdFaqx39?usp=sharing)**

However I am am getting:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/c/c33eb20418ee08a51f1b10eb2b52ec48e7579f7a.png)

Any hints are welcome!

Best regards,  
Andrija
