lonePatient / BERT-chinese-text-classification-pytorch

This repo contains a PyTorch implementation of a pretrained BERT model for text classification.
99 stars 19 forks source link

怎么预测新数据返回result是label而非numpy数组呢 #7

Closed Wing-Li-oceanwing closed 4 years ago

Wing-Li-oceanwing commented 4 years ago

自己训练的模型,进行测试返回的数据是数组而不是标签,求大神指点,谢谢!

Wing-Li-oceanwing commented 4 years ago

我明白了,但是好像还有个问题就是我第一次预测文件test.txt中有14行需要预测的数据,然后我去掉或者增加再次运行,返回的结果依然是14个数组

Wing-Li-oceanwing commented 4 years ago

我仔细研读了下代码,发现要把catch清除掉,多谢大神的代码了,学习了很多