920232796 / bert_seq2seq

pytorch实现 Bert 做seq2seq任务,使用unilm方案,现在也可以做自动摘要,文本分类,情感分析,NER,词性标注等任务,支持t5模型,支持GPT2进行文章续写。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

粗粒度NER-tokenizer问题

NiceMartin opened this issue · comments

在NER中, 一个比较容易出错的地方是由于tokenizer以后, 导致 句子和原始输入的句子长度、token的位置不一致.
在 tokenier.py的代码中, 好像并没有解决 tokenizer输入和输出长度不一致的问题.
例如, 在读入 粗粒度NER的语料后,
sents_src, sents_tgt = read_corpus(data_path)
其中的 sents_src[3], sents_tgt[3], 经过 tokenizer以后, 长度并一致, 这样会报错.

早就在群里说过了,这里有坑,想想如何对应上,不难。