# XML RoBERTa Multilanguage NER with OntoNotes 5 dataset

**URL:** <https://discuss.huggingface.co/t/xml-roberta-multilanguage-ner-with-ontonotes-5-dataset/4251>\
**Category:** Beginners\
**Created:** [March 8, 2021, 10:01pm UTC](https://discuss.huggingface.co/t/xml-roberta-multilanguage-ner-with-ontonotes-5-dataset/4251 "2021-03-08T22:01:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Constantin](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@Constantin](https://discuss.huggingface.co/u/Constantin)\
**Post date:** [March 8, 2021, 10:01pm UTC](https://discuss.huggingface.co/t/xml-roberta-multilanguage-ner-with-ontonotes-5-dataset/4251/1 "2021-03-08T22:01:08Z")

</div>

Hi

I would like to fine-tune XML RoBERTa for multilanguage NER with OntoNotes 5 dataset, but I really can’t understand how to do that. Honestly, I read the paper and I know the theory behind this process, but I can’t understand how to that with transformers module! I did not find any relevant example for it!

For now, I have my ontonotes5 data in the following form:

```
('لكن', 'O'),

```

(‘وزارة الداخلية الباكستانية’, ‘ORG’),  
(‘وزارة’, ‘O’),  
(‘الداخلية’, ‘O’),  
(‘الباكستانية’, ‘O’),  
(‘قالت’, ‘O’),  
(‘ان’, ‘O’),  
(‘11’, ‘CARDINAL’),  
(‘11’, ‘O’),  
(‘شخصا’, ‘O’),  
(‘ً قتلوا’, ‘O’),

and this model: [xlm-roberta-large · Hugging Face](https://huggingface.co/xlm-roberta-large)

---

<div class="post-metadata">

**Author:** ![lewtun](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lewtun/32/30995_2.png) [@lewtun](https://discuss.huggingface.co/u/lewtun)\
**Post date:** [March 8, 2021, 10:27pm UTC](https://discuss.huggingface.co/t/xml-roberta-multilanguage-ner-with-ontonotes-5-dataset/4251/2 "2021-03-08T22:27:46Z")

</div>

Hi @Constantin, there’s a detailed tutorial here on using `transformers` for NER: [https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/token\_classification.ipynb#scrollTo=545PP3o8IrJV](https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/token_classification.ipynb#scrollTo=545PP3o8IrJV)

I’ve been able to use it with XLM-R without problems. In your case, the main work will be loading your dataset into a `datasets.Dataset` object (recommended for fast processing!). For that see the docs [here](https://huggingface.co/docs/datasets/loading_datasets.html) or look at how one of the NER datasets is implemented to understand how the features need to be defined, e.g. [GermanNER](https://github.com/huggingface/datasets/blob/master/datasets/germaner/germaner.py)
