(file)
return vocab
Load tokens from word vector file.

    Only tokens are loaded. Vectors are not loaded at this time for space efficiency.

    Args:
        file (str): path of pretrained word vector file.

    Returns:
        set: a set of tokens (str) contained in the word vector file.
Load tokens from word vector file.
Load tokens from word vector file .
def load_wv_vocab(file):
    '''Load tokens from word vector file.

    Only tokens are loaded. Vectors are not loaded at this time for space efficiency.

    Args:
        file (str): path of pretrained word vector file.

    Returns:
        set: a set of tokens (str) contained in the word vector file.
    '''
    vocab = set()
    with open(file) as f:
        for line in f:
            elems = line.split()
            token = normalize_text(''.join(elems[0:-wv_dim]))  # a token may contain space
            vocab.add(token)
    return vocab
def load_wv_vocab ( file ) : vocab = set ( ) with open ( file ) as f : for line in f : elems = line . split ( ) token = normalize_text ( '' . join ( elems [ 0 : - wv_dim ] ) ) # a token may contain space vocab . add ( token ) return vocab