def get_labels(parameters):
    """Generates numerical labels for each categorical
    MCOParameter"""

    label_dict = {}
    label = 1

    for parameter in parameters:
        if hasattr(parameter, "categories"):
            for name in parameter.categories:
                if name not in label_dict:
                    label_dict[name] = label
                    label += 1

    return label_dict