# Evolution of the political opinion landscape during electoral periods

Tomás Mussi Reyero1 Mariano G. Beiró1,2<EMAIL_ADDRESS>
J.Ignacio Alvarez-Hamelin1,2 Laura Hernández3 Dimitris Kotzinos4 1Universidad
de Buenos Aires. Facultad de Ingeniería, Paseo Colón 850, C1063ACV, Argentina
2CONICET – Universidad de Buenos Aires. INTECIN, Paseo Colón 850, C1063ACV,
Argentina  3Laboratoire de Physique Théorique et Modélisation, UMR-8089 CNRS,
CY Cergy Paris Université, 2 Av. Adolphe Chauvin, 95302, Cedex, France  4ETIS
UMR-8051 CY Cergy Paris Université, ENSEA, CNRS, 2 Av. Adolphe Chauvin, 95302,
Cedex, France.

###### Abstract

We present a study of the evolution of the political landscape during the 2015
and 2019 presidential elections in Argentina, based on the data obtained from
the micro-blogging platform Twitter. We build a semantic network based on the
hashtags used by all the users following at least one of the main candidates.
With this network we can detect the topics that are discussed in the society.
At a difference with most studies of opinion on social media, we do not choose
the topics a priori, they naturally emerge from the community structure of the
semantic network instead. We assign to each user a dynamical topic vector
which measures the evolution of her/his opinion in this space and allows us to
monitor the similarities and differences among groups of supporters of
different candidates. Our results show that the method is able to detect the
dynamics of formation of opinion on different topics and, in particular, it
can capture the reshaping of the political opinion landscape which has led to
the inversion of result between the two rounds of the 2015 election.

##  I Introduction

Our understanding of how opinion is formed and evolves in society has
benefited since the last decade from the rapidly increasing amount of data
diffused by on-line social networks. In this way, large scale, cross-cultural
studies that were difficult to perform based on standard off-line surveys
become feasible.

In spite of the different biases that are known to affect studies based on on-
line social networks, in terms of age, gender, residence location, social
status, etc., the enormous amount of information they convey remains useful in
particular to detect trends in the evolution of social opinion, at least
restricted to the users of these platforms whose amount increases
continuously. Moreover nowadays traditional broadcasting media, like radio or
television, diffuse information or opinions selected from on-line social
networks thus coupling this large but biased set of users with the general
population.

The micro-blogging platform Twitter has been widely used in order to study the
evolution of social opinion on different topics Gaumont et al., (2018); Boutet
et al., (2013), as well as the properties of the social interaction networks
that result from the different functionalities offered by the platform
(mentions, retweets, follower-followee) Himelboim et al., (2013); Barberá,
(2015). The intrinsic properties of the platform, like the small size of posts
(tweets limited to 280 characters), or its simplicity of usage, (a message can
easily be re-transmitted, a mentioned user can be alerted, etc.) make it an
excellent tool to study situations where the time scale for the opinion’s
evolution is short as in electoral processes Ahmed et al., (2016); Gaumont et
al., (2018); Caldarelli et al., (2014); Tumasjan et al., (2010) or in social
protests Borge-Holthoefer et al., (2011); Alvarez et al., (2015); Howard et
al., (2011).

The possibility to predict opinion evolution using Twitter, which is of
particular interest during an electoral campaign, has been seriously
challenged Murthy, (2015); Gayo-Avello, (2012); Chung and Mustafaraj, (2011).
Nevertheless, this kind of studies remain interesting because of their
explanatory power. For instance, it was possible to unveil the spontaneous
character of the emergence of off-line demonstrations during the Spanish
social movement 15M by correlating the intensity of posts at a given location
with the different gatherings observed off-line Borge-Holthoefer et al.,
(2011). Also it was possible to identify the origin of a denigrating campaign
against one of the potential candidates to the last French presidential
election by studying the community structure of a network of retweets Gaumont
et al., (2018).

Twitter users share text messages, images and videos, and they may associate
their posts to a concept, by the means of hash-tags (words beginning by the
character “$#$”), in order to install a given concept to be discussed on the
public ground.

Among a vast literature devoted to studies of social phenomena based on
Twitter data, one can identify those studies that concentrate on the structure
of the different networks that can be defined (follower-followee, retweets,
mentions and answers), and those which try to infer the opinion dynamics,
based on text mining and analysis. Both aspects, structure and content, are
nevertheless entangled, as users are mainly exposed to the content produced by
those other users that they have decided to follow or by those selected by the
algorithms of the platform Himelboim et al., (2013); Barberá, (2015). This
situation has been shown to lead to the phenomenon known as _echo chambers_ or
_bubbles_ , meaning that in fact, in the worldwide open field of Twitter (as
well as that of other internet platforms) users are mostly and sometimes
uniquely exposed to the same information, frequently the one that comforts
their own opinion, thus limiting the possibilities of a real discussion Kelly
and Francois, (2018); Nikolov et al., (2015); Eady et al., (2019).

An interesting way to study the structure of opinions in Twitter exploits the
hashtags chosen by the users, assuming that this choice reveals a concept that
the user wishes to address. In a recent work Cardoso et al., (2019), topics
are defined by determining the community structure in a weighted network of
hashtags, where two hashtags are connected if they appear together in the same
tweet. Assuming that the coexistence of hashtags is semantically meaningful,
the community structure of such network can reveal the general topics under
discussion. In this way, the users may be characterized by a topic vector,
with a dimension equal to the number of communities detected and where each
component informs about the interest of the user on the different topics. The
authors show that the similarity among users connected by a follower-followee
relationship or by a mention relationship is higher on average than the
similarity among a sample of random users.

In this work we extend the ideas developed in Cardoso et al., (2019) to a
dynamical study of the rapidly evolving opinion landscape that takes place in
a society during an electoral campaign. This method allows us to recover the
dynamics of the political tendency without introducing questions to the
population, which are known to be subject to different bias (of formulation,
false declarations, etc.) and without imposing a priori, neither an ontology
nor the number of topics to be inspected. Our method just extracts the
information coded in the data with the only assumption that two hashtags used
in the same tweet are semantically related. Our results show that, in spite of
the limitations of studies of opinion using Twitter described above, this
method is able to capture the opinion evolution of the users with a high
enough time-scale resolution so as to detect, for example, the reconfiguration
of the political landscape taking place in the short period between the first
and second round of the election, which, in one of the cases presented here,
overturned the score of the first round of the election.

##  II Methods and Data set

###  II.1 Data Capture

This study is based on data captured during the two recent Argentinian
presidential campaigns, in 2015 and in 2019. The periods of data capture
extend from July 1st 2015 to March 31st 2016, and from January 1st, 2019 to
December 10th 2019, the main elections being held on October 25th, 2015 and
October 27th, 2019 (see the SI for a detailed description of the electoral
processes).

The capture is based on the _active_ followers (we define a user as active in
Twitter if he/she posted at least one tweet during the first month of capture)
of the candidates for president or for deputy-president of each of the main
political parties participating in these elections. We filter those users
whose profile location is set to some city/province in Argentina, in order to
focus on those Twitter users that are residents in the country, and we capture
and process all their tweets in the period. Table 1 gives a summary of the
basic statistics for each dataset.

A detailed description is provided in the SI regarding the number of tweets
captured daily and their classification as original tweets, simple retweets,
retweets with comment and replies along with an analysis of the geographical
and gender distribution of our user base.

Table 1: Basic statistics for each electoral process. | 2015 elections | 2019 elections
---|---|---
Number of active argentinian users (AAU) | 218k | 586k
Number of tweets by AAUs captured | 50M | 280M
Time frame | Jul. 1st, 2015 to Mar. 31st, 2016 | Jan. 1st, 2019 to Dec. 10th, 2019
Primaries | August 9th, 2015 | August 11th, 2019
First round | October 25th, 2015 | October 27th, 2019
Second round (ballotage) | November 22nd, 2015 | –

###  II.2 Definition of topics and user’s description vectors

Hashtags are keywords created and chosen by the users, which can be
interpreted as representing the engagement of users with events, ideas or
different discussion subjects. If two hashtags highly co-occur (i.e., they
frequently appear together in the same tweet) it is a reasonable hypothesis to
assume a semantic association between them. Following the ideas developed in
Cardoso et al., (2019), we build a complex weighted network based on hashtags’
co-occurrence. Then, the topics of discussion arise as communities measured on
this network, which we detect using the OSLOM algorithm Lancichinetti et al.,
(2011). It is worthwhile noticing that the topics simply _emerge_ from the
community detection algorithm which is completely agnostic regarding their
meaning and does not pre-determine their number.

We describe the interests of each user $i$ by means of a user description
vector $\boldsymbol{d_{i}}$ of dimension $N_{T}$, the number of topics
(communities) found, which informs about the topic preferences of user $i$.

This description vector is computed in the following way:

  1. 1.

We build a user-topic matrix, $U$, where each element, $u_{ij}$, gives the
absolute number of times that user $i$ has used a hashtag that belongs to the
community identified as topic $j$.

  2. 2.

We compute the global topic vector
$\boldsymbol{T}=\sum_{i}^{N}{\boldsymbol{u_{i}}}$, where $\boldsymbol{u_{i}}$
is the $i$-th row vector in the user-topic matrix, and $N$ the size of the
population. This vector gives the total number of times that each topic has
been used by all the users in the dataset.

  3. 3.

We define the vector $\boldsymbol{v_{i}}$ which gives the difference between
the frequency of usage of the topic by user $i$ and its global frequency of
usage in the population.

$\boldsymbol{v_{i}}=\frac{\boldsymbol{u_{i}}}{||\boldsymbol{u_{i}}||_{1}}-\frac{\boldsymbol{T}}{||\boldsymbol{T}||_{1}}\enspace.$
(1)

Here the norm $||.||_{1}$ must be understood as the sum over all the
components in the space of dimension $N_{T}$. The vectors of Eq. 1 thus inform
about whether user $i$ has addressed each of the identified topics more or
less than on average.

  4. 4.

As we are only interested in the orientation of the description vectors, they
are normalized as:

$\boldsymbol{d_{i}}=\frac{\boldsymbol{v_{i}}}{||\boldsymbol{v_{i}}||_{2}}\enspace,$
(2)

where $||\boldsymbol{v_{i}}||_{2}$ is the standard euclidean norm in the topic
hyperspace of dimension $N_{T}$.

##### Dynamical measurements.

In order to track the evolution of the users’ interests we apply the
aforementioned procedure to sliding time windows of 7 days, thus producing a
series of matrices $U_{t}$, one for each day. We shall call
$\boldsymbol{d}_{i}^{t}$ the description vector for user $i$ at discrete time
$t$.

The full procedure is illustrated in Fig. 1.

###  II.3 Measuring the similarity between groups of users

We define the similarity between a pair of users $i$ and $j$ as the cosine
similarity between the corresponding description vectors. As the latter are
normalized, the similarity reduces to the inner product:

$s(i,j)=\langle\boldsymbol{d_{i}},\boldsymbol{d_{j}}\rangle\enspace.$ (3)

We also define the average description vector of a group of users $G$, of
cardinal $|G|$:

$\boldsymbol{D_{G}}=\frac{\sum_{i\in G}\boldsymbol{d_{i}}}{|G|}\enspace.$ (4)

Figure 1: Illustration of the procedure used to compute the dynamical user’s
description vectors. The semantic network (panel a) is built by connecting two
hashtags that appear together in the same tweet (panel b). The community
structure of this network determines the topics that are discussed in the
platform (the colors of the nodes code the communities). In order to obtain
the dynamical user-topic matrices (panel d) we consider all the tweets in a
sliding time window of seven days (panel c); each row corresponds to a single
user and codes in the columns the number of times that the user has used one
hashtag belonging to the corresponding topic during the considered period. The
normalized sum over all the users of each column of the user-topic matrix
(panel d) gives the average usage of each topic as a function of time, while
the rows of the matrix give all the topics discussed by a single user.
Finally, for each user one can obtain the vector $\vec{d_{i}^{t}}$ (panel e)
which gives the difference between the topics interesting user $i$ at time $t$
and the average usage of the topics over the population.

Now we can introduce two indices measuring collective similarities:

  * •

The cohesion of a group of users, intra-group similarity or self-similarity,
$s(G,G)$, defined as the average similarity between all its users, and
computed in the following way:

$s(G,G)=\frac{\sum_{i,j\in G}{s(i,j)}}{|G|^{2}}=\frac{\sum_{i\in
G}{\langle\boldsymbol{d_{i}},\boldsymbol{D_{G}}\rangle}}{|G|}={\langle\boldsymbol{D_{G}},\boldsymbol{D_{G}}\rangle}=||\boldsymbol{D_{G}}||^{2}\enspace.$
(5)

  * •

The cross-group similarity is the average similarity between members of
different groups $G_{1}$ and $G_{2}$, namely $s(G_{1},G_{2})$:

$s(G_{1},G_{2})=\frac{\sum_{i\in G_{1},j\in
G_{2}}{s(i,j)}}{|G_{1}|\cdot|G_{2}|}=\frac{\sum_{i\in
G_{1}}{\langle\boldsymbol{d_{i}},\boldsymbol{D_{G_{2}}}\rangle}}{|G_{1}|}={\langle\boldsymbol{D_{G_{1}}},\boldsymbol{D_{G_{2}}}\rangle}\enspace.$
(6)

##  III Results

The results presented in this section are based on tweets collected as
described in Section II, for the two last presidential elections in Argentina
(details of the retrieval and cleaning methods of the data-set can be found in
the SI).

As explained in section II.2, we built the semantic network with the
assumption that hashtags used in the same tweet carry some semantic
similarity. The community structure of such network reveals the topics that
are discussed in the society, and the description vectors allow us to
characterize the interests of each user, in the topic space.

In Fig. 2 we show the structure of a topic (right panel) composed of hashtags
supporting the Cambiemos party (C), one of the two major parties in the second
round of the 2015 election. As the topics emerge from the community analysis
without any a priori information introduced into the system (they are
arbitrarily labelled by a number), it is the inspection of the hashtags
included in each community that informs about the subject to which each topic
is related. On the left panel we show the cumulative number of supporters of
each political party referring to that topic. This shows that, although it is
not always true that people choose a hashtag only to support the idea it
conveys (notice that members of other parties, including the strongest
opponent, FV, also use the considered topic), on average, our method does
correctly capture the expected preferences of the users. On the right panel,
the $k$-core structure of the sub-network of hashtags that compose this topic
is shown. The $k$-core decomposition represents a graph as a series of layers
(the cores) in which the core of index $k$ is the maximal induced subgraph
with minimum degree $k$ Alvarez-Hamelin et al., (2006). In our figures, the
node color represents the coreness of each hashtag (the largest core to which
it belongs), and its size represents its degree (the number of hashtags it is
connected to). A similar description of a topic in support of the largest
opponent party, FV, can be found in the SI.

Figure 2: Main topic supporting the C party during the second round of the
2015 elections. Left panel: Cumulative usage of the topic by the supporters of
the different parties. Right panel: Hashtag sub-network of the topic. Nodes
are arranged according to the $k$-core decomposition of the community graph.
Figure produced with LaNet-vi Alvarez-Hamelin et al., (2014).

Argentinian law imposes to the citizens the obligation to vote. As a
consequence, not only high participation rates are observed but also political
discussions occupy a significant part of the public attention. In both
elections the political opinion was highly polarized, with two main antagonist
parties dominating the political spectrum. Other two or three smaller parties
may, on certain occasions, play the role of a pivot for the determination of
the final result; therefore understanding the evolution of the opinion of
their supporters is a crucial issue. We will see that this was the case of
2015 election, where a second round was necessary to determine the winner. A
second round only takes place if no party obtains either (i) more than 45% of
the votes or; (ii) more than 40% and a 10% difference with the second most
voted party.

Unlike in 2015 election, no second round took place in 2019. In fact that
year, the primary elections played the role of a first round. The electoral
rule establishes that the primary elections, called PASO, _Primarias Abiertas,
Simultaneas y Obligatorias_ meaning “open, simultaneous, and compulsory
primary elections”, take place simultaneously and all the competing parties
are bound to present at least one candidate. Due to the particular political
configuration of that moment, no party took the risk to divide its votes into
several candidates, and therefore they presented one single candidate each.
Under such circumstances, these primaries were seen as rehearsal of the
general election.

Both situations are excellent case studies for this work because they present
a short time window with a fast dynamics of political opinion, allowing us to
detect the reconfiguration of the opinion landscape at two different
elections, corresponding to different political situations, thus confirming
the validity of our method.

###  III.1  2019 Elections

The two main parties intervening in this election were _Juntos por el Cambio_
(JPC), whose candidate was the incumbent, and the challenger (and previous
ruler) _Frente de Todos_ (FDT).

Table 2 describes the main participant parties along with their acronyms and a
rough characterization of their position in the political spectrum.

| Party Name | Acronym | Political/economical orientation | PASO | 1st Round
---|---|---|---|---|---
$\blacksquare$ | Juntos por el Cambio (in power) | JPC | Center-right, economically liberal | $31.80\%$ | $38.67\%$
$\blacksquare$ | Frente de Todos (challenger) | FDT | Center-left, economically interventionist | $47.79\%$ | $48.24\%$
$\blacksquare$ | Consenso Federal | CF | Center, economically liberal | $8.15\%$ | $6.14\%$
$\blacksquare$ | Frente de Izquierda | FI | Leftist party | $2.83\%$ | $2.16\%$
$\blacksquare$ | Frente Despertar | FD | Right party | $2.16\%$ | $1.47\%$
Table 2: Acronyms and characteristics of the main contenders of 2019
presidential election.

Fig 3 shows the self-similarities for the parties participating to the 2019
election as a function of time.

Figure 3: Self-similarity of the supporters of the main parties listed in
table 2.

The ruling party shows, in general, a higher self-similarity than the others
which increases as the PASO approaches, reflecting the strong cohesion of its
supporters. This may be interpreted as the strong need to defend their
governmental choices face to its several opponents. Interestingly, peaks of
strong self-similarity are observed at different times, for the two minority
parties at both extremes of the political spectrum, FI and FD. This is the
signature of the occurrence of a particular event which triggers a coherent
reaction among the supporters of one party while for the supporters of the
other parties the reaction to that event is not discriminating. This happens
when the event is in resonance with the political traditions of one of these
parties.

It is worthwhile noticing that the description vectors of the users contain a
large diversity of topics, many of which do not have a political character.
When the public discussion is dominated by one of these topics (for instance a
football championship) the differences among the supporters of different
parties may be partially and temporarily washed out. This effect is enhanced
far from the electoral dates, where we can observe that the all the parties
fluctuate around the same value of self-similarity, except for the isolated
peaks already mentioned.

In order to further investigate the observed isolated peaks, it is necessary
to proceed to a careful inspection of the dominant topics at the considered
date. This can be done using the platform we have created to analyze the
evolution of the different topics Guerrero et al., (2019). Let us consider, as
an example, the two sharp peaks observed in Fig. 3, by the end of March 2019
which correspond to the curves of FD and FI (black and red respectively).

Figure 4: Discussions during 2019 electoral period. Topic complaining of high
taxes while JPC party was ruling. The vertical dotted lines indicate the dates
of the primary and main elections. Left: Time evolution of the topic usage by
the supporters of the different parties (7-day rolling average). Right:
Hashtag composition of the topic. Nodes are arranged according to the $k$-core
decomposition of the community graph. Figure produced with LaNet-vi Alvarez-
Hamelin et al., (2014).

Fig. 4 shows that the peak of the FD self-similarity curve, located at March
21st 2019 (in black) corresponds to a demonstration against tax rises which
took place that day in front of the National Congress. This is a subject that
usually interests right and liberal parties, although JPC supporters (mainly
liberals) did not comment on it on the same terms, because their party being
in power, was responsible for the tax rise. In fact, an inspection of the
topics that interested JPC supporters at that time using the platform Guerrero
et al., (2019) (cf. the smaller peak of the JPC curve (yellow) observed in
Fig. 3), shows that this small peak does not correspond to the topic analysed
here.

Fig. 5 depicts the temporal behaviour of the topic involved in the other peak
of Fig. 3, situated around March 24th (FI curve, in red). This day celebrates
the remembrance of the victims of the last dictatorship in Argentina
(1976-1983). The leftist parties (FI and FDT) are the most concerned with the
topic during that day, while the more conservative JPC and FD (right wing) are
scarcely active in the topic. Interestingly this topic is later reactivated
periodically, but mainly due to the activity of FDT, which is a major,
composite party including an important left wing.

Figure 5: Discussion during 2019 electoral period. Topic evoking the
anniversary (March 24th, referred as M24) of the installation of the last
dictatorship. The vertical dotted lines indicate the dates of the primary and
main elections. Left: Time evolution of the topic usage by supporters of the
different parties (7-day rolling average). Right: Hashtag composition of the
topic. Nodes are arranged according to the $k$-core decomposition of the
community graph. Figures produced with LaNet-vi Alvarez-Hamelin et al.,
(2014).

So, the inspection of the topics shows that the three peaks observed very near
the end of March 2019 in the self-similarity curve correspond to different
discussions. In this way the evolution of the self similarity captures the
dynamics of the important topics discussed on the platform. Other significant
peaks have been equally identified and the interested reader can find a more
detailed description in the SI, as well as a dynamical inspection of the
topics in the platform for topic visualisation and analysis that we have
created Guerrero et al., (2019).

Figure 6:  Cross-similarity between the supporters of the two main competing
parties in 2019. The vertical dotted lines indicate the dates of the primary
and main elections. In brown, temporal evolution of the cross-similarity
between the supporters of the JPC and FDT parties. The self-similarities of
the two parties are also shown for the sake of comparison (yellow and light
blue curves).

Cross-similarity curves reveal other aspects of the evolution of the opinion
during the electoral process. The brown curve in Fig. 6 shows the cross
similarities between the two main antagonistic parties in 2019, JPC and FDT,
compared to the respective self similarities (i.e., the same curves shown in
Fig. 3), plotted as a reference. As expected, we observe that the higher the
self-similarities, the lower the cross-party one. The cross-similarity
strongly decreases in the vicinity of the primary and the main elections.

Figure 7:  Cross-similarity between the supporters of each of the minority
parties and those of the two major ones in 2019, JPC (in yellow) and FDT (in
light blue). In each panel the self-similarity of the corresponding minority
party is reproduced as a reference. Top: Cross-similarity of FD against the
two main parties. Center: Cross-similarity of CF against the two main parties.
Bottom: Cross-similarity of FI against the two main parties.

The inspection of the dynamical behaviour of the cross-similarities between
supporters of the minority parties with the two major ones is particularly
interesting, as it reveals to what extent they contribute to influence the
final outcome. Fig. 7 shows a clear difference of behaviour among smaller
parties. In the top panel, while FD (Right party) has, most of the time and in
particular near the electoral periods, a positive cross-similarity with the
JPC in power, it holds almost always a negative cross-similarity with the
challenger (FDT). Interestingly by mid-november 2019 this tendency is
reverted, and a (small) positive similarity with FDT is observed at the same
point where a strong self-similarity appears for the supporters of FD party.
An inspection of the active topics of the moment reveals that this activity is
related with Latin-american international politics, which mobilizes both
parties but on opposite sides of the opinion spectrum. This shows that
although we do not perform any sentiment analysis here, the attention of the
groups about a given subject is correctly captured independently of the
opinion of the users on that subject.

On the contrary, the supporters of CF (dissident liberal party) show a
complete different behaviour. Both cross-similarities with the two major
parties are quite low and fluctuating far from electoral periods. This
tendency remains before the primary elections showing the strong support of
their own candidate. However, before the first round a strong positive
similarity with FDT develops (after some fluctuating period), showing that CF
supporters are ready to support the challenger FDT, from the first round.

Finally Fig. 7 shows the cross-similarity between the FI party and the two
main competitors. Although the leftist party has a very small influence in the
country, the interest of this curve is to reveal that indeed its cross-
similarity with FDT, is clearly positive (and negative with JPC). This is a
clear evidence of the existence of a strong leftist component in FDT, as
mentioned above, which is completely absent in JPC.

###  III.2 Elections 2015

The discussion of the results concerning this previous election, is
interesting not only as a test of the validity of our method in a different
political context, but also because unlike in 2019, this election required two
rounds to establish the winner. Even more interesting, the rank of the two
first qualified parties was overturned in the second round. We will show that
our method is able to identify how the details of the dynamics of the opinion
of the supporters of the smaller parties contributed to this final result.

The main political parties intervening in this election, which are formally
different from those of the 2019 election, although there are important
overlaps, are listed in Tab. 3.

| Party Name | Acron. | Political/econ. orientation | PASO | 1st Round | 2nd Round
---|---|---|---|---|---|---
$\blacksquare$ | Frente para la Victoria (in power) | FPV | Center-left, econ.interventionist | $38.67\%$ | $37.08\%$ | $48.66\%$
$\blacksquare$ | Cambiemos (challenger) | C | Center-right, econ. liberal | $30.12\%$ | $34.15\%$ | $51.34\%$
$\blacksquare$ | Unidos por una Nueva Alternativa | UNA | Economically interventionist | $20.57\%$ | $21.39\%$ | -
$\blacksquare$ | Progresistas | PR | Socially and econ. liberal | $3.47\%$ | $2.51\%$ | -
Table 3: Acronyms and characteristics of the main contenders of 2015
presidential election.

The dynamics of the self-similarities, as well as that of the cross-similarity
between the two largest parties, follow a similar pattern as those of 2019
elections and are detailed in the SI.

The most interesting feature of this electoral period is revealed by the
cross-similarities between each one of the two smaller parties against the two
leaders. Figure 8 shows the cross-similarity of the two small parties, PR
(top) and UNA (bottom) with the two leaders, FPV (blue curve) and C (yellow
curve), along with the self-similarity of the corresponding small party, for
comparison. This analysis shows a small positive (negative) cross-similarity
of the PR supporters with the C (FPV) party, compared to their own self-
similarity. This reveals than out of the electoral period, the interests of
the PR supporters have little overlap with those of the dominant parties.
However as the first round approaches the behaviour of the PR changes and they
clearly show a community of interests with the supporters of C.

A similar behaviour, though more enhanced, happens with the UNA supporters.
With a negative cross-similarity against both major parties before the
elections, it is between the two rounds that the cross-similarity with the C
party suddenly strongly increases, showing a clear choice made by the UNA
supporters. This change in the alignment of the UNA between the two rounds
turned out to be decisive to the 2015 election results and the victory of C
party.

Figure 8:  Cross-similarities between each of the two smaller parties and the
two major ones in 2015: C (in yellow) and FPV (in light blue). In each panel
the self-similarity of each minority party is plotted for comparison.Top:
Cross-similarity of PR against the two main parties.; Bottom: Cross-similarity
of UNA against the two main parties.

##  IV Summary and Conclusions

We have performed a study of the dynamics of opinion during an electoral
process, based on data obtained from the micro-blogging platform Twitter.
While this subject has been explored in several works Tumasjan et al., (2010);
Ma et al., (2013); Ahmed et al., (2016); Caldarelli et al., (2014); Varol et
al., (2014); Zhang et al., (2015); Bovet et al., (2018); Gaumont et al.,
(2018), here we apply a different, user-centered, perspective of the
discussions that are taking place in the platform. Most previous works on the
subject define a set of keywords, hashtags or mentioned users (e.g., political
candidates) to be tracked, and thus they obtain a dataset of tweets which are
inherently political. Instead, by defining a set of seed users and capturing
all the content that their followers generate, we have information about the
evolution of the users’ opinion on different topics, and we are not only
restricted to a subset of their tweets.

Following Ref. Cardoso et al., (2019), the topics to study are not set a
priori, but emerge from the community structure of a semantic network. This
network is built with the assumption that two hashtags used in the same tweet
carry some semantic relationship. The disclosed communities provide a
representation of the opinion of each user in a multidimensional topic space.
In this work we add the temporal dimension to the topic vectors, and therefore
we are able to study the dynamics of the opinion of party supporters during
the electoral campaign with great detail.

As discussed in the introduction, the known biases of the population using
Twitter to foster political discussions, which lead among others, to an over
representation of an urban male population Vaccari et al., (2013); Barberá and
Rivero, (2015) hampers the possibility of prediction of electoral results.
Instead, we show here how we can follow the evolution of political opinion
through the different stages of an electoral period. The case of the 2015
elections in Argentina shows that our method captures the details of the
reshaping dynamics of the opinion that was decisive to overturn the results
within the two rounds of the election.

Although we cannot expect to predict the outcome of an election, one could
still attempt to detect massive opinion changes on real time. In this respect,
it is worthwhile recalling some technical details in order to understand the
possibilities and the limitations of the method developed here. In this work,
the topics are determined by the community analysis of an aggregated semantic
network, meaning that it has been built using the tweets collected during the
whole electoral period. Tracking the semantic network in real time has the
drawback of starting with a small network, with new hashtags entering as time
evolves, which could hamper the correct initial determination of the topics by
lack of data. A compromise situation would be to start by a semantic network
aggregated during some initial period, in order to set the terms of the public
discussion. From that starting point, one could then incorporate the new
hashtags to the existing semantic network, following a sliding time window. In
this way, the topics could be recalculated and the analysis of the
similarities could be performed almost in real time with just a small lag. It
is expected that the more hashtags enter the semantic network the more
accurate will be the opinion landscape mapping. This assumption lays on the
implicit hypothesis that the system tends to a steady (or meta-stable) state
compatible with the aggregated network. However, this may not always be the
case. It is easy to imagine that some event, like the present Covid19
pandemic, introduces at some point in time an important, short-time scale,
modification of the semantic network. In such cases, integrating new hashtags
as described above, may capture extreme patterns that could be caused by the
appearance of a rare event triggering the modification of the structure of the
semantic network, almost in real time. This work is in progress.

## Acknowledgements

This work was done in the framework of the T-AP Digging into Data OpLaDyn
Project, J.I.A.H. and M.G.B. acknowledge the financial support of UBACyT-2018
20020170100421BA, L.H. and D.K. acknowledge the financial support of 2016–147
ANR OPLADYN TAP-DD2016 and MGB acknowledges the support from the IAS (CY-
Cergy-Paris University). The authors acknowledge the former students Facundo
Guerrero, Rodrigo de Rosa and Marcos Schapira (Facultad de Ingeniería,
Universidad de Buenos Aires) for their contribution to the development of the
online platform Guerrero et al., (2019).

## Author contributions

JIAH, MGB and LH conceived the research project. TMR and MGB wrote the code
for extracting the hashtag network, computing the matrices and the evolving
similarities, and produced the figures. MGB and LH wrote the manuscript. JIAH,
MGB, LH and DK analyzed and discussed the results. All authors contributed in
proofreading and discussing the manuscript.

## Competing interests

The authors declare no competing interests.

## References

  * Ahmed et al., (2016) Ahmed, S., Jaidka, K., and Cho, J. (2016).  The 2014 indian elections on twitter: A comparison of campaign strategies of political parties.  Telematics and Informatics, 33(4):1071–1087.
  * Alvarez et al., (2015) Alvarez, R., Garcia, D., Moreno, Y., and Schweitzer, F. (2015).  Sentiment cascades in the 15m movement.  EPJ Data Science, 4(1):6.
  * Alvarez-Hamelin et al., (2014) Alvarez-Hamelin, J. I., Alain Barrat, A. V., Dall’Asta, L., and Beiró, M. G. (2014).  Lanet-vi software.  https://lanet-vi.fi.uba.ar/index.php.
  * Alvarez-Hamelin et al., (2006) Alvarez-Hamelin, J. I., Dall’Asta, L., Barrat, A., and Vespignani, A. (2006).  Large scale networks fingerprinting and visualization using the k-core decomposition.  In Advances in neural information processing systems, pages 41–50.
  * Barberá, (2015) Barberá, P. (2015).  Birds of the same feather tweet together: Bayesian ideal point estimation using twitter data.  Political analysis, 23(1):76–91.
  * Barberá and Rivero, (2015) Barberá, P. and Rivero, G. (2015).  Understanding the political representativeness of twitter users.  Social Science Computer Review, 33(6):712–729.
  * Borge-Holthoefer et al., (2011) Borge-Holthoefer, J., Rivero, A., García, I., Cauhé, E., Ferrer, A., Ferrer, D., Francos, D., Iniguez, D., Pérez, M. P., Ruiz, G., et al. (2011).  Structural and dynamical patterns on online social networks: the spanish may 15th movement as a case study.  PloS one, 6(8).
  * Boutet et al., (2013) Boutet, A., Kim, H., and Yoneki, E. (2013).  What’s in twitter, i know what parties are popular and who you are supporting now!  Social network analysis and mining, 3(4):1379–1391.
  * Bovet et al., (2018) Bovet, A., Morone, F., and Makse, H. A. (2018).  Validation of twitter opinion trends with national polling aggregates: Hillary clinton vs donald trump.  Scientific reports, 8(1):1–16.
  * Caldarelli et al., (2014) Caldarelli, G., Chessa, A., Pammolli, F., Pompa, G., Puliga, M., Riccaboni, M., and Riotta, G. (2014).  A multi-level geographical study of italian political elections from twitter data.  PloS one, 9(5).
  * Cardoso et al., (2019) Cardoso, F. M., Meloni, S., Santanche, A., and Moreno, Y. (2019).  Topical alignment in online social systems.  Frontiers in Physics, 7:58.
  * Chung and Mustafaraj, (2011) Chung, J. E. and Mustafaraj, E. (2011).  Can collective sentiment expressed on twitter predict political elections?  In Twenty-Fifth AAAI Conference on Artificial Intelligence.
  * Eady et al., (2019) Eady, G., Nagler, J., Guess, A., Zilinsky, J., and Tucker, J. A. (2019).  How many people live in political bubbles on social media? evidence from linked survey and twitter data.  Sage Open, 9(1):2158244019832705.
  * Gaumont et al., (2018) Gaumont, N., Panahi, M., and Chavalarias, D. (2018).  Reconstruction of the socio-semantic dynamics of political activist twitter networks—method and application to the 2017 french presidential election.  PloS one, 13(9).
  * Gayo-Avello, (2012) Gayo-Avello, D. (2012).  No, you cannot predict elections with twitter.  IEEE Internet Computing, 16(6):91–94.
  * Guerrero et al., (2019) Guerrero, F., Schapira, M., De Rosa, R., Alvarez-Hamelin, J., and Beiró, M. G. (2019).  Argentinian elections 2019 online platform.  http://elecciones2019.fi.uba.ar/.
  * Himelboim et al., (2013) Himelboim, I., Smith, M., and Shneiderman, B. (2013).  Tweeting apart: Applying network analysis to detect selective exposure clusters in twitter.  Communication methods and measures, 7(3-4):195–223.
  * Howard et al., (2011) Howard, P. N., Duffy, A., Freelon, D., Hussain, M. M., Mari, W., and Maziad, M. (2011).  Opening closed regimes: what was the role of social media during the arab spring?  Available at SSRN 2595096.
  * Kelly and Francois, (2018) Kelly, J. and Francois, C. (2018).  A vision of division.  MIT TECHNOLOGY REVIEW, 121(5):22–27.
  * Lancichinetti et al., (2011) Lancichinetti, A., Radicchi, F., Ramasco, J. J., and Fortunato, S. (2011).  Finding statistically significant communities in networks.  PloS one, 6(4).
  * Ma et al., (2013) Ma, Z., Sun, A., and Cong, G. (2013).  On predicting the popularity of newly emerging hashtags in t witter.  Journal of the American Society for Information Science and Technology, 64(7):1399–1410.
  * Murthy, (2015) Murthy, D. (2015).  Twitter and elections: are tweets, predictive, reactive, or a form of buzz?  Information, Communication & Society, 18(7):816–831.
  * Nikolov et al., (2015) Nikolov, D., Oliveira, D. F., Flammini, A., and Menczer, F. (2015).  Measuring online social bubbles.  PeerJ Computer Science, 1:e38.
  * Tumasjan et al., (2010) Tumasjan, A., Sprenger, T. O., Sandner, P. G., and Welpe, I. M. (2010).  Predicting elections with twitter: What 140 characters reveal about political sentiment.  In Fourth international AAAI conference on weblogs and social media.
  * Vaccari et al., (2013) Vaccari, C., Valeriani, A., Barberá, P., Bonneau, R., Jost, J. T., Nagler, J., and Tucker, J. (2013).  Social media and political communication. a survey of twitter users during the 2013 italian general election.  Rivista italiana di scienza politica, 43(3):381–410.
  * Varol et al., (2014) Varol, O., Ferrara, E., Ogan, C. L., Menczer, F., and Flammini, A. (2014).  Evolution of online user behavior during a social upheaval.  In Proceedings of the 2014 ACM conference on Web science, pages 81–90.
  * Zhang et al., (2015) Zhang, X., Chen, X., Chen, Y., Wang, S., Li, Z., and Xia, J. (2015).  Event detection and popularity prediction in microblogging.  Neurocomputing, 149:1469–1480.

## Supplementary Information

###  IV.1 Data description and processing

####  IV.1.1 Detail on the collected tweets

Figure 9 shows the evolution of the number of tweets collected per day during
the 2019 election period, along with their discrimination in terms of new
tweets, retweets (simple and with comment) and replies to other tweets.

Figure 9: Daily number of tweets captured from active Argentinian users (AAU)
during the 2019 election. Black dashed lines indicate the dates of the
primaries and the elections.

The daily number of tweets in the capture reveals the standard weekly patterns
in the usage of the platform, with less activity during the weekends. The high
peaks just before the primaries of August 9th and during the three mondays
close to the main election reveal the interest of our users in the political
events.

We classified the tweets into $4$ groups, using the following criterion:

  * •

Replies: tweets having the is_reply flag active according to the Twitter API.

  * •

Simple retweets: tweets having the is_retweet flag active according to the
Twitter API.

  * •

Retweets with comment (quote tweets): tweets having the is_quote flag active
according to the Twitter API, but have the is_reply and is_retweet flags down.

  * •

Original tweets: tweets having both the is_quote, is_reply and is_retweet
flags down.

We observe that almost $55\%$ of the tweets captured are simple retweets,
while almost $20\%$ are original tweets.

Each day, an average of $126k$ argentinian users in our dataset showed some
activity in the platform (see Figure 10, left). This represents the $21\%$ of
our the base of active argentinian users (AAU). The average number of tweets
captured per user was $477$ or, in other words, $1.4$ average tweets per user
per day (Figure 10, right).

Figure 10:  (Left) Number of argentinian users from our base active in the
platform during each day. (Right) Histogram of the total number of tweets per
user in the 2019 election.

####  IV.1.2 User affiliation

The affiliation of users to some political party was inferred from their
follower relationships and retweets from the candidates’ accounts. We consider
two scenarios:

  * •

The user did not retweet from any candidate: In this cae, if he only follows
candidates from a single party, then we infer that the user supports that
party.

  * •

The user retweeted from at least one candidate: In this case, we count his
retweets from each party, and we normalize them so that they add up to $1$. If
some party gets a proportion of at least $0.75$, then we consider that the
user supports that party.

Users that do not fulfill any of these conditions are not considered in any of
our similarity analysis. The political affiliation of the users was determined
during the pre-election period, before the primaries.

####  IV.1.3 Geographical and gender representativity

Each user’s location was computed by combining the location informed in the
user profile with data from GeoNames (https://www.geonames.org/). In the 2019
capture, for 392k users we could determine a specific location inside the
country (either city or province), and for those we plotted their geographical
distribution. Figure 11 shows that the capture has a fair geographical
representativity at the province level. A similar representativity was found
for the 2015 capture.

Figure 11:  Users representativity at the province level. Number of users per
province in our sample in the 2019 election (left), as compared to the general
population distribution in Argentina (right). The official population data was
obtained from the IGN (Instituto Geográfico Nacional).

Twitter does not provide gender information in the user profiles. Thus, we
analyzed the names in the profile by comparing them to a list of historical
names from Argentina (https://data.buenosaires.gob.ar/dataset/nombres). In the
2019 capture, $32\%$ of the profile names did not match any registered name
(e.g., some users do not write their names but use aliases and/or emojis). For
the remaining users (383k users), we found a $43\%$ of females and $57\%$ of
males. In the 2015 capture we found a $55\%$ of males and a $45\%$ of females,
after filtering a $32\%$ of users with unknown gender.

####  IV.1.4 Hashtag usage

Hashtags are used in Twitter as a tagging convention to associate tweets with
events, concepts or contexts. We found that $~{}14\%$ of the tweets contain at
least one hashtag. Some of these hashtags become very popular while others go
unnoticed; the probability distribution of hashtag usage follows a heavy tail
(Figure 12, left), with $66\%$ of the hashtags used by only one person, and
$2,600$ hashtags adopted by at least $1,000$ users.

Detecting political hashtags. Some hashtags have a stronger political meaning
than others. We designed a method to automatically identify political hashtags
based on their usage by supporters of the different parties. In effect, we
assessed the correlation between hashtag usage and political affiliation in
terms of the Kullback-Leibler divergence (relative entropy): given the
empirical usage of each hashtag $h$ by users supporting each political party,
we define a generalized Bernoulli distribution $P_{h}$ for each hashtag
(represented as a vector containing the proportion of usages of hashtag $h$ in
each party with respect to all users), and a generalized Bernoulli
distribution $Q$ measuring the distribution of users across parties (i.e., the
proportion of users supporting each party). Then, we compute the relative
entropy $D_{KL}(P_{h}||Q)$ between these distributions for each hashtag $h$:

$D_{KL}(h)=\sum_{i=1}^{N_{C}}P_{h}(i)\cdot\log_{2}{\left[\frac{P_{h}(i)}{Q(i)}\right]},$
(7)

where $N_{C}$ represents the number of parties. The idea behind this method is
that apolitical hashtags $h$ will be used independently of party affiliation,
and their distribution will be similar to that of the party sizes, implying
that $D_{KL}(h)\approx 0$, while strongly political hashtags will have higher
relative entropy values. The observed distribution of these relative entropies
for the 2019 election is shown in Figure 12 (right), together with the
threshold of $0.5$ that we used to classify hashtags into political or
apolitical. Hashtags above that threshold will be considered political.

Figure 12:  (Left) Histogram of the number of unique users adopting each
recorded hashtag during the 2019 election. (Right) Histogram of the KL
divergence between hashtags’ and users’ distributions across parties during
the 2019 election. The red vertical line represents the threshold for hashtag
classification as political ($\geq 0.5$) or apolitical.

Weighted hashtag network. This network was build by computing the number of
unique users that ever used each pair of hashtags together in a tweet.
Counting the number of unique users instead of the number of tweets allows for
filtering the behavior of users that continually post similar content, and is
a way of controlling for bot-generated content. The semantic association of
$2$ hashtags appearing in the same tweet is reinforced by the fact that many
people use them together. We removed links whose weight is below a threshold
of 5.

Table 4 shows a brief description of these graphs.

Table 4: Weighted hashtag networks description. Hashtag network | 2015 election | 2019 election
---|---|---
After threshold |  |
Nodes | $13767$ | $31405$
Edges | $50516$ | $106366$
Communities (OSLOM) | $1863$ | $2139$

####  IV.1.5 Robustness to fake accounts and bots

We made an effort to mitigate the impact of bots and fake accounts during the
design of the method, by following these strategies:

  * •

As mentioned before, in the semantic network built by hashtag co-occurrence,
each user is counted only once. That is, when we count the number of
simultaneous usages of a pair of hashtags, we do not count the number of
tweets but the number of unique users.

  * •

When we measure the general usage vectors $T_{i}$ each user gets the same
weight, because his description vector has been normalized. In this way, users
with a very high activity do not distort the average behavior.

Contrary to other capture methods which are based on keywords, and which are
more prone to capturing bot content, our method is based on chosen users
(i.e., those who follow some candidate). This reduces the effect that fake
accounts could have in our Twitter capture.

###  IV.2 Graph structure and evolution of selected topics

Here we show the evolution in the discussion of certain topics during both
elections. These topics were selected based on two criteria: (i) to show the
opinion of Twitter users on some of the hot topics of discussion during each
period (as political tensions in neighboring countries, abortion legislation
and the defense of human rights) and; (ii) to validate the correct affiliation
of users into parties by looking at the composition of the main topics that
reflect party support.

Figure 13: Hot discussions during the 2015 election. Each panel shows the
cumulative usage of the topic by supporters of each party. (Left) Topic with
demands for legal abortion. (Right) Topic with discussions against gender
violence.

In Figure 13 we show the evolution of the discussions on legal abortion and
gender violence during the 2015 election. We observe that the discussions on
legal abortion (left panel) were mainly conducted by the Progresistas party
(PR), with a minor participation from one of the two major parties, FPV. This
topic was particularly active on September 28th, during the International Safe
Abortion Day, and continued from then on. On the right panel, the discussions
about gender violence were carried out by the center-left party FPV (in
charge) and the PR party. The supporters of the center right party Cambiemos
(C) were the less active in the topic.

Figure 14:  Foreign affairs discussions during the 2019 election. Positions
regarding social tension in Chile and Brazil. (Left) Time evolution of the
topic usage by supporters of the different parties (7-day rolling average).
(Right) Hashtag composition of the topic. Nodes are arranged according to the
$k$-core decomposition of the community graph. The hashtags in this topic
(pointing out that ‘Chile awakened’ and ‘Free Lula’) correspond to the
interest of the leftist parties, which is reflected by the red and light blue
peaks.

Figures 14 and 15 show two discussions on foreign affairs during the 2019
election: the social tensions in Chile and Brazil in October 2019, and the
coup d’état in Bolivia in November 2019. The left-wing parties FI and FDT were
the ones most sensitive to these topics, as expected. In the case of Bolivia,
it is interesting to point out that, while the small and more leftist FI was
the first to raise concerns at the end of October (and as the election first
round was taking place), the major left party FDT went ahead during November,
with the election already decided. The plots in the right panel of each figure
show the main hashtags involved in each case.

Figure 15: Foreign affairs discussions during the 2019 election. Positions
regarding the coup d’état in Bolivia. (Left) Time evolution of the topic usage
by supporters of the different parties (7-day rolling average). (Right)
Hashtag composition of the topic. Nodes are arranged according to the $k$-core
decomposition of the community graph. Again, the choice of the hashtags
reveals political orientation, as right parties in general did not admit that
the events taking place in Bolivia in 2019 corresponded to a coup d’état.

Finally, Figures 16, 17, 18 and 19 have the aim of validating the political
affiliation of the users. These figures show topics whose main content is the
support to a specific party, and we observe that the majority of the users
active in each topic are the supporters of the corresponding party. However,
Fig. 17 shows how M. Macri, candidate from Cambiemos (C), received support
from UNA and PR between the first round and the ballotage in 2015, which would
be decisive for his final triumph. On the contrary, in Fig. 18 we observe
scarce support for D. Scioli, from the other major party.

Figure 16: Topic expressing the support for the participation of one political
actor from the FD party (J.L. Espert) in the 2019 election. (Left) Time
evolution of the topic usage by supporters of the different parties (7-day
rolling average). (Right) Hashtag composition of the topic. Nodes are arranged
according to the $k$-core decomposition of the community graph.

Figure 17: Topic expressing the support for the candidate of the C party (M.
Macri), who won the 2015 election. (Left) Time evolution of the topic usage by
supporters of the different parties (7-day rolling average). (Right) Hashtag
composition of the topic. Nodes are arranged according to the $k$-core
decomposition of the community graph.

Figure 18: Topic expressing the support for the candidate of the FPV (D.
Scioli) in the 2015 election. (Left) Time evolution of the topic usage by
supporters of the different parties (7-day rolling average). (Right) Hashtag
composition of the topic. Nodes are arranged according to the $k$-core
decomposition.

Figure 19: Topic expressing the support for the candidate of the FDT party,
who won the 2019 election. (Left) Time evolution of the topic usage by
supporters of the different parties (7-day rolling average). (Right) Hashtag
composition of the topic. Nodes are arranged according to the $k$-core
decomposition of the community graph.

###  IV.3 Other similarities for the 2015 election

In Figure 20 we show analogous figures to the ones in the main text for the
2015 election: the self-similarity for each party during the period, and the
cross-similarity between the two main parties. The latter reflects the same
pattern as in 2019: the cross-similarity between the two main competing
parties is consistently negative, reaching its minimum in the ballotage.

Figure 20: Similarity among groups of supporters during the 2015 presidential
campaign. (a) Self-similarity for each party; (b) Cross-similarity between the
two main parties.