def read_segs(segfile):
    """Returns a dict with scid as the key and segments as value from a '.seg' file.

    A '.seg' file consists of a set of lines with the following format:
    scene_name[\t]segment_name[\t]start_time[\t]end_time[\n]

    scene_name is the id of the Scene that this Segment belongs to,
    segment_name is the id of the Segment,
    and start_time and end_time determines the time interval for the Segment

    Args:
        segfile: A string containing the name of the '.seg' file

    Returns:
        a dict with scid as the key and segments as value
    """
    scenes = {}
    with open(segfile, 'r') as f:
        seglines = f.readlines()

    for l in seglines:
        l = l.strip()
        l = l.split('\t')
        if l[0] in scenes:
            scenes[l[0]].append((l[1], int(l[2]), int(l[3])))
        else:
            scenes[l[0]] = [(l[1], int(l[2]), int(l[3]))]
    return scenes