def create_label_dict(labels):
    """
    Return a dictionary mapping the labels to numbers.

    :param labels: a list of labels
    :return: a dict
    """
    labels = sorted(list(set(labels)))
    mapping = zip(labels, range(len(labels)))
    return dict(mapping)