def read_vocab(vocab_dir):
    '读取词汇表'
    with open_file(vocab_dir) as fp:
        words = [native_content(_.strip()) for _ in fp.readlines()]
    word_to_id = dict(zip(words, range(len(words))))
    return (words, word_to_id)
读取词汇表
def read_vocab(vocab_dir):
    
    with open_file(vocab_dir) as fp:
        words = [native_content(_.strip()) for _ in fp.readlines()]
    word_to_id = dict(zip(words, range(len(words))))
    return (words, word_to_id)