CoolFace
Modelpublic

dannashao/bert-base-uncased-finetuned-negation_scope

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes8downloads
Model Card

bert-base-uncased-finetuned-negation_scope

This model is a fine-tuned version of bert-base-uncased on the SEM 2012 shared task corpus (cd-sco). It achieves the following results on the evaluation set:

  • —Loss: 0.0618
  • —Token Precision: 0.9190
  • —Token Recall: 0.8868
  • —Token F1: 0.9026
  • —Span Precision: 0.625
  • —Span Recall: 0.625
  • —Span F1: 0.625

Model description

We follow the Augment method described in NegBERT (Khandelwal, et al. 2020). That is, adding a special token ([NEG]) immediately before the predicate:

This is [NEG] not a sentence.

Note that the special token and the predicate is considered a whole. That is, the actual sentence is like

'This' 'is' '[NEG] not' 'a' 'sentence' '.'

Intended uses & limitations

See details at https://github.com/dannashao/portfolio-NLP/blob/main/NEG/Fine%20tune%20BERT.ipynb

Training and evaluation data

See details at https://www.clips.ua.ac.be/sem2012-st-neg/

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

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

Training results

Training LossEpochStepValidation LossToken PrecisionToken RecallToken F1Span PrecisionSpan RecallSpan F1
No log1.02370.06240.91210.83680.87280.52070.52070.5207
No log2.04740.06820.93660.83110.88070.60120.60120.6012
0.07223.07110.06180.91900.88680.90260.6250.6250.625

Framework versions

  • —Transformers 4.37.0
  • —Pytorch 2.0.1+cu117
  • —Datasets 2.16.1
  • —Tokenizers 0.15.1