Downloads · 30 days
13
1% of all-time downloads
gunghio/xlm-roberta-base-finetuned-panx-ner
xlm-roberta-base-finetuned-panx-ner is a token classification model from gunghio. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
This model was trained starting from xlm-roberta-base on a subset of xtreme dataset.
Downloads · 30 days
13
1% of all-time downloads
All-time downloads
2.1K
Public
Parameters
277M
2.2 GB on disk
Likes
1
Public
Click a slice to open those files.
.bin1.1 GB · 50%
How the weights are stored.
F32277M · 100%
From the Hugging Face model README
This model was trained starting from xlm-roberta-base on a subset of xtreme dataset.
xtreme datasets subsets used are: PAN-X.{lang}. Language used for training/validation are: italian, english, german, french and spanish.
Only 75% of the whole dataset was used.
Fine-tuned model can be used for Named Entity Recognition in it, en, de, fr, and es.
Training dataset: xtreme
It achieves the following results on the evaluation set:
Details:
| Label | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| PER | 0.922 | 0.908 | 0.915 | 26639 |
| LOC | 0.880 | 0.906 | 0.892 | 37623 |
| ORG | 0.821 | 0.816 | 0.818 | 28045 |
| Overall | 0.874 | 0.879 | 0.877 | 92307 |
Set aggregation stragey according to documentation.
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("gunghio/xlm-roberta-base-finetuned-panx-ner")
model = AutoModelForTokenClassification.from_pretrained("gunghio/xlm-roberta-base-finetuned-panx-ner")
nlp = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="first")
example = "My name is Wolfgang and I live in Berlin"
ner_results = nlp(example)
print(ner_results)