Leveraging Sentiment and Emotion Analysis for citizen-centric policymaking

In our previous blog post, we explored how useful sentiment analysis and opinion mining can be in policymaking.

Focusing on how to involve citizens in the policymaking process and use their feedback for local governments to develop more citizen-centric policies, the AI4PublicPolicy team has designed a Representational State Transfer (REST) Application Programming Interface (API), deploying pre-trained models for sentiment, as well as emotion analysis. This solution is designed for the purpose of analysing the text of the project Pilots’ sources that contain citizens’ comments, complaints, recommendations and more, and extracts the sentiment of the text to convert it into actionable insights for the policymakers.

The basic idea is to start with a tool that can accurately analyse the comments and tweets provided by citizens in the Pilots municipalities and to expand this tool to even further data sources as AI4PublicPolicy evolves. The solution designed for this task includes different types of deep learning models incorporated into the inference pipeline.

The internal architecture has been designed to take all information into consideration with minimal user input, thus most of the procedures are happening under the hood and they are not visible to the user. There are three selection parameters to achieve the optimal result for each case – language (en, it, el, pt, bg), task (sentiment, emotion) and context (Twitter, comments). The user has to choose the task and the context since this cannot be inferred programmatically. However, they do not have to provide a language since there is a very accurate language identification model in place. Thus, considering all these parameters {context, task, language} the API has independent endpoints that correspond to the optimal model that is chosen internally.