Inspiration

Did you know that about 35% of Spotify users have trouble finding the song they want? Source? I made it up.

On a real note, we actually came up with idea first, but then we scrapped it because we thought it was impossible. Many hours later of struggling, we thought we were doomed because there were just no other brilliant ideas like that first one we had come up with. Soon, we learned that the word "impossible" isn't in the hackathon vocabulary when we came up with a way to make the idea doable.

What it does

PlayMood works by allowing users to fetch a Spotify playlist by entering the playlist ID. Then, users get a choice of moods to pick from from happy to sad, exciting to calm. Next, the lyrics of the songs are analyzed line-by-line to come up with a prediction about each song's main mood and how strong it corelates to that mood. Finally, the application sends back to the user the list of these songs with the audio to listen to.

How we built it

Frontend: React.js
Backend: Flask, Express.js
External APIs: Cohere, Spotify, Genius

Challenges we ran into

The initial challenge was looking for a way to extract the lyrics from the Spotify playlist. We realized this wasn't possible with the Spotify API. Another challenge was communication and overall planning. When everyone's tired we start doing our own thing. We had one API in Flask and the other in Node.js.

Accomplishments that we're proud of

The largest accomplishment is actually finishing the project and implementing exactly what we wanted. We're also proud of being able to synergize as a team and connect the pieces together to create a whole and functioning application.

What we learned

Our main goal for hackathons is always to come out learning something new. Harsh learned how to use the Cohere and Genius API to fetch lyrics from songs and classify the lyrics to predict a mood. Melhem learned how to use Flask for the first time to create the API needed for the lyrics classifications.

What's next for PlayMood

When building PlayMood, we knew to make things simple while keeping scalability in mind. One improvement for PlayMood could be to increase the amount of moods to choose from for the users. To take this a step further, we could even implement Cohere classification for user messages to give users a much more diverse way to express their mood. A big thing we can improve on is the performance of our Flask API. Searching the lyrics for many songs takes several seconds, causing a large delay in the response time. We are planning to search for a solution that involves less API calls such as storing search results in a database to avoid duplicate searches.

Share this project:

Updates