diff --git a/models/match/multiview-simnet/data/preprocess.py b/models/match/multiview-simnet/data/preprocess.py index 4c0fb0902..ea8151b69 100644 --- a/models/match/multiview-simnet/data/preprocess.py +++ b/models/match/multiview-simnet/data/preprocess.py @@ -15,11 +15,12 @@ import os import sys +import io import jieba import numpy as np import random -f = open("./raw_data.txt", "r") +f = io.open("./raw_data.txt", mode="r", encoding='utf-8') lines = f.readlines() f.close() @@ -35,7 +36,7 @@ else: word_dict[word] = len(word_dict) + 1 -f = open("./raw_data.txt", "r") +f = io.open("./raw_data.txt", mode="r", encoding='utf-8') lines = f.readlines() f.close()