示例#1
0
def test_load_annotation(sample_annotation):
    parser = REPEREParser()
    annotations = parser.read(sample_annotation)
    speech1 = annotations(uri="uri1", modality="speech")
    assert list(speech1.itertracks(label=True)) == [
        (Segment(1, 3.5), 0, 'alice'), (Segment(3, 7.5), 1, 'barbara'),
        (Segment(6, 9), 2, 'chris')
    ]
def test_load_annotation(sample_annotation):
    parser = REPEREParser()
    annotations = parser.read(sample_annotation)
    speech1 = annotations(uri="uri1", modality="speech")
    assert list(speech1.itertracks(label=True)) == [
        (Segment(1, 3.5), 0, 'alice'),
        (Segment(3, 7.5), 1, 'barbara'),
        (Segment(6, 9), 2, 'chris')]
# manual speaker identification
manual_speaker_identification = MDTMParser("data/manual_speaker.mdtm", \
                                           multitrack=True)

# --------------------------------------------------
# LOAD MONOMODAL COMPONENTS OUTPUT ON TEST SET
# as described in Section "2. Monomodal Components"
# --------------------------------------------------

# automatic speaker diarization
auto_speaker_diarization = MDTMParser("data/auto_speaker_diarization.mdtm", \
                                      multitrack=True)

# automatic speaker identification
auto_speaker_identification = \
                     REPEREParser("data/auto_speaker_identification.repere", \
                                  multitrack=True, confidence=False)

# overlaid name detection output
auto_overlaid_names = REPEREParser("data/auto_overlaid_names.repere", \
                                   multitrack=True, confidence=False)


# ----------------------------------------------
# INITIALIZE NAME PROPAGATION ALGORITHMS
# as described in Section "3. Name Propagation"
# ----------------------------------------------

# 'on' stands for overlaid name detection
# 'sd' stands for (unsupervised) speaker diarization
# 'sid' stands for (supervised) speaker identification