def normalize_labels(labels):
    """ Normalize labels to probabilities"""
    s = sum(labels.values())
    normalized = {}
    for k, v in labels.iteritems():
        if s > 0:
            normalized[k] = v / s
        else:
            normalized[k] = v
    return normalized