
# RoBERTa for Multilingual Named Entity Recognition

## Model Description

This model detects entities by classifying every token according to the IOB format:

```python
['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC']
```

You can find the code in [this](https://github.com/julianschelb/roberta-ner-multilingual) GitHub repository.

## Training Data

This model was fine-tuned on a portion of the [wikiann](https://huggingface.co/datasets/wikiann) dataset corresponding to the following languages:

```python
["en","de", "fr",
 "zh", "it", "es",
 "hi", "bn", "ar",
 "ru", "uk", "pt",
 "ur", "id", "ja",
 "ne", "nl", "tr",
 "ca", "bg", "zh-yue"]
```

The model was fine-tuned on 375.100 sentences in the training set, with a validation set of 173.100 examples. Performance metrics reported are based on additional 173.100 examples. The complete WikiANN dataset includes training examples for 282 languages and was constructed from Wikipedia. Training examples are extracted in an automated manner, exploiting entities mentioned in Wikipedia articles, often are formatted as hyperlinks to the source article. Provided NER tags are in the IOB2 format. Named entities are classified as location (LOC), person (PER), or organization (ORG). 

## Evaluation Results

This model achieves the following results (meassured using the test split of the [wikiann](https://huggingface.co/datasets/wikiann) dataset):

```python
{'LOC': {'f1': 0.8994491397524903,
         'number': 184430,
         'precision': 0.8941572985543279,
         'recall': 0.9048039906739684},
 'ORG': {'f1': 0.829114679375883,
         'number': 129760,
         'precision': 0.8283525257886599,
         'recall': 0.8298782367447596},
 'PER': {'f1': 0.9115096398413828,
         'number': 130471,
         'precision': 0.9043545174723882,
         'recall': 0.9187788857293958},
 'overall_accuracy': 0.9398182274831388,
 'overall_f1': 0.8825581369330908,
 'overall_precision': 0.8781215422873389,
 'overall_recall': 0.8870397898623895}
```

## Usage

You can load this model by using the AutoTokenize and AutoModelForTokenClassification classes:

```python
from transformers import AutoTokenizer, AutoModelForTokenClassification 

tokenizer = AutoTokenizer.from_pretrained("julian-schelb/roberta-ner-multilingual/", add_prefix_space=True)                          
model = AutoModelForTokenClassification.from_pretrained("julian-schelb/roberta-ner-multilingual/")

text = "In December 1903 in France the Royal Swedish Academy of Sciences awarded Pierre Curie, Marie Curie, and Henri Becquerel the Nobel Prize in Physics."

inputs = tokenizer(
    text, 
    add_special_tokens=False, 
    return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]
predicted_tokens_classes
```


## About RoBERTa

This model is a fine-tuned version of [XLM-RoBERTa](https://huggingface.co/xlm-roberta-large). The original model was pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper [Unsupervised Cross-lingual Representation Learning at Scale](https://arxiv.org/abs/1911.02116) by Conneau et al. and first released in [this repository](https://github.com/pytorch/fairseq/tree/master/examples/xlmr). 

RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.

More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.

This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa model as inputs.

#### Limitations and Bias

This model is limited by its training dataset of entity-annotated news articles from a specific span of time. This may not generalize well for all use cases in different domains.  

## Related Papers

* Pan, X., Zhang, B., May, J., Nothman, J., Knight, K., & Ji, H. (2017). Cross-lingual Name Tagging and Linking for 282 Languages. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) (pp. 1946–1958). Association for Computational Linguistics.
* Rahimi, A., Li, Y., & Cohn, T. (2019). Massively Multilingual Transfer for NER. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (pp. 151–164). Association for Computational Linguistics.
* Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., & Stoyanov, V.. (2019). RoBERTa: A Robustly Optimized BERT Pretraining Approach. 


## Citation

This model has been fine-tuned for the research paper indicated below:

```bibtex
@inproceedings{schelbECCEEntitycentricCorpus2022,
	title = {{ECCE}: {Entity}-centric {Corpus} {Exploration} {Using} {Contextual} {Implicit} {Networks}},
	url = {https://dl.acm.org/doi/10.1145/3487553.3524237},
	booktitle = {Companion {Proceedings} of the {Web} {Conference} 2022},
	author = {Schelb, Julian and Ehrmann, Maud and Romanello, Matteo and Spitz, Andreas},
	year = {2022},
}

```

{"language": ["en", "de", "fr", "zh", "it", "es", "hi", "bn", "ar", "ru", "uk", "pt", "ur", "id", "ja", "ne", "nl", "tr", "ca", "bg", "yue"], "license": "mit", "tags": ["roberta", "ner", "nlp"], "datasets": ["wikiann"], "metrics": ["f1", "precision", "accuracy", "recall"], "widget": [{"text": "In December 1903 in France the Royal Swedish Academy of Sciences awarded Pierre Curie, Marie Curie, and Henri Becquerel the Nobel Prize in Physics."}, {"text": "F\u00fcr Richard Phillips Feynman war es immer wichtig in New York, die unanschaulichen Gesetzm\u00e4\u00dfigkeiten der Quantenphysik Laien und Studenten nahezubringen und verst\u00e4ndlich zu machen."}, {"text": "Terence David John Pratchett est n\u00e9 le 28 avril 1948 \u00e0 Beaconsfield dans le Buckinghamshire, en Angleterre."}, {"text": "\u5317\u4eac\u5e02\uff0c\u901a\u79f0\u5317\u4eac\uff08\u6c49\u8bed\u62fc\u97f3\uff1aB\u011bij\u012bng\uff1b\u90ae\u653f\u5f0f\u62fc\u97f3\uff1aPeking\uff09\uff0c\u7b80\u79f0\u201c\u4eac\u201d\uff0c\u662f\u4e2d\u534e\u4eba\u6c11\u5171\u548c\u56fd\u7684\u9996\u90fd\u53ca\u76f4\u8f96\u5e02\uff0c\u662f\u8be5\u56fd\u7684\u653f\u6cbb\u3001\u6587\u5316\u3001\u79d1\u6280\u3001\u6559\u80b2\u3001\u519b\u4e8b\u548c\u56fd\u9645\u4ea4\u5f80\u4e2d\u5fc3\uff0c\u662f\u4e00\u5ea7\u5168\u7403\u57ce\u5e02\uff0c\u662f\u4e16\u754c\u4eba\u53e3\u7b2c\u4e09\u591a\u7684\u57ce\u5e02\u548c\u4eba\u53e3\u6700\u591a\u7684\u9996\u90fd\uff0c\u5177\u6709\u91cd\u8981\u7684\u56fd\u9645\u5f71\u54cd\u529b\uff0c\u540c\u6642\u4e5f\u662f\u76ee\u524d\u4e16\u754c\u552f\u4e00\u7684\u201c\u53cc\u5965\u4e4b\u57ce\u201d\uff0c\u5373\u552f\u4e00\u65e2\u4e3b\u529e\u8fc7\u590f\u5b63"}]}
transformers pytorch safetensors xlm-roberta token-classification roberta ner nlp en de fr zh it es hi bn ar ru uk pt ur id ja ne nl tr ca bg yue dataset:wikiann arxiv:1911.02116 license:mit autotrain_compatible endpoints_compatible region:us
TAGS
#transformers #pytorch #safetensors #xlm-roberta #token-classification #roberta #ner #nlp #en #de #fr #zh #it #es #hi #bn #ar #ru #uk #pt #ur #id #ja #ne #nl #tr #ca #bg #yue #dataset-wikiann #arxiv-1911.02116 #license-mit #autotrain_compatible #endpoints_compatible #region-us 


# RoBERTa for Multilingual Named Entity Recognition

## Model Description

This model detects entities by classifying every token according to the IOB format:



You can find the code in this GitHub repository.

## Training Data

This model was fine-tuned on a portion of the wikiann dataset corresponding to the following languages:



The model was fine-tuned on 375.100 sentences in the training set, with a validation set of 173.100 examples. Performance metrics reported are based on additional 173.100 examples. The complete WikiANN dataset includes training examples for 282 languages and was constructed from Wikipedia. Training examples are extracted in an automated manner, exploiting entities mentioned in Wikipedia articles, often are formatted as hyperlinks to the source article. Provided NER tags are in the IOB2 format. Named entities are classified as location (LOC), person (PER), or organization (ORG). 

## Evaluation Results

This model achieves the following results (meassured using the test split of the wikiann dataset):



## Usage

You can load this model by using the AutoTokenize and AutoModelForTokenClassification classes:




## About RoBERTa

This model is a fine-tuned version of XLM-RoBERTa. The original model was pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al. and first released in this repository. 

RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.

More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.

This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa model as inputs.

#### Limitations and Bias

This model is limited by its training dataset of entity-annotated news articles from a specific span of time. This may not generalize well for all use cases in different domains.  

## Related Papers

* Pan, X., Zhang, B., May, J., Nothman, J., Knight, K., & Ji, H. (2017). Cross-lingual Name Tagging and Linking for 282 Languages. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) (pp. 1946–1958). Association for Computational Linguistics.
* Rahimi, A., Li, Y., & Cohn, T. (2019). Massively Multilingual Transfer for NER. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (pp. 151–164). Association for Computational Linguistics.
* Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., & Stoyanov, V.. (2019). RoBERTa: A Robustly Optimized BERT Pretraining Approach. 


This model has been fine-tuned for the research paper indicated below:



# RoBERTa for Multilingual Named Entity Recognition ## Model Description

This model detects entities by classifying every token according to the IOB format:



You can find the code in this GitHub repository. ## Training Data

This model was fine-tuned on a portion of the wikiann dataset corresponding to the following languages:



The model was fine-tuned on 375.100 sentences in the training set, with a validation set of 173.100 examples. Performance metrics reported are based on additional 173.100 examples. The complete WikiANN dataset includes training examples for 282 languages and was constructed from Wikipedia. Training examples are extracted in an automated manner, exploiting entities mentioned in Wikipedia articles, often are formatted as hyperlinks to the source article. Provided NER tags are in the IOB2 format. Named entities are classified as location (LOC), person (PER), or organization (ORG). ## Evaluation Results

This model achieves the following results (meassured using the test split of the wikiann dataset): ## Usage

You can load this model by using the AutoTokenize and AutoModelForTokenClassification classes: ## About RoBERTa

This model is a fine-tuned version of XLM-RoBERTa. The original model was pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al. and first released in this repository. 

RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.

More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.

This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa model as inputs. #### Limitations and Bias

This model is limited by its training dataset of entity-annotated news articles from a specific span of time. This may not generalize well for all use cases in different domains. ## Related Papers

* Pan, X., Zhang, B., May, J., Nothman, J., Knight, K., & Ji, H. (2017). Cross-lingual Name Tagging and Linking for 282 Languages. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) (pp. 1946–1958). Association for Computational Linguistics.
* Rahimi, A., Li, Y., & Cohn, T. (2019). Massively Multilingual Transfer for NER. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (pp. 151–164). Association for Computational Linguistics.
* Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., & Stoyanov, V.. (2019). RoBERTa: A Robustly Optimized BERT Pretraining Approach. 


This model has been fine-tuned for the research paper indicated below:
TAGS
#transformers #pytorch #safetensors #xlm-roberta #token-classification #roberta #ner #nlp #en #de #fr #zh #it #es #hi #bn #ar #ru #uk #pt #ur #id #ja #ne #nl #tr #ca #bg #yue #dataset-wikiann #arxiv-1911.02116 #license-mit #autotrain_compatible #endpoints_compatible #region-us 
 # RoBERTa for Multilingual Named Entity Recognition ## Model Description

This model detects entities by classifying every token according to the IOB format:



You can find the code in this GitHub repository. ## Training Data

This model was fine-tuned on a portion of the wikiann dataset corresponding to the following languages:



The model was fine-tuned on 375.100 sentences in the training set, with a validation set of 173.100 examples. Performance metrics reported are based on additional 173.100 examples. The complete WikiANN dataset includes training examples for 282 languages and was constructed from Wikipedia. Training examples are extracted in an automated manner, exploiting entities mentioned in Wikipedia articles, often are formatted as hyperlinks to the source article. Provided NER tags are in the IOB2 format. Named entities are classified as location (LOC), person (PER), or organization (ORG). ## Evaluation Results

This model achieves the following results (meassured using the test split of the wikiann dataset): ## Usage

You can load this model by using the AutoTokenize and AutoModelForTokenClassification classes: ## About RoBERTa

This model is a fine-tuned version of XLM-RoBERTa. The original model was pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al. and first released in this repository. 

RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.

More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.

This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa model as inputs. #### Limitations and Bias

This model is limited by its training dataset of entity-annotated news articles from a specific span of time. This may not generalize well for all use cases in different domains. ## Related Papers

* Pan, X., Zhang, B., May, J., Nothman, J., Knight, K., & Ji, H. (2017). Cross-lingual Name Tagging and Linking for 282 Languages. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) (pp. 1946–1958). Association for Computational Linguistics.
* Rahimi, A., Li, Y., & Cohn, T. (2019). Massively Multilingual Transfer for NER. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (pp. 151–164). Association for Computational Linguistics.
* Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., & Stoyanov, V.. (2019). RoBERTa: A Robustly Optimized BERT Pretraining Approach. 


This model has been fine-tuned for the research paper indicated below:
passage: TAGS
#transformers #pytorch #safetensors #xlm-roberta #token-classification #roberta #ner #nlp #en #de #fr #zh #it #es #hi #bn #ar #ru #uk #pt #ur #id #ja #ne #nl #tr #ca #bg #yue #dataset-wikiann #arxiv-1911.02116 #license-mit #autotrain_compatible #endpoints_compatible #region-us 
# RoBERTa for Multilingual Named Entity Recognition## Model Description

This model detects entities by classifying every token according to the IOB format:



You can find the code in this GitHub repository.## Training Data

This model was fine-tuned on a portion of the wikiann dataset corresponding to the following languages:



The model was fine-tuned on 375.100 sentences in the training set, with a validation set of 173.100 examples. Performance metrics reported are based on additional 173.100 examples. The complete WikiANN dataset includes training examples for 282 languages and was constructed from Wikipedia. Training examples are extracted in an automated manner, exploiting entities mentioned in Wikipedia articles, often are formatted as hyperlinks to the source article. Provided NER tags are in the IOB2 format. Named entities are classified as location (LOC), person (PER), or organization (ORG).## Evaluation Results

This model achieves the following results (meassured using the test split of the wikiann dataset):## Usage

You can load this model by using the AutoTokenize and AutoModelForTokenClassification classes: