mrm8488/bert-spanish-cased-finetuned-ner

Model

Spanish BERT (BETO) + NER

28

30 commits

3 linked in READMEs

updated May 20, 2021

See the code

README

Spanish BERT (BETO) + NER

This model is a fine-tuned on NER-C version of the Spanish BERT cased (BETO) for NER downstream task.

Details of the downstream task (NER) - Dataset

I preprocessed the dataset and split it as train / dev (80/20)

Dataset# Examples
Train8.7 K
Dev2.2 K
B-LOC
B-MISC
B-ORG
B-PER
I-LOC
I-MISC
I-ORG
I-PER
O

Metrics on evaluation set:

Metric# score
F190.17
Precision89.86
Recall90.47

Comparison:

Model# F1 scoreSize(MB)
bert-base-spanish-wwm-cased (BETO)88.43421
bert-spanish-cased-finetuned-ner (this one)90.17420
Best Multilingual BERT87.38681
TinyBERT-spanish-uncased-finetuned-ner70.0055

Model in action

Fast usage with pipelines:

from transformers import pipeline

nlp_ner = pipeline(
    "ner",
    model="mrm8488/bert-spanish-cased-finetuned-ner",
    tokenizer=(
        'mrm8488/bert-spanish-cased-finetuned-ner',  
        {"use_fast": False}
))

text = 'Mis amigos están pensando viajar a Londres este verano'

nlp_ner(text)

#Output: [{'entity': 'B-LOC', 'score': 0.9998720288276672, 'word': 'Londres'}]

Created by Manuel Romero/@mrm8488

Made with ♥ in Spain

bert
endpoints_compatible
pytorch
token-classification
transformers

mrm8488/bert-spanish-cased-finetuned-ner

Model

Spanish BERT (BETO) + NER

28

30 commits

3 linked in READMEs

updated May 20, 2021

See the code

README

Spanish BERT (BETO) + NER

This model is a fine-tuned on NER-C version of the Spanish BERT cased (BETO) for NER downstream task.

Details of the downstream task (NER) - Dataset

I preprocessed the dataset and split it as train / dev (80/20)

Dataset# Examples
Train8.7 K
Dev2.2 K
B-LOC
B-MISC
B-ORG
B-PER
I-LOC
I-MISC
I-ORG
I-PER
O

Metrics on evaluation set:

Metric# score
F190.17
Precision89.86
Recall90.47

Comparison:

Model# F1 scoreSize(MB)
bert-base-spanish-wwm-cased (BETO)88.43421
bert-spanish-cased-finetuned-ner (this one)90.17420
Best Multilingual BERT87.38681
TinyBERT-spanish-uncased-finetuned-ner70.0055

Model in action

Fast usage with pipelines:

from transformers import pipeline

nlp_ner = pipeline(
    "ner",
    model="mrm8488/bert-spanish-cased-finetuned-ner",
    tokenizer=(
        'mrm8488/bert-spanish-cased-finetuned-ner',  
        {"use_fast": False}
))

text = 'Mis amigos están pensando viajar a Londres este verano'

nlp_ner(text)

#Output: [{'entity': 'B-LOC', 'score': 0.9998720288276672, 'word': 'Londres'}]

Created by Manuel Romero/@mrm8488

Made with ♥ in Spain

bert
endpoints_compatible
pytorch
token-classification
transformers