Last active
October 11, 2018 09:32
-
-
Save penut85420/e919edb4bb844336aeaef68912cc841e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loader = importlib.import_module('Loader') | |
model_path = "w2v\\w2v_word_model.npy" | |
dict_path = "w2v\\w2v_word_dictionary.pkl" | |
w2v_model = Loader.Word2VecLoader(model_path, dict_path) | |
w2v, d = w2v_model.load_w2v() | |
w2v_list = list() | |
with open("a.txt", "r", encoding='utf-8') as fin: | |
for line in fin: | |
v = [] | |
clist = line.split() | |
for c in clist: | |
v.append(w2v[d[c]]) | |
w2v_list.append(v) | |
print(w2v_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment