def get_ytid2labels(segment_csv):
    """
    compute the mapping (dict object) from youtube id to audioset labels.
    """
    with open(segment_csv) as F:
        lines = F.read().split('\n')

    lines = [l for l in lines if len(l) > 0 and l[0] != '#']
    ytid2labels = {l.split(',')[0]: l.split('"')[-2] for l in lines}
    return ytid2labels