Course:CPSC312-2023/Spotify Recommender

From UBC Wiki


Authors: Saad, Aymen

What is the problem?

Spotify offers the ability to search for specific users, the playlists created by those users, the tracks contained inside those playlists, as well as albums, genres, audiobooks, etc. We would like to create a program that enables natural language processing to allow the user to query for these things.

What is the something extra?

We will be incorporating the Spotify API into our project, allowing us to access live data directly from Spotify. We will also be using a library to abstract some of the network request logic, but plan on dynamically building the endpoints depending on what the user has queried.

What did we learn from doing this?

  • What is the bottom-line?
    • We succeeded in our goal of making a NLP query engine for Spotify to allow users to ask questions and get recommendations, but throughout development, we realized that Prolog is a difficult language to work with. Some instances where we faced difficulties are listed below.
      • Prolog is hard to debug. There's no notion of returning values from functions like in other conventional programming languages, so trying to figure out what functions did what was a source of difficulty. This was especially apparent when we were reading through the Spotify library's code to try to alter it to our purposes.
      • Documentation is sparse. There is not a large community of developers for Prolog, so were left to our own devices when trying to understand how network requests work in Prolog. The way our project does it is by making curl requests to our desired endpoint with all the appropriate headers and flags being set.
      • It feels unintuitive to write maintainable/scalable code since predicates don't work the same way as a regular imperative function would. Representing conditional statements with the "conditional OR" require an entire predicate to be copied and pasted with a slight variation
  • Is functional programming suitable for (part-of) the task?
    • Functional programming styles were nice for certain aspects of this project. In particular, list iteration over responses from the API seemed like a very natural application of functional programming. Network requests were not however and were a source of difficulty during development.
  • Make sure you include the evidence for your claims.
    • Incorporated in the above responses

Links to code etc

Source code

Library used: https://github.com/ReedOei/spotify