def _load_word_vec(path, word2idx=None, embed_dim=300):
    fin = open(path, 'r', encoding='utf-8', newline='\n', errors='ignore')
    word_vec = {}
    for line in tqdm.tqdm(fin, postfix='Loading embedding file...'):
        tokens = line.rstrip().split()
        (word, vec) = (' '.join(tokens[:(- embed_dim)]), tokens[(- embed_dim):])
        if (word in word2idx.keys()):
            word_vec[word] = np.asarray(vec, dtype='float32')
    return word_vec
def _load_word_vec(path, word2idx=None, embed_dim=300):
    fin = open(path, 'r', encoding='utf-8', newline='\n', errors='ignore')
    word_vec = {}
    for line in tqdm.tqdm(fin, postfix='Loading embedding file...'):
        tokens = line.rstrip().split()
        (word, vec) = (' '.join(tokens[:(- embed_dim)]), tokens[(- embed_dim):])
        if (word in word2idx.keys()):
            word_vec[word] = np.asarray(vec, dtype='float32')
    return word_vec