HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Dice Loss for Data-imbalanced NLP Tasks

Xiaoya Li Xiaofei Sun Yuxian Meng Junjun Liang Fei Wu Jiwei Li

Dice Loss for Data-imbalanced NLP Tasks

Abstract

Many NLP tasks such as tagging and machine reading comprehension are faced with the severe data imbalance issue: negative examples significantly outnumber positive examples, and the huge number of background examples (or easy-negative examples) overwhelms the training. The most commonly used cross entropy (CE) criteria is actually an accuracy-oriented objective, and thus creates a discrepancy between training and test: at training time, each training instance contributes equally to the objective function, while at test time F1 score concerns more about positive examples. In this paper, we propose to use dice loss in replacement of the standard cross-entropy objective for data-imbalanced NLP tasks. Dice loss is based on the Sorensen-Dice coefficient or Tversky index, which attaches similar importance to false positives and false negatives, and is more immune to the data-imbalance issue. To further alleviate the dominating influence from easy-negative examples in training, we propose to associate training examples with dynamically adjusted weights to deemphasize easy-negative examples.Theoretical analysis shows that this strategy narrows down the gap between the F1 score in evaluation and the dice loss in training. With the proposed training objective, we observe significant performance boost on a wide range of data imbalanced NLP tasks. Notably, we are able to achieve SOTA results on CTB5, CTB6 and UD1.4 for the part of speech tagging task; SOTA results on CoNLL03, OntoNotes5.0, MSRA and OntoNotes4.0 for the named entity recognition task; along with competitive results on the tasks of machine reading comprehension and paraphrase identification.

Benchmarks

BenchmarkMethodologyMetrics
chinese-named-entity-recognition-on-msraBERT-MRC+DSC
F1: 96.72
chinese-named-entity-recognition-on-ontonotesBERT-MRC+DSC
F1: 84.47
named-entity-recognition-ner-on-conll-2003BERT-MRC+DSC
F1: 93.33
named-entity-recognition-ner-on-ontonotes-v5BERT-MRC+DSC
F1: 92.07
question-answering-on-squad11-devXLNet+DSC
EM: 89.79
F1: 95.77
question-answering-on-squad20-devXLNet+DSC
EM: 87.65
F1: 89.51

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Dice Loss for Data-imbalanced NLP Tasks | Papers | HyperAI