CoolFace
Modelpublic

Tirendaz/roberta-base-NER

sourceHugging Facemitupdated 3y agoView on Hugging Face
3likes90downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

roberta-base-NER

Model description

xlm-roberta-base-multilingual-cased-ner is a Named Entity Recognition model based on a fine-tuned XLM-RoBERTa base model. It has been trained to recognize three types of entities: location (LOC), organizations (ORG), and person (PER). Specifically, this model is a XLMRoreberta-base-multilingual-cased model that was fine-tuned on an aggregation of 10 high-resourced languages.

Intended uses & limitations

How to use

You can use this model with Transformers pipeline for NER.

python
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("Tirendaz/multilingual-xlm-roberta-for-ner")
model = AutoModelForTokenClassification.from_pretrained("Tirendaz/multilingual-xlm-roberta-for-ner")

nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "My name is Wolfgang and I live in Berlin"

ner_results = nlp(example)
print(ner_results)
AbbreviationDescription
OOutside of a named entity
B-PERBeginning of a person’s name right after another person’s name
I-PERPerson’s name
B-ORGBeginning of an organisation right after another organisation
I-ORGOrganisation
B-LOCBeginning of a location right after another location
I-LOCLocation

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 2e-05
  • —trainbatchsize: 24
  • —evalbatchsize: 24
  • —seed: 42
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: linear
  • —num_epochs: 5

Training results

Training LossEpochStepValidation LossPrecisionRecallF1Accuracy
No log1.04170.33590.72860.76750.74760.8991
0.42272.08340.29510.77110.79800.78430.9131
0.28183.012510.28240.78520.80760.79620.9174
0.21864.016680.28530.79340.81500.80410.9193
0.18015.020850.29350.80040.81110.80570.9194

Framework versions

  • —Transformers 4.33.0
  • —Pytorch 2.0.0
  • —Datasets 2.1.0
  • —Tokenizers 0.13.3