from typing import Counter


def make_label_vocab(list_of_labels):
    """
    Create vocabulary to index labels
    :param list_of_labels: list or array, list of labels
    :return: dict
    """
    cnt = Counter(list_of_labels)
    label_vocab = dict()
    for i, label in enumerate(sorted(cnt.keys())):
        label_vocab[label] = {"id": i, "cnt": cnt[label]}
    return label_vocab