Querying the Database to Generate Recommendations

Learn to query the database to find similar songs and generate recommendations for the users.

We will use a song from the dataset as the one the user is currently listening to and, based on this song, recommend the top five similar songs.

There are three ways we can find similar songs: using metadata embeddings, audio embeddings, or both.

Recommendations based on metadata embeddings

In the following code, we get the embedding for the song the user is currently listening to. We assume it’s a song with ID "LikeaPrayer".

Get hands-on with 1400+ tech skills courses.