Skip to content

Commit 5d9ef6b

Browse files
authored
Merge pull request #20 from matt-stevenson/master
Specify utf8 for reading .txt files to fix decoding error in Windows 7
2 parents a0fa34e + 5dc7d98 commit 5d9ef6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neuralcoref/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def load_embeddings_from_file(name):
335335
voc = {}
336336
mat = np.load(name+"_embeddings.npy")
337337
average_mean = np.average(mat, axis=0, weights=np.sum(mat, axis=1))
338-
with open(name+"_vocabulary.txt") as f:
338+
with open(name+"_vocabulary.txt", encoding="utf8") as f:
339339
for i, line in enumerate(f):
340340
embeddings[line.strip()] = mat[i, :]
341341
voc[line.strip()] = i

0 commit comments

Comments
 (0)