Course:CPSC312-2024/Political Compass Test

From UBC Wiki

Authors: Jerry, Tony, Junming

What is the problem?

The Political Compass is a website that describes its user's political stance using a customized political compass, consisting of two independent axes, one for the economic scale and one for the social scale. Originally created by New Zealand journalist Wayne Brittenden, it evaluates its user's position on the left-right spectrum of economic policy, as well as the authoritarian-libertarian spectrum of social policy, as the user demonstrates agreement or disagreement to each of the 62 statements. For this project, we decide to implement a variation of this evaluation system in Prolog, where, instead of the user answering "agree" or "disagree" to a series of statements, the program repeatedly queries the user for their opinion/view on specific political matters, parses the user's open-ended responses using natural language processing techniques to understand their political lean, and eventually draws a conclusion on the user's political stance with respect to the same political compass described earlier.

What is the something extra?

As we have alluded to in the previous section, we will be taking advantage of Prolog's logical nature and strength in data querying to parse and extract information from written human language, in this case English. This is a rather challenging task, as we are ultimately expecting unstructured natural language inputs from the user and trying to handle such chaos without making mistakes. This is unlike anything else that we have encountered before, so we believe making this our challenge for this project would be most appropriate.

What did we learn from doing this?

We discovered that Prolog is quite suitable for this Political Compass project outlined above, as we were able to easily define relationships between different words, as well as between words and their potential political implications, which in turn allowed us to define how sentences could potentially be formed in user responses and extract key information from them by querying those relationships. However, although we have been able to correctly parse most user responses, we believe that there still exists a small portion of possible sentence structures we failed to define in our parser that lead to certain responses not being accepted by the program. Our current solution amounts to prompting the user to describe their response in a different way, but we believe that more testing can still be done to identify such sentence structures and allow the program to truly be able to accept any unstructured natural language input, as we sought to accomplish at the start. Additionally, our program is currently only able to draw conclusions with regards to one of the two spectra on the aforementioned political compass, which is the economic scale. We believe that implementing the other spectrum would not be so difficult, but rather time consuming, given the significant number of additional word relationships that need to be defined, and we simply did not have enough time to define all such relationships. Nevertheless, the current version of the program is still perfectly functional and serves as a great evidence for the suitability of the Prolog language for similar applications.

Links to code etc.

https://github.students.cs.ubc.ca/tchen66/cpsc312-project2