import collections


def load_vocab(vocab_vocab_file):
    """Loads a vocabulary file into a dictionary."""
    with open(vocab_vocab_file, 'r') as f:
        contents = f.read().strip().split()
    vocab = collections.OrderedDict()
    for index, token in enumerate(contents):
        if index == 1:
            vocab['[PAD]'] = 1
        else:
            vocab[token] = index
    vocab['[MASK]'] = len(vocab)
    return vocab