()
return token_dict
bert vocab
    :return:
bert vocab
    :return:
bert vocab : return :
def get_token_dict():
    '''
    bert vocab
    :return:
    '''
    bert_path = 'bert_model/'
    dict_path = bert_path+'vocab.txt'
    token_dict = {}
    with codecs.open(dict_path, 'r', 'utf8') as reader:
        for line in reader:
            token = line.strip()
            token_dict[token] = len(token_dict)
    return token_dict
def get_token_dict ( ) : bert_path = 'bert_model/' dict_path = bert_path + 'vocab.txt' token_dict = { } with codecs . open ( dict_path , 'r' , 'utf8' ) as reader : for line in reader : token = line . strip ( ) token_dict [ token ] = len ( token_dict ) return token_dict