Streamlining Python Development: A Guide to a Modern Project Setup
One Music, Many Listeners - A Case-based Song Scheduler for Group Customised Radio
1. IIIA - CSIC
A Case-based Song Scheduler
for Group Customised Radio
Claudio Baccigalupo – Enric Plaza
Project Presentation – IIIA – February 2007
2. ONE MUSIC, MANY LISTENERS
music club radio
juke-box home parties
3. SOME COMMON PROBLEMS
How to check the reactions of the audience?
How to provide users with a large collection of music?
How to prevent monopolistic selection of music?
How to avoid annoying disruptions between songs ?
How to match the tastes of all the listeners?
4. OUR PROPOSED SOLUTION
A novel group-based web-radio architecture
Songs are broadcast from the libraries of the listeners
Users can requests and evaluate songs for each channel
The music is not pre-programmed, but selected in real-time
by a CBR technique that combines both musical properties
and listeners’ preferences to guarantee a fair satisfaction of
the whole audience
5. TODAY’S MENU
1. Introduction
2. The Poolcasting web-radio architecture
3. A Case-based Reasoning Song Scheduler
The Participants’ Case Bases
Musical Domain Knowledge
The Retrieve Process
The Reuse Process
The Revise Process
4. Conclusions and future work
15. DESIRED PROPERTIES FOR A CHANNEL
Variety: no song/artist should be repeated at a close distance
Continuity: each song should be musically associated with
the song it follows
Listeners’ satisfaction: each song should match the musical
preferences of (at least part of) the listeners
Fairness: the more unsatisfied a listener, the more her
preferences should influence the choice of the next song
16. ARCHITECTURE OF A WEB-RADIO
Database
CHANNELS
AVAILABLE SONGS LISTENERS
collect information create streams
to schedule a song for the channel
Song Scheduler Stream Generator
extract
Songs list of
uncompressed
Web Interface
scheduled
listeners
audio signal
Buffer
song
Web
create a
Streaming Server
scheduled page
channel
song
request
MP3 stream OGG stream channel
Music Library (64 kbps) (256 kbps) information
INTERNET
Listener Listener Admin Visitor
17. ARCHITECTURE OF POOLCASTING
Database
request to join PARTICIPANTS CHANNELS
list of shared songs MUSIC POOL LISTENERS
collect information create streams
to schedule a song for the channel
Song Scheduler Stream Generator
Songs uncompressed list of
Web Interface
Web Interface audio signal listeners
Buffer
requests and Web
create a
Streaming Server
feedback scheduled page
channel
song
request
joins download
MP3 stream OGG stream channel
channel song
(64 kbps) (256 kbps) information
INTERNET
Participant Listener Listener Admin Visitor
18. ARCHITECTURE OF POOLCASTING
Database
request to join PARTICIPANTS CHANNELS
list of shared songs MUSIC POOL LISTENERS
collect information create streams
to schedule a song for the channel
Song Scheduler Stream Generator
Songs uncompressed list of
Web Interface
Web Interface audio signal listeners
Buffer
requests and Web
create a
Streaming Server
feedback scheduled page
channel
song
request
joins download
MP3 stream OGG stream channel
channel song
(64 kbps) (256 kbps) information
INTERNET
Participant Listener Listener Admin Visitor
19. TODAY’S MENU
1. Introduction
2. The Poolcasting web-radio architecture
3. A Case-based Reasoning Song Scheduler
The Participants’ Case Bases
Musical Domain Knowledge
The Retrieve Process
The Reuse Process
The Revise Process
4. Conclusions and future work
20. THE CBR SCHEMA
Listener
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
Variety Continuity Listeners’ satisfaction Fairness
21. THE CBR APPROACH
Problem: given the description of a channel H, the list of its
current listeners, and the sequence of the recently scheduled
songs, select which song to schedule next on channel H
Retrieval: retrieve from the channel pool Φ(H) a subset of
songs either recommended by some user or not recently
played and musica!y associated with the last song scheduled
Reuse: rank the retrieved set combining the preferences and
the satisfaction degrees of the current listeners of H and
schedule on channel H the best-ranked song
Revise: update the listeners’ preferences and the musical
associations according to the feedback of the audience
22. TODAY’S MENU
1. Introduction
2. The Poolcasting web-radio architecture
3. A Case-based Reasoning Song Scheduler
The Participants’ Case Bases
Musical Domain Knowledge
The Retrieve Process
The Reuse Process
The Revise Process
4. Conclusions and future work
23. THE PARTICIPANTS’ CASE BASES
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
24. THE PARTICIPANTS’ CASE BASES
Every Case Base contains the list of songs in the library of a
participant and a preference degree for each of these songs
The preference degree g(P, S) has values in [-1,1]; -1 means P
hates song S, 1 means P loves S, and 0 reflects indifference
We infer the values of g(P, S) from the listening experience
data included in the music library of each participant
We assume that the higher the rating assigned to a song and
the higher the play count, the stronger the preference
25. THE PREFERENCE DEGREE
Si n(Si) m(Si) g(Si)
0 1 0.5
Take on me
_
1 0 0.5
Avg. rating: n = 3 Big in Japan
_
Avg. play count: m = 3.5 -1 -1 -1
Venus
The preference degree is a combination of the normalised
rating and play count of each song:
g ( P, S i ) = θ n ( P, S i ) + ( 1 - θ ) m ( P, S i )
θ= 0.5
26. THE PREFERENCE DEGREE
The preference degree g(P, S) can be evaluated also for songs
not included in the library of a Participant
We assume that if P does not own a song S but owns other
songs quot;om the same artist of S, then the preference of P for S
is her average preference for those songs
S g(P,S)
S g(P,S)
0.5
Take on me
Forerever
0.5
songs by Alphaville Young
0.5
Big in Japan
0.5
In the Mood
-1
Venus
27. THE PARTICIPANTS’ CASE BASES
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
28. MUSICAL DOMAIN KNOWLEDGE
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
29. SONG AND ARTIST ASSOCIATIONS
A human DJ knows from experience which songs are
associated
We use an automatic process to extract this knowledge from
a large collection of playlists available on the Web
We assume that the more the playlists where two songs/
artists co-occur and the closer the distance at which they
occur, the higher their association
Extracting such knowledge from playlists is much better for
our goal than using a content-based method
30. SONG ASSOCIATION DEGREE
The song association degree from a song X to a song Y is a
combination of the number of playlists where X and Y co-
occur, the distances at which they occur, the order in which
they occur and the popularity of the two songs
f(X,Y)
P(Y|X) =
f(X)
∑q 1
f(X,Y)
Let be the set
=
_ _
of playlists where f(X)·( f(Y)/f )β f(X)·( f(Y)/f )β
X and Y occur:
31. SONG ASSOCIATION DEGREE
The song association degree from a song X to a song Y is a
combination of the number of playlists where X and Y co-
occur, the distances at which they occur, the order in which
they occur and the popularity of the two songs
f(X,Y)
_
f(X)·( f(Y)/f )β
{
if |d(q,X,Y)| > δ
0
if |d(q,X,Y)| ≤ δ
1/|d(q,X,Y)| d(q,X,Y) > 0
w(q,X,Y) =
α/|d(q,X,Y)| if |d(q,X,Y)| ≤ δ d(q,X,Y) < 0
∑q w(q, X, Y)
Let be the set
s(X, Y) = _ α=0.75
of playlists where
f(X)·( f(Y)/f )β β=0.5
X and Y occur:
δ=3
32. ARTIST ASSOCIATION DEGREE
The artist association degree from an artist A to an artist
B is a combination of the number of playlists where any song
from A and B co-occur, the distances at which they occur and
the popularity of the two artists:
be the playlists where a song from A and a song from B occur:
Let
{ if |d’(q,A,B)| > δ’
0
w’(q,A,B) =
1/|d’(q,A,B)| if |d’(q,A,B)| ≤ δ’
∑q w’(q, A, B)
_
s’(A, B) =
f’(A)·( f’(B)/f’ )β
δ’=2
33. SONG AND ARTIST ASSOCIATIONS
We have mined a collection of about 600,000 playlists from
MyStrands, with the parameters set to α = 0.75, β = 0.5, δ =
3 and δ’ = 2, discarding single occurrences and associations
between songs from the same artist
We have obtained association degrees for 112,238 distinct
songs and for 25,881 distinct artists
For example, the most associated artists for Abba are: Agnetha
Faltskog, A-Teens, Chic, Gloria Gaynor, The 5th Dimension
34. MUSICAL DOMAIN KNOWLEDGE
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
35. THE RETRIEVE PROCESS
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
36. THE RETRIEVE PROCESS
First, we rate each song Z Φ(H) in the channel pool of H
with a relevance value r(Y, Z) in [0,1] that expresses how
much Z satisfies the conditions of variety and continuity
Next, we retrieve the κ best rated songs along this function
r(Y, Z) = 1 if some participant requested Z via the web-page
r(Y, Z) = 0 if the same song/artist was recently played on H
Otherwise, r(Y, Z) measures the musical association from Y
(the last song scheduled on channel H) to Z, as follows:
37. THE RETRIEVE PROCESS
r(Y, Z) = s(Y, Z) + εu(Y, Z) + ε2v(Y, Z) + ε3s’(a(Y), a(Z))
s(Y, Z) → song association from Y to Z
u(Y, Z) → association from songs of the artist of Y to Z
v(Y, Z) → association from songs of artists associated with the
artist of Y to Z
s’(a(Y), a(Z)) → association from artist of Y to artist of Z
[0,1] → controls the importance of these conditions
ε
ε=0.5
38. THE RETRIEVE PROCESS
r(Y, Z) = s(Y, Z) + εu(Y, Z) + ε2v(Y, Z) + ε3s’(a(Y), a(Z))
Example: Y = Waterloo (Abba)
s(Y, Z) : Z
Waterloo
u(Y, Z) : Mamma mia S.O.S. Fernando Z
…
(A-Teens)
(Agnetha (Gloria
v(Y, Z) : Z
Faltskog) Gaynor)
(Chic)
s’(a(Y), a(Z)) : a(Z)
(Abba)
39. THE RETRIEVE PROCESS
u(Y, Z) is the average song association degree from every song
whose artist is a(Y) to Z:
∑W (Y,Z) s(W,Z)
u(Y,Z) =
#( (Y,Z))
(Y,Z) = {W | s(W,Z) > 0 a(Y) = a(W)}
where
v(Y, Z) is the average song association degree from every song
whose artist is associated with a(Y) to Z, combined with the
relative artist association degree:
∑W (Y,Z) s(W,Z)
s’(a(W),a(Z))
v(Y,Z) =
#( (Y,Z))
where (Y,Z) = {W | s(W,Z) > 0 s’(a(Y),a(W)) > 0}
40. THE RETRIEVE PROCESS
Example of retrieve process for the ‘80s Music Channel, where
Y = Super Trouper (Abba) and Φ(H)= {Z1, Z2, Z3, Z4, Z5}
Zi f(Zi) s(Y,Zi) u(Y,Zi) v(Y,Zi) s’(a(Y),a(Zi)) r(Y,Zi)
Mamma Mia
--- --- --- --- --- 0 5º
(Abba)
1341 0.942 0.574 0.324 2.817 1.662
Take on me
2º
(1937) 103 103 103 103 103
(A-Ha)
184 0.841 3.281
2.548 1.119 0.265
Listen to your heart
1º
(642) 103 103
103 103 103
(Roxette)
237 0.944 1.234
1.807 0.852
The look of love
3º
0
(878) 103 103
103 103
(ABC)
278 0.114 0.428 0.614
1.063
I’m So Excited
0 4º
(The Pointer Sisters) (1149) 103 103 103
103
19533 0.153 0.858 0.235 0.320
Mr. Brightside
0
(45787) 103 103 103 103
(The Ki!ers)
41. THE RETRIEVE PROCESS
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
42. THE REUSE PROCESS
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
43. THE REUSE PROCESS
This process ranks the retrieved set according to the
preferences of the current listeners of the channel and their
group satisfaction, and returns the best ranked song as the
next song to be scheduled on the channel
The most critical challenge is how to combine different
individual preferences into one group satisfaction value
To guarantee fairness among listeners, we propose a
weighted average of the individual preferences, where the
weight associated to each listener depends on her
satisfaction about the last scheduled songs
44. AVERAGE WITHOUT MISERY
Let (H,t) be the listeners of channel H at time t and (H,t) the
retrieved set; we define the group preference of (H,t) for a
retrieved song S (H,t) as G(S,H,t) [-1,1] by cases:
(average) if none of the current listeners hates song S, then
we use a weighted average of the individual preferences for S:
∑P (H,t) g(P,S) [1-ω(P,H,t)]
G(S,H,t) =
#( (H,t))
(H,t): g(P, S) < μ, then
P
(without misery) otherwise, if
we set the group preference for S to the lowest possible value:
G(S,H,t) = -1
μ = -0.75
45. AVERAGE WITHOUT MISERY
This strategy is Pareto-optimal: if at least one listener
prefers a song S to a song S’ and nobody prefers S’ to S, then
G(S,H,t) ≥ G(S’H,t)
This strategy avoids misery: if at least one listener has a bad
preference for S’ (lower than a threshold μ), and no listener
has a bad preference for S (lower than the threshold μ), then
G(S,H,t) ≥ G(S’H,t)
Using this strategy, we endeavour to schedule songs for which
every current listener has an individual preference at least
equal to μ
46. AVERAGE WITHOUT MISERY
∑P (H,t) g(P,S) [1-ω(P,H,t)]
G(S,H,t) =
#( (H,t))
The weight [1-ω(P,H,t)] biases the weighted average in
favour of the listeners more unsatisfied with the songs
recently scheduled on the channel H
ω(P, H, t) is the channel satisfaction degree of a listener P
at a time t with respect to the music scheduled on H
To evaluate ω(P, H, t) we combine the satisfaction degrees of
P for each song scheduled on H since P is listening to H
47. SONG SATISFACTION
Let (P,H,t) = (X1,X2,…,Xz) be the set of songs scheduled on H
since P began listening to H. We define the song satisfaction
(P,H,t) scheduled at time ^ < t as:
degree of P for a song Xi t
e(P, Xi, H) = g(P, Xi) - maxS g(P, S) + 1
^
(H,t)
e(P, Xi, H) takes values [-1,1] and equals 1 only when the
scheduled song Xi was the most preferred song by P in the
^
retrieved set (H,t) at time ^ t
Combining the song satisfaction degrees of P for the songs in
(P,H,t) we can estimate the channel satisfaction degree ω(P, H, t)
48. CHANNEL SATISFACTION
Since satisfaction is an emotion that wears off with time, we
combine the song satisfaction degrees assigning more
importance the the most recent songs
We use the following geomtric series: ∑ iz= 1 χz-i e(P, Xi, H)
where χ [0,1] is the decay rate of satisfaction over time
We normalise this series to return values in the interval [0,1]
and define the channel satisfaction degree for P as:
( )
1
∑ iz= 1 χz-i e(P, Xi, H) + 1
ω(P, H, t) = 2
χ = 0.8
49. THE REUSE PROCESS / AUTOMATIC
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
50. THE REUSE PROCESS / INTERACTIVE
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
52. THE REUSE PROCESS / INTERACTIVE
If a listener P sends an explicit preference towards a
scheduled song Z via the Poolcasting web-page, then the
implicit knowledge g(P, Z) that was stored in the Case Base
of P (inferred from the music library listening experience) is
replaced with this new explicit evaluation provided
Next, since the Case Base has changed, the retrieved set is re-
ranked, and the new most group-preferred song is scheduled
This process continues until the previous song scheduled is
played and Z is downloaded to the local buffer; then the CBR
process restarts to schedule the next song
53. THE REUSE PROCESS
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
54. THE REVISE PROCESS
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
56. THE REVISE PROCESS
S g(P,S) S g(P,S)
La Isla Bonita La Isla Bonita
0.5 -1
(Madonna) (Madonna)
I’m Your Man (Wham!) I’m Your Man (Wham!)
s(Y,Z) = 0.5 s(Y,Z) = 0
La Isla Bonita (Madonna) La Isla Bonita (Madonna)
57. THE REVISE PROCESS
Song Associations
Listener local to the channel
requests song
candidate best ranked
REUSE
RETRIEVAL songs song
INPUT
Song and Artist
(channel description,
Associations inferred
last songs scheduled, Listeners'
from public playlists
current listeners) satisfaction
Listener evaluates
CASE BASES
scheduled song
PREFERENCE
SONGS Analysis REVISE
MODEL
PREFERENCE
SONGS Analysis
MODEL
PREFERENCE
SONGS Analysis
MODEL
Listener sends feedback
58. TODAY’S MENU
1. Introduction
2. The Poolcasting web-radio architecture
3. A Case-based Reasoning Song Scheduler
The Participants’ Case Bases
Musical Domain Knowledge
The Retrieve Process
The Reuse Process
The Revise Process
4. Conclusions and future work
59. CONCLUSIONS
Poolcasting proposes a new paradigm for web-radios,
shifting from a classic monolithic approach where “One
controls, many listen”, to a new decentralised approach where
“Many control, many listen”
A Poolcasting web-radio will be up and running in our
Intranet in the next months, ready for tests and evaluations
Users need iTunes and a web sharing service to participate
We assume users will enjoy listening to music from other
libraries, for they can easily get to discover new music
Tests should include both passive and active listeners
60. CONTRIBUTION TO CBR
The Song Scheduler works with multiple participants’ case
bases and with domain knowledge acquired from playlists
containing listening experiences of a large number of users
The collection of case bases is open and dynamic
The Reuse Process combines data and preferences from
different case bases (modeling users’ listening experiences),
and generates a globally good sequence of solutions over a
period of time – not just one “group solution” for a problem
Both intensive knowledge and preference models are used in
the Retrieve and Reuse processes, while users’ feedback is
used in the Revise process to improve customisation
61. FUTURE WORK
Testing the CBR Song Scheduler with different parameters
Dealing with the issues of copyright and privacy
Introducing a reputation degree for the listeners
Extending the users’ preference models with other listening
experience data (e.g., personal playlists, song recency)
Investigate how to apply this approach to other musical
contexts where a group of persons gathers to listen to the
same stream of music
62. ANY QUESTION ?
IIIA - CSIC
Here are some recommended papers:
C. Baccigalupo, E. Plaza (2006)
Case-based Sequential Ordering of Songs for Playlist
Recommendation
J. Masthoff (2004)
Group modeling: Selecting a sequence of television items
to suit a group of viewers
K. McCarthy, L. McGinty, B. Smyth and M. Salamó (2006)
The Needs of the Many: A Case-Based Group
Recommender System