LeeSureman / Flat-Lattice-Transformer

code for ACL 2020 paper: FLAT: Chinese NER Using Flat-Lattice Transformer
1k stars 178 forks source link

Invalid instace which ends at line:4093 has been drpoped #56

Open wanlipeng opened 3 years ago

wanlipeng commented 3 years ago

你好,我在训练开源数据weibo_NER数据时候可以这个正常训练,仿照weibo_NER数据格式做自己的训练数据训练报错,"Invalid instace which ends at line:4093 has been drpoped",加载数据时候出错,都是用"bio"encoding type,求指导下!

LeeSureman commented 3 years ago

我没遇到过这个报错信息,不过我可以提供一个解决方案,你可以写一个读取自己训练数据的函数,然后保持返回结果和其它函数的格式一致就可以了

Endlesspace commented 3 years ago

我也遇到过这个问题,我发现是file_reader.py这个文件中的parse_conll()函数中 sample = list(map(list, zip(*sample))) 这句有问题。原因可能是自己的数据中有把空格也标为了“O”。修改一下就可以训练,不过我的数据把batchsize改成2也爆显存,很愁。

LeeSureman commented 3 years ago

我也遇到过这个问题,我发现是file_reader.py这个文件中的parse_conll()函数中 sample = list(map(list, zip(*sample))) 这句有问题。原因可能是自己的数据中有把空格也标为了“O”。修改一下就可以训练,不过我的数据把batchsize改成2也爆显存,很愁。

爆显存的话建议先查一下有没有过长句(哪怕只有一句)

Cheung-Z commented 3 years ago

你好,我在训练开源数据weibo_NER数据时候可以这个正常训练,仿照weibo_NER数据格式做自己的训练数据训练报错,"Invalid instace which ends at line:4093 has been drpoped",加载数据时候出错,都是用"bio"encoding type,求指导下!

就像上面说的,如果在char+tag换行写入文件的时候,有空字符被打上标签好像就会有这种报错