fastNLP icon indicating copy to clipboard operation
fastNLP copied to clipboard

bert wordpiece indexing之后, 原始单词对应的 序列标注标签怎么做映射?

Open 312shan opened this issue 2 years ago • 1 comments

BertWordPieceEncoder.index_datasets 一步实现了文本到 token_id 的转换,但是文本原来标签的序列标注标签似乎没有同步转换的对应方法?

这会导致一个问题,用户只能不用 index_datasets 方法,只能自己写 tokenize + 原始标签到 wordpiece 序列对应的ner标签的方法。 所以,这个BertWordPieceEncoder似乎不太方便用于ner?特别是英文的 wordpiece 的那种?

312shan avatar May 02 '22 12:05 312shan

建议直接使用BertEmbedding,就不需要考虑这个问题了【不过会存在一点效率上的损失】。BertWordPieceEncoder是给分类任务使用的。

yhcc avatar May 02 '22 16:05 yhcc