FuYanzhe2 / Name-Entity-Recognition

Lstm-crf,Lattice-CRF,bert-ner及近年ner相关论文follow
564 stars 195 forks source link

num_labels in crf_layer ? #13

Open leonaxiongxin opened 4 years ago

leonaxiongxin commented 4 years ago

你好,对于crf_loss的计算有个疑问

在Chinese_ner项目的crf_loss层用的是num_tags+1对输出的头和尾加上了一个类似的标签,用来计算转移概率。 https://github.com/FuYanzhe2/Name-Entity-Recognition/blob/598b264262d667257c9e26646c49df45f7d76547/Chinese_ner/model.py#L182

但是在BERT-BiLSTM-CRF-NER项目的crf_loss层用的是num_labels, https://github.com/FuYanzhe2/Name-Entity-Recognition/blob/master/BERT-BiLSTM-CRF-NER/lstm_crf_layer.py#L138 这是因为BERT输出的embedding已经包括[CLS][SEP]吗?