In this section we explain a procedure to explore the evolution of the sentimental change of political parties along this last four years.
Within the area of Data Science, human language is studied under the umbrella of Natural Language Processing (NLP). With the increasing use of AI, NLP has become a very powerful way to analyse and predict human communication. For example, with NLP tools one can effectively identify fake content , predict the next word/sentence in a conversation , analyse speech patterns , generate new texts  among many others.
For this project we focused on the evolution of sentiment, namely how positive or negative tweets from party representatives are. Most words do not carry any universal sentimental value, e.g. ’house’ is a neutral word for most people, but other words do carry universal sentimental value. For example ’great’ and ’horrible’ have clear sentiment associations, as well as smiling or vomiting emojis.
In the area of NLP we have tools to transform a string of text into a sentiment score, with positive/negative numerical values indicating the level of sentiment. For the analysis we will present here, we used a python library called VADER (Valence Aware Dictionary and sEntiment Reasoner) , which is particularly well adapted to social media contexts. This library is only available in English, hence we first translate the tweets to English using a python library translate  and perform the analysis on the translated tweets.
We can represent sentiment in a number of ways, and here we choose two: (1) distribution of sentiment of the political parties, and (2) time-evolution of this sentiment as a consequence of external events.
Firstly, in Fig. 4 we analyse all tweets from 2019 and plot the sentiment distributions. The traditional parties, and (upper panel), show a clear bias towards positive sentiment. We have observed this behaviour in all years we have analyzed, despite the change in government. On the other hand, newer parties (lower panel) exhibit a different distribution, as the ratio of negative to positive messages is more even than for the traditional parties. In the case of this ratio decreased in 2019, coinciding with their joining of in a coalition government. Acquiring governing responsibilities seem to have lowered their level of polarization.
This separation of behaviour of well-established and newer parties may be due to the level of political experience in their leadership composition. Established parties may not engage in too-extreme messages to the population, trying to display a position of more balanced and professional communication.
Besides overall positivity and negativity distributions, one can quantitatively investigate whether changes in sentiment could be linked to specific events. To do so, in Fig. 5 we display the monthly median of sentiment level.
There are a number of points to discuss in this figure. In the following discussion, when we talk about a party’s positivity or negativity, we simply refer to the value in this curve, it is not meant to be an absolute statement about the party.
If one pays attention to the horizontal dashed line, corresponding to zero overall sentiment, the red and blue lines are above that line for the whole period, except that drops sharply below during the COVID pandemia. The overall positivity of these two traditional parties has already been noted in Fig. 4. The jump of to negative values as the lockdown evolved could be a reaction to the government’s ( and ) handling of the pandemia, of which has been extremely critical.
New parties are markedly more negative, as their average values tend to lie below the neutral (0 value) dashed line, again a reflection of what we already observed in Fig. 4.
Moreover, there are interesting differences among these new parties. is clearly the most biased towards negative sentiment, as the sentiment line is consistently below 0 along the whole period, and it also displays a more variable behaviour, with large up and downs. The behaviour of centrist was closer to the traditional parties during the period preceding the Catalonian independence proclamation, with average values mostly above the zero-value dashed line, but at that moment it started dropping in sentiment values. This negative trend seem to be broken in March 2020, where a new leader was elected for this party. On the other hand, shows an interesting evolution: with an overall negative profile until the 2019 general elections, where the trend changes. Note how sentiment line becomes predominantly positive from that point on and also note how the ups and downs after the elections are correlated with those of .
’s sentiment values after the 2016 election, when this party did not fare particularly well (see Fig. 1) seem to evolve towards more negativity. This negative trend is also apparent during the months preceding the Catalonian declaration of independence. As discussed in the ideological bubble section, territorial identity issues are a strong focus of and it could be related to that trend. Note that the independence process was squashed, its political leaders were arrested or fled the country. This failure strengthened the ideological position of , and could be the origin of the unusual level of positivity in the early 2018. Another positive trend appears in the 2019 general elections, when ’s representation increased dramatically, see last graph in Fig. 1, becoming the third most voted party in Spain. Following the other opposition parties, shows a downward trend following the beginning of the COVID pandemic.
Despite ’s overall positive sentiment, one can observe a negative correlation with up to the Catalonian declaration of independence. Up to that point, an upward trend for was paired with a downward evolution for and vice-versa. After that point, we see exhibiting downward trends related to negative events for the party, e.g. the President’s impeachment, leading to the loss of the governance for PP. We also see a positive peak in-between the two 2019 general elections (April and November of the same year), when the leading party was unable to form a coalition government and re-ran the elections.
Between the same two 2019 general elections, went from 57 representatives to 10. The re-run of the elections was very damaging for this political party but, interestingly, the evolution of the sentiment was not the expected downward trend.
Finally, let us note that the sentiment values of went up after a successful impeachment, and each general election in 2019 —when they were the most voted political party. Their sentiment values decreased sharply around the time lockdown was announced by their governing coalition, and also after Catalonia’s independence declaration.