def load_vocab(vocab_file):
    """Loads a vocabulary file into a dictionary."""
    vocab = {}
    with open(vocab_file, 'r') as f:
        for line in f:
            token = line.strip().split()[0]
            if token not in vocab:
                vocab[token] = len(vocab)

    return vocab