CPSC312-2023-Book-Recommender

From UBC Wiki

What is the problem?

Deciding what book to read next can be overwhelming due to the number of options available. We created a book recommender system with two main features to combat this problem:

  1. A recommendation system that prompts users to answer various questions about their preference of book genres, lengths, and ratings and returns five books that meets the criteria based on the library (knowledge base).
  2. A search system for users to ask queries related to books and answers them based upon information retrieved from Google Books API.

The recommendation system is created by importing a .csv file dataset from Kaggle "Goodread's Best Books Ever" which is used as our recommender knowledge base. Our recommendation system reads from this file and returns a list of 5 books based on user's preference.

What is the something extra?

We have integrated the Google Books API to create a search system which allows us to to retrieve information based on the user's queries.

Some possible queries of our search function:

  • Give me the first five search results for To Kill a Mockingbird.
  • What is an interesting book written by Madeline Miller?
  • Who wrote The Catcher in the Rye?
  • Who is the author of The Catcher in the Rye?
  • I want the description of Anna Karenina.
  • What is the genre of The Book Thief?
  • What are some books in the genre of romance?
  • What type of books are written by Margret Atwood?
  • What is the title of a book written by Stephen King?
  • Tell me more information about The Great Gatsby.
  • Give me some exciting books in the genre of mystery.

What did we learn from doing this?

We learned that logical programming is suitable for recommender systems. Prolog's syntax and ability to pattern match and its search functionality make it a suitable language for natural language processing applications. For example, we were able to create a dynamic knowledge base through reading and pattern matching from a CSV file. It was also simple to filter entries to fit criteria based on user's input because Prolog's simple syntax allows us to find all possible answers to queries. An inconvenience that occurred was handling entries on the .csv file that were empty or incorrect, however, we decided the quality of the dataset should not be a major concern that we can control on our end.

There were some restrictions while working with the Google Books API such as being unable to fully control the results that was generated by Google Books. Since we were simply taking the results given by Google and returning that to the user, we found that Google's search algorithm could give some results that were perhaps not most relevant. This meant that queries worked best when specific details would be asked. Another limitation we ran into for the API feature was the openness of user input due to the variability of grammar/sentence structure of the user, but this is not a perfect robust system, it serves as our attempt to explore nature language processing via Prolog.

Links to code etc.

https://github.com/cjyu98/CPSC-312-Book-Recommender