Ben’s Blog

Searching for Jazz

Posted by:

|

On:

|

, , ,

I may have mentioned in one of my first posts that one of my long-term goals is to create a music discovery/recommendation algorithm. The music streaming apps are great at managing playlists and streaming music. But I want a seamless experience for discovering new music. And, without having to listen to the full song, I want to know if it’s similar to music I already know. Which artists collaborated on it? What is the style? Who did it influence? I always have these questions when searching for jazz albums.

Giant Steps

One skill I’ve learned as a developer focused on solutions over code is how to leverage existing features in new ones. Recently, I’ve done a lot of work with document vectors, web-crawling, and search APIs. I realized by putting these methods together, I could write my own jazz album search API. Here’s how it works: You type search words into a search bar. I turn those words into a vector, just like I turn wiki pages into vectors. Then, I find the closest vectors to your search vector and use those page vectors as search results.

This is still a long way my immersive recommendation experience. But just like with this project, when you add up enough small steps, you can get giant steps.

The Front End

I didn’t want to just stop at an API for this feature. Since the idea is to have an immersive recommendation experience, I wanted to start adding context to the search features. In the future, that might be by adding summaries of the results to the UI. For now, I settled on pulling in some metadata and showing the user a visualization of how their search fits into the results. See an example search here:

In the graph on the right, the red dot represents the search term, and the purple dots are the search results. The closer the red dot is to the purple ones, the better the search results.

As usual, I have made the code available and open source at https://github.com/wright-benjamin-1701/jazz-search. Check it out if you’re interested in writing APIs, searches, or front end for paginated search results!