Pinlong-Zhao / SDGCN

Modeling Sentiment Dependencies with Graph Convolutional Networks for Aspect-level Sentiment Classification
53 stars 24 forks source link

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 1389: illegal multibyte sequence #4

Open Summer-1994 opened 4 years ago

Summer-1994 commented 4 years ago

请问:运行时出现这种错误怎么解决呢

SDGCN-master\data_helpers.py in load_w2v(w2v_file, embedding_dim, is_skip) 127 w2v.append([0.] * embedding_dim) 128 cnt = 0 --> 129 for line in fp: 130 cnt += 1 131 line = line.split()

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 1389: illegal multibyte sequence

Pinlong-Zhao commented 4 years ago

sorry,才看到。我运行的时候没有出现这个错误。你可以试着按如下方式改一下: 119行 fp = open(w2v_file,'r', encoding='UTF-8')