def dice(type_profile, song_profile):
    """
    Calculate the Dice similarity measure between the profile of
    specific output_columns value (e.g. specific composer) and
    the profile of a song
    """
    flat_type_profile = list(type_profile.keys())
    flat_song_profile = list(song_profile.keys())
    type_profile_len = len(type_profile)
    song_profile_len = len(song_profile)
    overlap = set(flat_type_profile).intersection(set(flat_song_profile))
    return 2 * len(overlap) / (type_profile_len + song_profile_len)