#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('pylab', 'inline') # # Scores (`pyannote.core.scores.Scores`) # In[2]: 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. # In[3]: scores = Scores( uri='TheBigBangTheory.Season01.Episode01', modality='speaker' ) # For instance, to represent a dialogue between Penny and Leonard, we could do the following: # In[4]: 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 # In[5]: scores.to_annotation() # In[6]: from pyannote.core import notebook subplot(211) notebook(scores, time=False) subplot(212) notebook(scores.to_annotation(), legend=False)