facebookresearch / InferSent

InferSent sentence embeddings
Other
2.28k stars 471 forks source link

add explicit encoding for opening w2v to allow code to work on windows #134

Closed nickyeolk closed 5 years ago

nickyeolk commented 5 years ago

w2v vectors are encoded in utf-8. When running python 3 on windows (North America), the default encoding used for opening files are 8bit Windows-1252 character set. Reading the w2v file thus throws a decoding error. Setting an encoding will ensure that the w2v vector file can be read. This is also referenced in issue #98.