def METHOD_NAME(xml_writer, file_id, labels, threshold=30, sil=["pau", "br", "sil"]):
    xml_reader = SingingScoreReader(os.path.join(args.scp, "score.scp"))
    segments = []
    segment = SegInfo()
    for i in range(len(labels)):
        # remove unlabeled part
        if "08" in file_id and i < 135:
            continue
        label = labels[i]
        if label.label_id in sil:
            if len(segment.segs) > 0:
                segments.extend(segment.split(threshold=threshold))
                segment = SegInfo()
            continue
        segment.add(label.start, label.end, label.label_id)
    if len(segment.segs) > 0:
        segments.extend(segment.split(threshold=threshold))
    segments_w_id = {}
    id = 0
    for seg in segments:
        while len(seg) > 0:
            key = pack_zero(file_id, id)
            score = xml_reader[key]
            val, seg, notes = compare(key, score["note"], seg)
            segments_w_id[key] = val
            score["note"] = notes
            score["item_list"].append("phn")
            xml_writer[key] = score
            id += 1
    return segments_w_id