def reverb2mix_transcript_parse(path):
    """
    Parse the file format of the MLF files that
    contains the transcripts in the REVERB challenge
    dataset
    """

    utterances = {}

    with open(path, "r") as f:
        everything = f.read()

    all_utt = everything.split("\n.\n")

    for i, utt in enumerate(all_utt):

        if i == 0:
            assert utt[:7] == "#!MLF!#"
            utt = utt[7:]

        words = utt.split("\n")

        label = words[0][4:-6]
        sentence = " ".join(words[1:])

        speaker = label[:-5]
        utterance = label[-5:]

        utterances[label] = {
            "utterance_id": utterance,
            "speaker_id": speaker,
            "transcript": sentence,
        }

    return utterances