9 November 2018

How does Spotify know your tastes so well

This Monday, just like every Monday before it, over 100 million Spotify users found a fresh new playlist waiting for them called “discover weekly” : It’s an automatically generated playlist that is made only for you. How does Spotify make a personalized playlist for each single user, how does the company knows you so well ?

 As you may have guessed, Artificial Intelligence is highly involved in the subject, but it is not the only tool. Actually, there is three main methods used by Spotify to “profile” each consumer.

I) Collaborative filtering, or profiling by comparison.

What is collaborative filtering? Here is an image that illustrates what is collaborative filtering:




What’s going on here? Each of these individuals has track preferences: the one on the left likes tracks P, Q, R, and S, while the one on the right likes tracks Q, R, S, and T.

Spotify algorithm, by confronting all this data actually creates a “profile” of those two users, here,we can see that the two users have approximately the same musical profile because they share 3 songs. Thus, Spotify suggests to user 1 song T and to user 2 song P. But you may ask : how does Spotify actually use that concept in practice to calculate millions of users’ suggested tracks based on millions of other users’ preferences?

With numpy arrays, which actually represents 2 dimension matrices full of numbers : By comparing those matrices, Spotify can deduce how closer users profiles are, and consequently make personalized suggestions.

II) Natural language processing (NLP)

The second type of recommendation is based on NLP models, basically, NLP is the ability of a computer to understand human speech as it is spoken. Concretely what Spotify do is that it crawls the web constantly, through social media, blogs, newspapers, etc ...  looking for written text about music to figure out what people think about a song or an artist. So actually it scraps all the key word terms found on internet and then build a sort of dictionary composed by the most used terms and computes the probability that someone will describe the music or artist with that term. But how can a machine understand text?
The main word to remember for NLP is Word2Vec. It’s a model developed by google which consist in a two layer neural network that are trained to reconstruct linguistic context of words and puts forward how closer are those words each others. If you want more information about it, you can check out this article here.

III) Audio models

The third recommendation method that Spotify use is Raw Audio Model, it actually consists in analyzing the behavior of the song signal and compare with well known songs. It helps unknown songs to become popular. How does it work? It actually uses a convolutional neural Network or ConvNets, that is commonly used in image recognition and find similarities with other songs in tempo, signal behaviour, sonorities etc …

By Z.Hamza and L.Nicolas