# Modeling ReTweet Diffusion Using Emotional Content

Andreas Kanavos, Isidoros Perikos, Pantelis Vikatos, Ioannis Hatzilygeroudis, Christos Makris, Athanasios Tsakalidis

<figure><img src="image_1.png" /></figure>

To cite this version:

Andreas Kanavos, Isidoros Perikos, Pantelis Vikatos, Ioannis Hatzilygeroudis, Christos Makris, et al.. Modeling ReTweet Diffusion Using Emotional Content. 10th IFIP International Conference on Artificial Intelligence Applications and Innovations (AIAI), Sep 2014, Rhodes, Greece. pp.101-110, 10.1007/978-3-662-44654-6_10 . hal-01391297

HAL Id: hal-01391297

https://inria.hal.science/hal-01391297

Submitted on 3 Nov 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Modeling ReTweet Diffusion using
Emotional Content

Andreas Kanavos, Isidoros Perikos, Pantelis Vikatos,
Ioannis Hatzilygeroudis, Christos Makris and Athanasios Tsakalidis

Computer Engineering and Informatics Department,
University of Patras, Greece
{kanavos, perikos, vikatos, ihatz, makri, tsak}@ceid.upatras.gr

**Abstract.** In this paper we present a prediction model for forecasting the depth and the width of ReTweeting using data mining techniques. The proposed model utilizes the analyzers of tweet emotional content based on Ekman emotional model, as well as the behavior of users in Twitter. In following, our model predicts the category of ReTweeting diffusion. The model was trained and validated with real data crawled by Twitter. The aim of this model is the estimation of spreading of a new post which could be retweeted by the users in a particular network. The classification model is intended as a tool for sponsors and people of marketing to specify the tweets that spread more in Twitter network.

**Keywords:** Tweet Emotion Recognition, Microblogging, ReTweet Modeling, Sentiment Analysis

# 1 Introduction

During the last years, Twitter has become the most popular microblogging platform all over the world. It is considered to be the most fast spreading and growing social network having more than 500 millions of users. Every day a vast amount of tweet information is published by the users of the platform to the public or to selected circles of their contacts. This information comes in the form of small posts which is allowed to have up to 140 characters each. The rise of Twitter has completely changed the users, transforming them from simple passive information searchers and consumers to active producers. This massive and continuous stream of Twitter data posts reflects the users opinions and reactions to phenomena from political events all over the world to consumer products [17]. It is well pointed that Twitter posts relate to the user's behavior and often convey substantial information about the user's emotional state [2].

The users' posts in Twitter, unlike other networks, have some special characteristics. The short length that the posts are allowed to have, results in more expressive emotional statements. Also, users express their daily thoughts in real time, something that often concludes in posting far more emotional expressions than might normally occur [15]. Analyzing tweets and recognizing their emotional content is a very interesting and challenging topic in the microblogging
area. It is necessary for deeper understanding of people behavior but simultane-
ously for describing public attitude towards different events and topics as well.
It therefore could be helpful in predicting the spread of posts and information
diffusion in the network.

A fundamental way of information spread in the Twitter network is the ReTweets. A ReTweet happens when a user forwards a message they receive to circles of their followers. In addition, a ReTweet indicates that the user who retweets the post, found it very interesting and worth sharing with others [9]. The way that a post is retweeted among users in the network can describe the amount of interest drawn upon it [10] and also its adoption by the users who made the ReTweets. Since ReTweets provide the most powerful clue that users find post information interesting, it would be important to study, analyze and model the way that information is spread in Twitter through ReTweets. Being able to model and predict the ReTweet occurrences of a given post is important for understanding and controlling information diffusion on Twitter [3].

Emotion representation is a key aspect of an emotional recognition system. The most popular models for representing emotions are the categorical and the dimensional model ones. The categorical model assumes a finite number of basic, discrete emotions, each of which serves for a specific purpose. On the other hand, the dimensional model represents emotions on a dimensional approach, where an emotional space is created and each emotion lies in this particular space. A very popular categorical model is the Ekman emotion model [4], which specifies six basic human emotions: "anger, disgust, fear, happiness, sadness, surprise". It has been used in several studies/systems that recognize emotional text and facial expressions related to these emotional states.

In this paper we present a work on modeling and predicting the information
spread on Twitter based on its emotional content. More specifically, we propose
the use of emotional behavior in each ReTweet as an additional parameter to
user's social media analysis. With use of the Ekman emotion model, we can
identify whether one or more out of the six basic human emotions exists or not.
The aim of this system is to model the information spread in form of ReTweets
in the network and in following, to predict the likelihood and the way that a
new post will be retweeted by the users in a particular network. More precisely,
we want to perform the following steps in the below mentioned order: firstly
understanding Twitter topic, then modeling the ReTweet information flow in
Twitter network and finally predicting when a new post will be retweeted and
though the way of how it will be spread in the network (e.g. given a new post with
particular emotional content, we want to predict whether it will be retweeted by
other Twitter users; and if so, we would like to learn its depth and width in the
Twitter network).

The remainder of the paper is structured as follows: Section 2 presents the
related work. Section 3 presents our model while in section 4 we utilize our
experiments. Moreover, section 5 presents the evaluation experiments conducted
and the results gathered. Ultimately, section 6 presents conclusions and draws
directions for future work.
## 2 Related Work

The spread of Twitter and other social networks has attracted significant interest in sentiment analysis methods for recognizing textual opinions, statement polarity and emotions. Researchers have developed applications to identify whether a text is subjective or objective, and whether any opinion expressed is positive or negative [11]. In [15] authors investigated feature sets to classify emotions in Twitter and presented an analysis of different linguistic styles people use to express their emotions.

There is a lot of research interest in studying different types of information dissemination processes on large graphs and social networks. Naveed et al. [9] analyze tweet posts and forecast for a given post the likelihood of being retweeted on its content. Authors indicate that tweets containing negative emoticons are more likely to be retweeted than tweets with positive emoticons. In [1] authors study the way that information diffuses in Twitter. A dataset of 1.6 million Twitter users was used in order to identify common information patterns of their tweets and many of these patterns involved transmission with third and fourth hop users. Also, the authors indicate that although stronger ties are individually more influential, the more abundant weak ties are responsible for the propagation of novel information.

In [5] the authors study the online social networks of the social news aggrega- tor Digg as well as the microblogging service Twitter, both of which are used by people in order to share news stories and other content with their followers. The work indicates that the spread of information could be modeled as an epidemic process and though could have a non-conservative favor.

In addition, in [2] authors utilized the Profile of Mood States psychometric method so as to analyze Twitter posts and reached the conclusion that "the events in the social, political, cultural and economic sphere do have significant, immediate and highly specific effect on the various dimensions of public mood". Commercial companies and associations could exploit Twitter for marketing purposes, as it provides an effective medium for propagating recommendations through users with similar interests. Moreover, viral marketers could exploit models of user interaction to spread their content or promotions quickly and widely [8].

Peng et al. [12] study the ReTweet occurrences in Twitter and proposed a method utilizing Conditional Random Fields (CRF) so as to predict how likely a tweet will be retweeted by a user. The analyzed tweets and their prediction model take into account network aspects and post content parameters like the topic si- milarity of posts with the user's interest, the existence of URL and hashtags as well as mentions in the posts. In [3], authors address the ReTweet modeling topic and focus on tweets that contain links to images shared through twit- pic.com. They analyze images and extract correlated low-level and high-level image features in their predictive model for ReTweet count.

Finally, Petrovic et al. in [14] predict ReTweet occurrences by using a machine learning approach based on the passive-aggressive algorithm. Authors found that there is a substantial gain in using tweet content specific features and their pre-
diction model takes into account user social features and tweet features. Social features concern user's number of followers, friends, statuses, favorites, the number of the times the user was listed, if the user is verified, and if the user's language is English; while tweet features concern the existence and the number of hashtags, mentions, URLs, trending words in the tweet, the length of the tweet, the novelty, the actual words in the tweet and last if the tweet is a reply. As far as we are aware, our work is primarily to investigate the impact of tweets emotional content, as determined on Ekman's scale, on its diffusion in the network in the form of ReTweets.

## 3 Model Overview

In our model, we want to predict whether a tweet with specific emotional states based on a user's recent tweets and specific user's Twitter analytics features, can be categorized in a particular class concerning the possibility of being retweeted by other users. We can specify this problem as classification one, because each class will consist of specific thresholds in each category. Furthermore, we want to predict whether the tweets from a specific user can be forwarded deep in the Twitter graph; meaning that many other users will forward this tweet (via ReTweeting).

The overall architecture of the proposed system is depicted in Figure 1 while the proposed modules and sub-modules of our model are modulated in the following steps.

<figure><img src="image_3.png" /><figcaption>Fig. 1. Architecture of the Model</figcaption></figure>

### 3.1 User Metrics Calculation

The social media crawler samples the Twitter and identifies a specific number of users who have posted a tweet in a specific topic during a specific time period (e.g. keyword search query). More specifically, the implementation of our method goes as follows: initially, we retrieve users who have posted a tweet within the
given time period. Subsequently, we download their *k* last tweets (e.g. for our experiments *k* = 20), in order to give them as input in our Tweet Emotional Analysis module. Furthermore, from Twitter we can extract 6 basic user features as they can better describe user communication behavior in Twitter. The followers of a user, the number of contributions to the social network and the frequency of contribution are some aspects that differentiate user behavior.

The set of 6 features contain the number of Followers, the number of Direct Tweets, the number of ReTweets, the number of Conversational Tweets (e.g. if a user replies to a post), the Frequency of user's Tweets (e.g. how "often" an author posts Tweets) and finally the number of Hashtag Keywords (e.g. words starting with the symbol # and with use of this symbol, a user can specify the thematic category of their specific Tweet) as in [6], [7]. These metrics describe the user communication behavior in Twitter.

## 3.2 Tweet Emotional Analysis

In this subsection, the emotional analysis of the tweets based on the tool presented in [13] is described. The tool recognizes the existence of the six basic emotions proposed by Ekman [4] in natural language sentences. Tweets texts are pre-processed (remove images, URLs, etc) and in following, the structure's analysis of the tweet using Stanford parser and Tree Tagger is conducted. Also, lexical resources such as the WordNet Affect [16] are used to spot emotional words. Moreover, the tool analyses each word's emotional dependencies in order to specify its emotional strength and determine the overall emotional status of tweets based on its dependency graph. This module is shown in Figure 2.

We have extracted some tweets during a given period of time for a specific topic (e.g. #MH370). In following, we try to identify the emotional state of tweets (or specify their emotional content) through the aforementioned six basic emotions. Tweets are analyzed and for each one the existence of each basic emotion is determined.

<figure><img src="image_4.png" /><figcaption>Fig. 2. Tweet Emotional Analysis</figcaption></figure>
Since we ensure whether these tweets have a sentiment or are neutral (a tweet is neutral when no category of Ekman psychometric test appears in this tweet), we calculate the depth as well as the width (if any) of all tweets (e.g. ReTweeting depth and width). More specifically, we count the number that a tweet has been retweeted (*width* = 1); then if someone sees the ReTweet and decides to make a ReTweet of the above ReTweet, the width takes value 2, and so on. Suppose we have a tweet from a user *X* and many Twitter users want to share this tweet among their followers. So, for example, *n* users share this post. In the first step, our algorithm has *width* = 1 and *depth* = *n*. What is more, a user who "follows" one out of these *n* users wants to share the same ReTweet; they use this ReTweet in their profile and consecutively, the width for the specific post becomes 2.

<table><caption>**Table 1.** Categories of Features</caption><thead><tr><td>Features</td><td>#</td><td>Description</td></tr></thead><tbody><tr><td>User Twitter Metrics</td><td>6</td><td>Followers, Direct Tweets, ReTweets, Conversational Tweets, Frequency, Hashtag Keywords</td></tr><tr><td>Tweet Emotional Content</td><td>6</td><td>Anger, Disgust, Fear, Joy, Sadness, Surprise</td></tr></tbody></table>

## 4 Implementation

We based our experiments on Twitter and used Twitter API to collect tweets and calculate users metrics. We implemented our Twitter network using Twitter4J<fnref n="1" />. We collected tweets published for a specific period of time (e.g. a couple of hours) for the keyword #MH370 concerning Malaysia Airlines Flight 370 disappearance. Our Twitter data consists of 13000 tweets, authored by 11130 users.

The prediction of ReTweeting is based on the emotional content of the tweets using Ekman model but also the user communication behavior. Each tweet is represented as a vector; this vector includes the existence of each emotion which is produced by Ekman's model as well as Twitter metrics of the user that produce the certain tweet such as their followers, the number of tweets, ReTweets, conversations, hashtag keywords and finally the frequency of posts.

Analysing the retrieved tweets, we extract the length of maximum path of each ReTweet. Moreover, the number of followers that have retweeted each tweet is additionally computed. We use the following approach to classify the ReTweets of a certain tweet. According to the categories of ReTweeting in Table 2, we predict the depth as well as the width of ReTweeting.

<footnote n="1">¹ Twitter4J library: http://twitter4j.org/en/index.html</footnote>
<table><caption>**Table 2.** Classes of ReTweeting</caption><thead><tr><th>Level of ReTweeting</th><th>#Instances in Depth ReTweeting</th><th>#Instances in Width ReTweeting</th></tr></thead><tbody><tr><td>O</td><td>5192</td><td>5192</td></tr><tr><td></td><td>5667</td><td>4785</td></tr><tr><td></td><td>2141</td><td>3023</td></tr></tbody></table>

<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /></figure>

Several classifiers are trained using the dataset of vectors. Classification is evaluated based on the separation of the dataset to training and test set. Furthermore, the approach we used was K-Fold Cross-Validation (e.g. K = 10 Fold). The classifiers that were chosen, are evaluated with the use of F-Measure metric. The classifiers were chosen from "bayes", "functions", "lazy", "trees" and "rules" categories of the Weka library<fnref n="2" />, which is a widely used toolkit for machine learning and data mining such as classification, regression, clustering and feature selection. The classifiers from Weka are used with their default settings. The results are introduced in following section.

# 5 Evaluation

The reported values in the charts for the classification models are recorded as AdaBoost, IBK, J48, JRip, Multilayer Perceptron, Naive Bayes, PART, RotationForest and SMO. The results of F-Measure for each classifier are illustrated in Table 3; where we select the best classifiers either for depth or width, depicted in bold in the table. We can observe that J48 achieves the highest F-Measure value for both the depth as well as the width ReTweeting. In the case of depth, RotationForest is selected as the next best classifier, where in case of width, JRip accomplishes the same performance as J48. Furthermore, Figures 3 and 4 depict the values of F-Measure for each classifier for depth and width accordingly.

Additionally, we evaluate the model using posts with different emotion for the same user's behavior in order to consider the influence of emotion in the diffusion of ReTweets based on our model. Table 4 shows that tweets which are angry or sad are prone to be retweeted rather than tweets that are happy or neutral. In addition, Figure 5 presents the percentage of instances diffusion for each emotion. The bigger a circle is, the bigger diffusion exists for the according Ekman emotional state.

<footnote n="2">² Weka toolkit: http://www.cs.waikato.ac.nz/ml/weka/</footnote>
<table><caption>**Table 3.** Classification of ReTweeting - Depth and Width</caption><thead><tr><td>Classifiers</td><td>F-Measure (Depth)</td><td>F-Measure (Width)</td></tr></thead><tbody><tr><td>AdaBoost</td><td>0.712</td><td>0.669</td></tr><tr><td>IBK</td><td>0.843</td><td>0.817</td></tr><tr><td>J48</td><td><strong>0.896</strong></td><td><strong>0.872</strong></td></tr><tr><td>JRip</td><td>0.877</td><td><strong>0.873</strong></td></tr><tr><td>Multilayer Perceptron</td><td>0.867</td><td>0.828</td></tr><tr><td>Naive Bayes Classifier</td><td>0.683</td><td>0.581</td></tr><tr><td>PART</td><td>0.865</td><td>0.862</td></tr><tr><td>RotationForest</td><td><strong>0.891</strong></td><td>0.868</td></tr><tr><td>SMO</td><td>0.687</td><td>0.669</td></tr></tbody></table>

<figure><img src="image_7.png" /><figcaption>**Fig. 3.** Classification of ReTweeting - Depth</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>**Fig. 4.** Classification of ReTweeting - Width</figcaption></figure>
<table><caption>**Table 4.** Number of Instances per Emotional State</caption><thead><tr><td>Emotion</td><td>Number of Instances</td><td>Rate of ReTweeting</td></tr></thead><tbody><tr><td>Anger</td><td>212</td><td>78%</td></tr><tr><td>Disgust</td><td>545</td><td>12%</td></tr><tr><td>Fear</td><td>64</td><td>29%</td></tr><tr><td>Happiness</td><td>344</td><td>31%</td></tr><tr><td>Sadness</td><td>232</td><td>65%</td></tr><tr><td>Surprise</td><td>142</td><td>17%</td></tr><tr><td>Neutral</td><td>631</td><td>24%</td></tr></tbody></table>

<figure><img src="image_9.png" /><figcaption>**Fig. 5.** Rate of ReTweeting</figcaption></figure>

## 6 Conclusions and Future Work

In our work we present a methodology to model and predict the depth and width of diffusion of a tweet with a machine learning approach. More specifically, based on the result of the Ekman model (e.g. six basic human emotions represented by six emotional states) as well the Twitter analytics features, we can estimate the depth's and width's category of each ReTweet with a classification error; as we have already mentioned, our aim is to investigate the impact that information has in the network in the form of ReTweets. We also examine the influence of emotion in the diffusion, where we find out that posts containing negative emotional states are more likely to be retweeted than tweets with positive or neutral emotional states.

As future work, we plan to incorporate apart from the existence of any basic Ekman's state, also the valence of each emotional state. Next, we intend to make larger scale evaluation and utilize popular Twitter corpuses in order to get a deeper insight of our methodology's performance. Ultimately, we could take into consideration special tweet characteristics such as Hashtag Keywords and URLs in order to improve classification accuracy.
References

1. E. Bakshy, I. Rosenn, C. Marlow and L. A. Adamic. (2012). The Role of Social Networks in Information Diffusion. WWW, pp. 519-528.

2. J. Bollen, H. Mao and A. Pepe. (2011). Modeling Public Mood and Emotion: Twitter Sentiment and Socio-Economic Phenomena. ICWSM.

3. E. F. Can, H. Oktay and R. Manmatha. (2013). Predicting ReTweet Count Using Visual Cues. CIKM, pp. 1481-1484.

4. P. Ekman. (1999). Basic Emotions. Handbook of Cognition and Emotion. John Wiley and Sons, Ltd. pp. 45-60.

5. S. Goel, D. J. Watts and D. G. Goldstein. (2012). The Structure of Online Diffusion Networks. EC, pp. 623-638.

6. E. Kafeza, A. Kanavos, C. Makris and D. Chiu. (2013). Identifying Personality-based Communities in Social Networks. LSAWM (ER).

7. E. Kafeza, A. Kanavos, C. Makris and P. Vikatos. (2014). T-PICE: Twitter Person- ality based Influential Communities Extraction System. IEEE International Congress on Big Data.

8. J. Leskovec, L. A. Adamic and B. A. Huberman. (2007). The Dynamics of Viral Marketing. ACM Transactions on the Web (TWEB), Volume 1, Number 1.

9. N. Naveed, T. Gottron, J. Kunegis and A. C. Alhadi. (2011). Bad News Travel Fast: A Content-based Analysis of Interestingness on Twitter. Web Science, Article Number 8.

10. N. Naveed, T. Gottron, J. Kunegis and A. C. Alhadi. (2011). Searching Microblogs: Coping with Sparsity and Document Quality. CIKM, pp. 183-188.

11. B. Pang and L. Lee. (2008). Opinion Mining and Sentiment Analysis. Foundations and Trends in Information Retrieval, Volume 2, Issue 1-2, pp. 1-135.

12. H.-K. Peng, J. Zhu, D. Piao, R. Yan and Y. Zhang. (2011). Retweet Modeling Using Conditional Random Fields. ICDM Workshops, pp. 336-343.

13. I. Perikos and I. Hatzilygeroudis. (2013). Recognizing Emotion Presence in Natural Language Sentences. EANN, pp. 30-39.

14. S. Petrovic, M. Osborne and V. Lavrenko. (2011). RT to Win! Predicting Message Propagation in Twitter. ICWSM.

15. K. Roberts, M. A. Roach, J. Johnson, J. Guthrie and S. M. Harabagiu. (2012). EmpaTweet: Annotating and Detecting Emotions on Twitter. LREC, pp. 3806-3813.

16. C. Strapparava and A. Valitutti. (2004). WordNet Affect: an Affective Extension of WordNet. LREC, pp. 1083-1086.

17. J. Suttles and N. Ide. (2013). Distant Supervision for Emotion Classification with Discrete Binary Values. CICLing, pp. 121-136.