# How to use GPT2 to do NER task?

**URL:** <https://discuss.huggingface.co/t/how-to-use-gpt2-to-do-ner-task/5267>\
**Category:** 🤗Transformers\
**Created:** [April 2, 2021, 12:39am UTC](https://discuss.huggingface.co/t/how-to-use-gpt2-to-do-ner-task/5267 "2021-04-02T00:39:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sy1ar](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@sy1ar](https://discuss.huggingface.co/u/sy1ar)\
**Post date:** [April 2, 2021, 12:39am UTC](https://discuss.huggingface.co/t/how-to-use-gpt2-to-do-ner-task/5267/1 "2021-04-02T00:39:15Z")

</div>

Now I am facing a problem that how to use GPT2 to do NER tasks. Because other models like BERT can use BertForTokenClassification but GPT2 does not have. So I am wondering how to use GPT2 to do the NER task.
