Pytorch-RNN-text-classification
Pytorch-RNN-text-classification copied to clipboard
Update util.py
trafficstars
edit function 'def create_tsv_file(path_in, path_out)' as: with open(path_in,'r', encoding = 'utf-8') as f, open(path_out,'w',encoding = 'utf-8') as fw:
or bug:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4757: ordinal not in range(128)
Hi ArmstrongZhang,
Thanks for your PR. This repo is originally implemented for Python2.7 and open does not take encoding as an argument in Python2.7. Can you use codecs.open instead? I believe codecs.open works fine both in python2 and 3. Thanks!