lonePatient / BERT-NER-Pytorch

Chinese NER(Named Entity Recognition) using BERT(Softmax, CRF, Span)
MIT License
2.06k stars 424 forks source link

为什么“total_loss = (start_loss + end_loss) / 2” #15

Open possible1402 opened 4 years ago

possible1402 commented 4 years ago

https://github.com/lonePatient/BERT-NER-Pytorch/blob/13199aeea321aa3bebe4cf2bb4bf37c69937e8ff/models/bert_for_ner.py#L124

直接对两个loss加和除2的意义是什么呢,有没有论文可以参考呢? 我看ACL2020收录的论文"A Unified MRC Framework for Named Entity Recognition"里面为了计算start 和end的匹配,单独设计了一个span match的目标函数。这里除以2是想表达寻找距离最小的start和end的意思吗?