Recognai/bert-base-spanish-wwm-cased-xnli is a forked repo from huggingface. License: mit
Go to file
David 6219d7e4cc Update README.md 2021-10-15 15:55:15 +00:00
.gitattributes allow flax 2021-05-18 21:58:22 +00:00
README.md Update README.md 2021-10-15 15:55:15 +00:00
config.json fix/specify label ids 2021-03-09 09:03:55 +00:00
flax_model.msgpack upload flax model 2021-05-18 21:58:40 +00:00
pytorch_model.bin Add first version 62000 checkpoint (except optimizer.pt/scheduler.pt) 2021-03-08 17:26:53 +01:00
special_tokens_map.json Add first version 62000 checkpoint (except optimizer.pt/scheduler.pt) 2021-03-08 17:26:53 +01:00
tokenizer_config.json Update tokenizer_config.json 2021-03-31 20:53:55 +00:00
trainer_state.json Add first version 62000 checkpoint (except optimizer.pt/scheduler.pt) 2021-03-08 17:26:53 +01:00
training_args.bin Add first version 62000 checkpoint (except optimizer.pt/scheduler.pt) 2021-03-08 17:26:53 +01:00
vocab.txt Add first version 62000 checkpoint (except optimizer.pt/scheduler.pt) 2021-03-08 17:26:53 +01:00
zeroshot_training_script.py add training script 2021-03-08 17:31:21 +01:00

README.md

language tags datasets license pipeline_tag widget
es
zero-shot-classification
nli
pytorch
xnli
mit zero-shot-classification
text candidate_labels
El autor se perfila, a los 50 años de su muerte, como uno de los grandes de su siglo cultura, sociedad, economia, salud, deportes

bert-base-spanish-wwm-cased-xnli

UPDATE, 15.10.2021: Check out our new zero-shot classifiers, much more lightweight and even outperforming this one: zero-shot SELECTRA small and zero-shot SELECTRA medium.

Model description

This model is a fine-tuned version of the spanish BERT model with the Spanish portion of the XNLI dataset. You can have a look at the training script for details of the training.

How to use

You can use this model with Hugging Face's zero-shot-classification pipeline:

from transformers import pipeline
classifier = pipeline("zero-shot-classification", 
                       model="Recognai/bert-base-spanish-wwm-cased-xnli")

classifier(
    "El autor se perfila, a los 50 años de su muerte, como uno de los grandes de su siglo",
    candidate_labels=["cultura", "sociedad", "economia", "salud", "deportes"],
    hypothesis_template="Este ejemplo es {}."
)
"""output
{'sequence': 'El autor se perfila, a los 50 años de su muerte, como uno de los grandes de su siglo',
 'labels': ['cultura', 'sociedad', 'economia', 'salud', 'deportes'],
 'scores': [0.38897448778152466,
  0.22997373342514038,
  0.1658431738615036,
  0.1205764189362526,
  0.09463217109441757]}
"""

Eval results

Accuracy for the test set:

XNLI-es
bert-base-spanish-wwm-cased-xnli 79.9%