FuYanzhe2/Name-Entity-Recognition

num_labels in crf_layer ?

Opened this issue · 0 comments

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

在Chinese_ner项目的crf_loss层用的是num_tags+1对输出的头和尾加上了一个类似和的标签,用来计算转移概率。

shape=[self.num_tags + 1, self.num_tags + 1],

但是在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]吗?