Course:CPSC312-2021/Twitter User Recommendation System

From UBC Wiki

Authors: Gokce Dilek, Shirley Yang

What is the problem?

There are so many communities and topics on Twitter, and sometimes it’s overwhelming trying to find users to follow who post great content you might be interested in. As avid Twitter users ourselves, we were interested in a recommendation system that will find accounts that produce content that is interesting to us. Users will be able to provide keywords/tags and location, amongst other optional preferences that our recommendation system will analyze and output a personalized list of users to follow.

What is the something extra?

We will be building a query engine to find Twitter accounts based on personal preference. Our query engine will be able to translate user input to a request including keywords of interest.

To achieve this functionality, we will build a simple knowledge base to translate user’s preferences to a query to make requests to the Twitter API. We will validate the user’s unique query and transform it into a proper request for the API.

The grammar:

- allows users to input any list of keywords combined with operators (such as “nasa and space”, “grumpy cat or cat”)

- allows users to input filter options (such as “filter media and links”)

Based on this input, we will find user accounts with popular & recent tweets matching the user’s preference.

What did we learn from doing this?

Firstly, we learned how to validate user input against a custom set of rules/grammar that we defined for what a query to the Twitter search API should look like, which allowed us to ensure that we passed a valid query to the API. In addition to validating the query, we were able to transform it into a syntax that can be processed by the search API. We also learned how to make HTTP requests in Prolog using the Twitter search API, as well as to extract the information we needed from the returned JSON object.

Links to code etc