notspoon

notspoon OP t1_iybodp8 wrote

It’s just the way the calculations and group by statements worked out, man. I don’t know what to tell you. In order to get the color scale to work properly someone had to be negative and someone had to be positive.

Blame the Phoenicians, or the Greeks, or the developers of R, for putting D over R in the alphabet.

Negative number shouldn’t imply negative connotations either. -1 isn’t evil! It’s just a number. 🤷‍♂️

10

notspoon OP t1_iy22ivw wrote

Keep in mind that your songs could still be accurate and have a low score. In order to get the highest score you would have to be very specific by describing each feature of the song that the database uses. The genres, description of the genres, the level of danceability, the loudness in decibels, etc.

2

notspoon OP t1_iy1r2gw wrote

I see where things are going wrong. The current dataset is based off of singles from so I see why classical music and those other genres are hard to find. As with most data science/AI problems, the solution is almost always more data. I'll be adding more songs within the week from a wider variety of styles and genres!

6

notspoon OP t1_iy0yn0v wrote

High level overview:

The sentence embeddings are calculated using a Bidirectional Encoder Representation Transformer (BERT) model. There's a pre-trained model for this network trained on over 1 billion sentences from the internet that is publicly available, (thanks Microsoft) . The model transforms your description into a 784-long list of numbers (a vector) that represents the meaning of your sentence.

The model runs off a dataset of musical metadata for 35,000 songs. This metadata is very rich, it has a lot of useful columns like the genres, subgenres, and descriptions of tracks. The numerical data is binned into categorical values like "obscure" mapping popularity between 0 and 10, "highly danceable" mapping danceability between 80 and 100, etc. The text data is modified into a coherent sentence: "this song's main genres are _____. this song is from the 80s. this name of this song is lovefool by the cardigans. etc"

Each feature for each song in our metadata dataset is now a big paragraph that describes the song overall. The paragraph is split up into sentences, and the embedding of each sentence is found. The final embedding for each song is then calculated by taking the mean all sentence embeddings from the big paragraph.

To make your playlist, all that has to be done is compare the embedding of your query all 35,000 embeddings in the dataset and return the 100 most similar queries, using the cosine similarity distance metric. Thank god we have computers.

Once the 100 most similar tracks are found, your playlist is made by sending the Spotify track IDs through their API, and the link is generated for you.

38