Skip to content

Music recommendation system for providing a group of people with fresh music that fits all.

License

Notifications You must be signed in to change notification settings

taslanidis/Music-Recommender

Repository files navigation

Music Recommender

Consider being at a party or gathering. How tedious it would be to choose what music to play in order to be fine-tuned for the attendees 👯. Should I go to each one, ask them, write down their music preference, and then search for a playlist?

That got me working on a music recommendation algorithm for large groups of people, using Spotify as a music provider.

  1. People attending a party or gathering are able to share music with the host.
  2. Party host can set specific preferences (e.g. preference for dance music)
  3. The algorithm using unsupervised ML techniques can identify distinct music tastes present in the group and provide relevant tracks to satisfy and get all attendees to enjoy their time.

Outline

  • Web Scraping to create a large music artist graph (with the connections between artists).
  • Node2Vec to create artist embeddings based on graphs.
  • Auto-adjusted DB-SCAN.
  • TSNE.
  • k-NN with cosine similarity between track representation vectors.

Idea

⭕ 👤 → 🎶 Music recommendation for individuals has long been ongoing on major platforms such as Spotify and Youtube.

✅ 👥 → 🎶 The issue at hand is how to deal with recommending music based on a dynamic environment of people entering or leaving a group.

Track Representation Vector

The foundation of the algorithm is the track representation vector.

TRV

Audio features

AudioFeatures

Artist Embeddings

Artist embeddings have been created by web scraping Wikipedia. Who other artists have they collaborated with, who they had a concert with, and others that are a simple reference in the same page.

In order to plot them in the 2D space, the TSNE dimensionality reduction algorithm is used.

ArtistVectors

Genre Embeddings

Created Genre embeddings using sentence transformers with BERT LLM.

GenreVectors

Identifying Group Music taste profile

The profile can be identified by one or more vectors that will be later used for recommendations.

In order to do that, all the track representation vector dimensions are reduced with TSNE, and then all different music tastes are identified with the DBSCAN clustering algorithm.

2dgraphtracks

Process:

  1. M clusters from DBSCAN
  2. Find the weighted centroid of the cluster based on each users track weight. (This is relevant to how many tracks each user submitted)

vector_n_space

Recommendation algorithm

  1. The party/bar/club owner can set party settings to finetune results to specific preferences, e.g highly danceable or include only techno and deep house tracks.
  2. For each M profile there are K possible matches which will all be filtered based on settings, and the neighbors with the highest scores will be kept.

Curator

Because different versions of the same tracks exist with the same vectors, a curator has been created that operate as a DJ, that will keep the most relevant version of same tracks, and sort the tracks recommended based on energy and track bpm.

System

A system has been created with FastAPI that you can just execute and have the backend ready for your application.

There are all the necessary endpoints ready for consumption.

About

Music recommendation system for providing a group of people with fresh music that fits all.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published