ShannonAI / mrc-for-flat-nested-ner

Code for ACL 2020 paper `A Unified MRC Framework for Named Entity Recognition`
663 stars 118 forks source link

A problem for Dice Loss #59

Closed Thornhill-GYL closed 3 years ago

Thornhill-GYL commented 4 years ago

The address "https://github.com/ShannonAI/dice_loss_for_NLP" in your paper《Dice Loss for Data-imbalanced NLP Tasks》can't be find! I would like to konw how can I get the code for dice_loss? Will you public it? Thanks.

albertnanda commented 4 years ago

Here is the code of dice loss: https://github.com/ShannonAI/mrc-for-flat-nested-ner/blob/master/loss/dice_loss.py

Though, I am not able to use this with huggingface token classification task. There is shape mismatch, because output from model is [batch_size, max_seq_len, num_labels] and labels are of the shape [batch_size, max_seq_len].

Thornhill-GYL commented 4 years ago

I have the same problem too.

algoflow19 commented 4 years ago

They are working for binary classification only in fact.

Jordy-VL commented 3 years ago

Does anyone already have an extension to multi-class classification? Or is this only well-defined for binary classification?

YuxianMeng commented 3 years ago

Hi guys, sorry for the late reply. For the dice loss, please use our latest repo here.