buppt / ChineseNER

中文命名实体识别,实体抽取,tensorflow,pytorch,BiLSTM+CRF
1.39k stars 394 forks source link

博主您好,想问您关于编码格式运行报错的问题,按照网上的方法改了很多次,还是出错。 #39

Open ma-qianqian opened 4 years ago

ma-qianqian commented 4 years ago

Traceback (most recent call last): File "train.py", line 87, in test_input(model,sess,word2id,id2tag,batch_size) File "/mnt/ChineseNER-master/tensorflow/utils.py", line 169, in test_input entity = get_entity(text,pre[0],id2tag) File "/mnt/ChineseNER-master/tensorflow/utils.py", line 40, in get_entity entity=id2tag[y[i][j]][1:]+':'+x[i][j] File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 0: unexpected end of data

cbzhang86 commented 4 years ago

换成py3的版本 下面有代码的