%pylab inline
Populating the interactive namespace from numpy and matplotlib
pyannote.core.scores.Scores
)¶from pyannote.core import Scores
Scores
instances are used to describe classification scores.
For instance, one can use a Scores
to store the result of speaker identification approach applied on an episode of The Big Bang Theory TV series.
scores = Scores(
uri='TheBigBangTheory.Season01.Episode01',
modality='speaker'
)
For instance, to represent a dialogue between Penny and Leonard, we could do the following:
from pyannote.core import Segment
scores[Segment(3, 5), '_', 'Penny'] = 8
scores[Segment(3, 5), '_', 'Leonard'] = 0.15
scores[Segment(3, 5), '_', 'Sheldon'] = 0.05
scores[Segment(5.5, 7), '_', 'Penny'] = 0.4
scores[Segment(5.5, 7), '_', 'Leonard'] = 0.5
scores[Segment(5.5, 7), '_', 'Sheldon'] = 0.1
scores[Segment(8, 10), '_', 'Penny'] = 0.4
scores[Segment(8, 10), '_', 'Leonard'] = 0.25
scores[Segment(8, 10), '_', 'Sheldon'] = -12
scores
scores.to_annotation()
from pyannote.core import notebook
subplot(211)
notebook(scores, time=False)
subplot(212)
notebook(scores.to_annotation(), legend=False)