Last active
March 28, 2019 09:56
-
-
Save hbredin/a6da359ced429c00a001820a9a4b5050 to your computer and use it in GitHub Desktop.
How to compute Jaccard Error Rate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load UEM, references, and system output | |
from pyannote.database.util import load_rttm, load_uem | |
uems = load_uem('references.uem') | |
references = load_rttm('references.rttm') | |
hypotheses = load_rttm('hypotheses.rttm') | |
from pyannote.metrics.diarization import JaccardErrorRate | |
metric = JaccardErrorRate() | |
# compute (and print) JER for each file | |
for uri, hypothesis in hypotheses.items(): | |
reference = references[uri] | |
uem = uems[uri] | |
jer = metric(reference, hypothesis, uem=uem) | |
print(f'{uri} {jer:.3f}') | |
# compute (and print) JER aggregated on all files | |
print(f'all {abs(metric)}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment