# Generating NER data sample for RoBERTa model

**URL:** <https://discuss.huggingface.co/t/generating-ner-data-sample-for-roberta-model/972>\
**Category:** 🤗Transformers\
**Created:** [September 3, 2020, 10:06am UTC](https://discuss.huggingface.co/t/generating-ner-data-sample-for-roberta-model/972 "2020-09-03T10:06:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![proxyht](https://avatars.discourse-cdn.com/v4/letter/p/3bc359/32.png) [@proxyht](https://discuss.huggingface.co/u/proxyht)\
**Post date:** [September 3, 2020, 10:06am UTC](https://discuss.huggingface.co/t/generating-ner-data-sample-for-roberta-model/972/1 "2020-09-03T10:06:32Z")

</div>

I have a trained RoBERTa model with a Byte Level BPE Encoding algorithm, which I want to benchmark on a custom NER dataset.  
Each sample is as followed:

Text: John is playing football  
Labels: B-PER O O O

The text could be run through the tokenizer to generate subword tokens. However, the total count of the subwords tokens may be different from the text tokens, and I don’t know how to align the labels accordingly

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [September 6, 2020, 8:16am UTC](https://discuss.huggingface.co/t/generating-ner-data-sample-for-roberta-model/972/2 "2020-09-06T08:16:06Z")

</div>

cc @stefan-it

---

<div class="post-metadata">

**Author:** ![proxyht](https://avatars.discourse-cdn.com/v4/letter/p/3bc359/32.png) [@proxyht](https://discuss.huggingface.co/u/proxyht)\
**Post date:** [September 14, 2020, 1:53am UTC](https://discuss.huggingface.co/t/generating-ner-data-sample-for-roberta-model/972/3 "2020-09-14T01:53:56Z")

</div>

Hello, it’s this topiv still relevant?

Vào 15:26, CN, 6 Th9, 2020 Suraj Patil via Hugging Face Forums \<[hellohellohello@discoursemail.com](mailto:hellohellohello@discoursemail.com)\> đã viết:

---

<div class="post-metadata">

**Author:** ![nbroad](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nbroad/32/26465_2.png) [@nbroad](https://discuss.huggingface.co/u/nbroad)\
**Post date:** [September 14, 2020, 2:11am UTC](https://discuss.huggingface.co/t/generating-ner-data-sample-for-roberta-model/972/4 "2020-09-14T02:11:16Z")

</div>

Maybe something in here can help you:

[https://github.com/huggingface/transformers/tree/master/examples/token-classification](https://github.com/huggingface/transformers/tree/master/examples/token-classification)
