huggingface/distilbert-base-uncased-finetuned-sst-2-english is a forked repo from huggingface. License: apache-2-0
Go to file
lewtun 324d309756 Add evaluation results on the default config of sst2 (#9)
- Add evaluation results on the default config of sst2 (b5d312631216610c427dbde4a82edfabd1a5f962)


Co-authored-by: Evaluation Bot <autoevaluator@users.noreply.huggingface.co>
2022-08-16 13:26:26 +00:00
.gitattributes initial commit 2019-12-13 15:30:34 +00:00
README.md Add evaluation results on the default config of sst2 (#9) 2022-08-16 13:26:26 +00:00
config.json Update config.json 2020-04-24 15:58:05 +00:00
map.jpeg Include bias mention to model card. 2022-03-22 15:16:31 -04:00
pytorch_model.bin Update pytorch_model.bin 2020-01-10 17:03:55 +00:00
rust_model.ot Update rust_model.ot 2020-04-24 20:23:37 +00:00
tf_model.h5 Update tf_model.h5 2020-01-10 17:03:55 +00:00
tokenizer_config.json Create tokenizer_config.json 2021-02-09 07:59:22 +00:00
vocab.txt Update vocab.txt 2019-12-13 15:30:37 +00:00

README.md

language license datasets model-index
en apache-2.0
sst2
glue
name results
distilbert-base-uncased-finetuned-sst-2-english
task dataset metrics
type name
text-classification Text Classification
name type config split
glue glue sst2 validation
name type value verified
Accuracy accuracy 0.9105504587155964 true
name type value verified
Precision precision 0.8978260869565218 true
name type value verified
Recall recall 0.9301801801801802 true
name type value verified
AUC auc 0.9716626673402374 true
name type value verified
F1 f1 0.9137168141592922 true
name type value verified
loss loss 0.39013850688934326 true
task dataset metrics
type name
text-classification Text Classification
name type config split
sst2 sst2 default train
name type value verified
Accuracy accuracy 0.9885521685548412 true
name type value verified
Precision Macro precision 0.9881965062029833 true
name type value verified
Precision Micro precision 0.9885521685548412 true
name type value verified
Precision Weighted precision 0.9885639626373408 true
name type value verified
Recall Macro recall 0.9886145346602994 true
name type value verified
Recall Micro recall 0.9885521685548412 true
name type value verified
Recall Weighted recall 0.9885521685548412 true
name type value verified
F1 Macro f1 0.9884019815052447 true
name type value verified
F1 Micro f1 0.9885521685548412 true
name type value verified
F1 Weighted f1 0.9885546181087554 true
name type value verified
loss loss 0.040652573108673096 true

DistilBERT base uncased finetuned SST-2

Table of Contents

Model Details

Model Description: This model is a fine-tune checkpoint of DistilBERT-base-uncased, fine-tuned on SST-2. This model reaches an accuracy of 91.3 on the dev set (for comparison, Bert bert-base-uncased version reaches an accuracy of 92.7).

  • Developed by: Hugging Face
  • Model Type: Text Classification
  • Language(s): English
  • License: Apache-2.0
  • Parent Model: For more details about DistilBERT, we encourage users to check out this model card.
  • Resources for more information:

How to Get Started With the Model

Example of single-label classification:

import torch
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification

tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased")
model = DistilBertForSequenceClassification.from_pretrained("distilbert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]

Uses

Direct Use

This model can be used for topic classification. You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to be fine-tuned on a downstream task. See the model hub to look for fine-tuned versions on a task that interests you.

Misuse and Out-of-scope Use

The model should not be used to intentionally create hostile or alienating environments for people. In addition, the model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.

Risks, Limitations and Biases

Based on a few experimentations, we observed that this model could produce biased predictions that target underrepresented populations.

For instance, for sentences like This film was filmed in COUNTRY, this binary classification model will give radically different probabilities for the positive label depending on the country (0.89 if the country is France, but 0.08 if the country is Afghanistan) when nothing in the input indicates such a strong semantic shift. In this colab, Aurélien Géron made an interesting map plotting these probabilities for each country.

Map of positive probabilities per country.

We strongly advise users to thoroughly probe these aspects on their use-cases in order to evaluate the risks of this model. We recommend looking at the following bias evaluation datasets as a place to start: WinoBias, WinoGender, Stereoset.

Training

Training Data

The authors use the following Stanford Sentiment Treebank(sst2) corpora for the model.

Training Procedure

Fine-tuning hyper-parameters
  • learning_rate = 1e-5
  • batch_size = 32
  • warmup = 600
  • max_seq_length = 128
  • num_train_epochs = 3.0