=Paper= {{Paper |id=None |storemode=property |title=A Sentiment-Based Approach to Twitter User Recommendation |pdfUrl=https://ceur-ws.org/Vol-1066/Paper5.pdf |volume=Vol-1066 |dblpUrl=https://dblp.org/rec/conf/recsys/GuriniGMS13 }} ==A Sentiment-Based Approach to Twitter User Recommendation== https://ceur-ws.org/Vol-1066/Paper5.pdf
               A Sentiment-Based Approach to Twitter User
                           Recommendation

                                      Davide Feltoni Gurini, Fabio Gasparetti,
                                   Alessandro Micarelli and Giuseppe Sansonetti
                                                      Roma Tre University
                                                   Department of Engineering
                                                   Via della Vasca Navale 79
                                                       Rome, 00146 Italy
                               {feltoni,gaspare,micarel,gsansone}@dia.uniroma3.it

ABSTRACT                                                          icant impact factor on buying decisions, brand reputations
Nowadays, the emerging popularity of Social Web raises new        and public opinions. Furthermore, recommending pertinent
application areas for recommender systems. The aim of a           news stories, documents, and users to follow, has long been
social user recommendation is to suggest new friends having       a favourite domain for recommender systems research. Sev-
similar interests. In order to identify such interests, current   eral new approaches harness real-time micro-blogging activ-
recommender algorithms exploit social network information         ity from services, such as Twitter1 , as the basis for identi-
or the similarity of user-generated content. The rationale        fying user preferences and filtering relevant contents to spe-
of this work is that users may share similar interests but        cific people. Recently, Twitter has become an interesting
have different opinions on them. As a result, considering         source of research activity as a result of the large amount
the contribution of user sentiments, can yield benefits in        of available user-generated data. In particular Twitter per-
recommending possible friends to follow.                          mits users to share a sentence - called tweet - to the followers,
   In this paper we propose a user recommendation technique       with a maximum length of 140 characters.
based on a novel weighting function, we named sentiment-             In this instance, the purpose of user recommendation is
volume-objectivity (SVO) function, which takes into account       to identify relevant people to follow among millions of users
not only user interests, but also his sentiments. Such func-      that interact in the social network. Previous attempts in-
tion allows us to build richer user profiles to employ in         clude both content-based and graph-based approaches. The
the recommendation process than other content-based ap-           former focuses on metrics for measuring the topic similar-
proaches. Preliminary results based on a comparative anal-        ity among Twitter users, the latter exploits the graph of
ysis show the benefits of the advanced approach in compar-        relationships among users to infer correlations.
ison with some state-of-the-art user recommender systems.            The main idea behind this work is that users may share
                                                                  similar interests but have different opinions about them.
                                                                  Therefore, we extend the content-based recommendation by
Categories and Subject Descriptors                                means of the sentiments and opinions extracted from the
H.3.3 [Information Search and Retrieval]: [Information            user micro-posts in order to improve the accuracy of the
Filtering]                                                        suggestions. This leads us to define a novel weighting func-
                                                                  tion in order to enrich content-based user profiles.
General Terms
Algorithms,Experimentation                                        2.     RELATED WORK
                                                                     In spite of the growing body of research on exploiting
Keywords                                                          user-generated contents in recommendation engines, there
                                                                  are few attempts to consider sentiment included in micro-
User Recommendation, Twitter, Sentiment Analysis                  posts during the recommendation process. Singh et al. [17]
                                                                  introduce a hybrid recommender system that improves the
1.   INTRODUCTION                                                 results of collaborative filtering by incorporating a sentiment
  The growing popularity of social networks increases the         classifier in the movie recommendation scenario. Bank and
availability of user sentiments, which has become a signif-       Franke [4] try to better represent public product reviews on
                                                                  weblogs through different text mining techniques. Faridani
                                                                  [9] achieves the same goal by exploiting a multivariate re-
                                                                  gression approach. As far as we are aware, there are no
                                                                  attempts towards sentiment user recommendation in social
                                                                  networks.
                                                                     User recommendation approaches that ignore user opin-
                                                                  ions have been proposed by Freyne et al. [10] and Chen et
                                                                  al. [8] exploring different recommendations strategies. Ap-
                                                                  1
                                                                      twitter.com
proaches for social recommendation that incorporate user            likelihood that the term t belongs to the label class L. A
opinions have been proposed in other domains, e.g., [5]. Guy        zero value of Salience means that the term t appears uni-
et al. [12] propose a people recommendation engine within           formly in each dataset, thus it is a good candidate to be
an enterprise social network site scenario. They aggregate          discarded. Finally, as for the Machine Learning algorithm,
several different sources to derive factors that might influ-       a Naı̈ve Bayes classifier is trained on the training data, where
ence the similarity measure. Twittomender [13] lets users           each tweet is represented as a feature vector made up of the
find pertinent profiles on Twitter exploiting different strate-     following groups of features:
gies, both content-based and collaborative ones. Arru et
al. [3] propose a signal-based representation of user interests          • Bag-of-words: vectors of word unigram;
in order to draw similarities among people.
                                                                         • Word polarities: using the LIWC4 content analysis dic-
                                                                           tionary, we extracted features for positive, negative,
3.     SENTIMENT ANALYSIS ALGORITHM                                        and neutral words. Individual word polarities are in-
   Sentiment analysis or opinion mining is formally defined                verted if the word follows a negation;
as the computational study of sentiments and opinions about
an entity expressed in a text. According to Liu [15], the en-            • Negations: we add the ”NEG ” suffix to each word fol-
tity is classified into five categories: product, person, brand,           lowing a negation pattern (e.g., ”not perfect” becomes
event, concept. Particularly, in this work we assume the                   ”perfect NEG”);
concept as the sentiment analysis target entity. Sentiment
analysis is a difficult task, hence - before the setup of the al-        • Elongated words: we represent as a feature the pres-
gorithm - some assumptions are needed. There are multiple                  ence of words with one character repeated more than
granularity levels of sentiment analysis, as explained in [2]:             two times, (e.g., ”looove”, ”yesss”);
feature-level, entity-level, sentence-level, document-level.
   In this work we consider sentiment analysis at sentence-              • Part-of-speech tags: they provide a rough measure of
level. Specifically, in the Twitter domain we assume that                  the tweet content.
a sentence matches the whole tweet. Moreover, we assume
that each sentence contains only one opinion related to the         4.     SVO RECOMMENDATION APPROACH
entity.
   The goal of our sentiment analysis system is to obtain           4.1     User profiling
an output value that represents how much positive, nega-               Several approaches to user recommendation are based on
tive or neutral is the sentiment expressed in a tweet. For          the definition of a similarity measure between two users ui
this reason, we implemented a Supervised Machine Learn-             and uj . Given the user ui , the ranked list of suggested users
ing algorithm based on a Naı̈ve Bayes classifier. With a            corresponds to the set of users uj that maximize the afore-
view to training our algorithm, we needed a dataset with            mentioned measure. Content-based approaches define this
labeled tweets. However, due to the lack of a Twitter pub-          measure by analyzing the user tweets. The set T of tweets
lic dataset, we decided to follow an alternative approach.          tweets(u) posted by the user u can be viewed as an extension
Instead of manually building a labeled dataset, Bhayani et          of the bag-of-word model, where concepts are more seman-
al. [11] propose to employ a noisy dataset of positive, neg-        tically significant and less ambiguous than plain keywords.
ative, and neutral tweets. The labels correspond to special         Instead of using complex semantic annotators, a concept is
sequences of characters in the tweets, such as positive or neg-     uniquely identified through hashtags contained in the tweet,
ative emoticons (e.g., :-D ;-( ), hashtags (e.g., #iloveit,         namely, the metadata tags that are used in Twitter to indi-
#ihate) or keywords (e.g., good, sad). Even though these            cate the context or the flow a tweet is associated with. Thus,
labels do not always correspond to the right sentiment ex-          we define the profile p of the user u as the set of weighted
pressed by the tweet, they allow us to collect a large amount       concepts:
of data for training. The Twitter API2 have been used to re-
trieve a set of tweets containing the aforementioned features.                        p(u) = {(c, ω(u, c))|c ∈ Cu }             (2)
The final training dataset counts 150000 tweets divided in
                                                                    where ω(u, c) is the relevance of the concept c for the user
50000 tweets for each class. Because the experimental eval-
                                                                    u, and Cu is the set of concepts cited by the user u. The
uation is conducted on events related to the 2013 Italian
                                                                    weighting function will be discussed in the following section.
political elections, the TextCat language recognizer3 is em-
                                                                      The user profile representation is generated by monitor-
ployed to limit the set to Italian tweets. In order to increase
                                                                    ing the user activity, that is, all the tweets included in the
the classifier precision and reduce the presence of noise, we
                                                                    observation period. Afterwards, given two users ui and uj ,
performed a feature selection. In particular, the terms with
                                                                    and their profiles p(ui ) and p(uj ), the similarity function is
low values of Salience are discarded. The Salience of a term
                                                                    defined in terms of cosine similarity:
t is defined by Pak et al. [16] as follows:
                N −1 N                                                       sim(ui , uj ) = sim(p(ui ), p(uj )) =
              1 X X          min(P (t ∈ Li ), P (t ∈ Lj ))                             P
Salience(t) =             1−                                                              c∈Cui ∪Cuj ω(ui , c) · ω(uj , c)      (3)
              N i=1 j=i+1    max(P (t ∈ Li ), P (t ∈ Lj ))                    = qP                     qP
                                                                                      c∈Cu ω(ui , c) ·
                                                                                                     2                      2
                                                         (1)                              i
                                                                                                              c∈Cu ω(uj , c)
                                                                                                                 j
where N is the number of the dataset labels, namely, N = 3
(i.e., positive, negative, and neutral) and P (t ∈ L) is the        where Cui and Cuj are the concepts in the profiles of users
2
                                                                    ui and uj , respectively.
    dev.twitter.com
3                                                                   4
    www.let.rug.nl/vannoord/TextCat/                                    liwc.net
4.2     SVO Weighting Function                                     5.    EXPERIMENTAL EVALUATION
   The idea behind this work is that taking into account
user attitudes towards his own interests can yield benefits        5.1    Dataset
in recommending friends to follow. Specifically, we consider          In order to evaluate the proposed model, we considered
(i) which is the sentiment expressed by the user for a given       a case study rich of sentiments, such as the 2013 Italian
concept, (ii) how much he is interested in that concept, and       political elections. Using the Twitter APIs we selected 31
(iii) how much he expresses objective comments on it.              hashtags for retrieving the Twitter streams about politician
   In our model the first contribution S(u, c), namely, the        leaders and parties from Jan 25th to Feb 27th. Furthermore,
sentiment of the user u about a concept c, is obtained as          because social networks are dynamic and fast-changing, we
follows:                                                           retrieved the hashtags that more often co-occur in the ob-
                        
                          P os(u, c) − N eg(u, c)
                                                                  tained tweets and added them to the initial hashtag set.
            S(u, c) = f                                   (4)      This way, we took into account the trending topics that may
                          P os(u, c) + N eg(u, c)
                                                                   be ignored in the initial query setup. The dataset counted
where P os(u, c) and N eg(u, c) are the sums of the positive       1085000 tweets, and over 25000 users that wrote almost one
and negative tweets written by the user u regarding the con-       tweet. For the experimental evaluation we finally selected
cept c, respectively. Such values are calculated by means of       1000 random users that (i) posted at least 50 tweets in the
our proposed Machine Learning algorithm (see Section 3)            observed period, and (ii) had more than 15 friends and fol-
that classifies the tweets as positive, negative or neutral. A     lowers already stored into the dataset. The final dataset for
low value of S(u, c) means that the user sentiments towards        the evaluation counted 805956 tweets.
the concept c are negative, on the contrary a high value
represents positive sentiments.                                    5.2    Evaluation
  The f function is used to normalize the output value                The goal of our user recommender system is to suggest to
within the [0, 1] range:                                           a user someone to follow, with similar interests and opinions.
                                                                   In order to compare different profiling approaches and rec-
                                      1
                         f (x) =                             (5)   ommendation strategies, we need to understand when a user
                                   1 + k−x                         u1 is relevant for a user u2 . In this work we suppose that u1
where k = 10.                                                      is relevant for u2 if a following relationship exists between
  The second contribution is the volume V (u, c), that is,         them. This assumption has recently became a commonplace
how much a user u wrote about a specific concept c and is          among social networks recommender systems [1, 14, 3] and
defined as follows:                                                is supported by the phenomenon of homophily, that is, the
                               tweets(u, c)                        tendency of individuals with similar characteristics to asso-
                  V (u, c) = PN                              (6)   ciate with each other.
                              i=1 tweets(u, ci )                      We performed a preliminary evaluation in order to assess
where tweets(u, c) is the number of tweets written by the          the effectiveness of the proposed approach. For the sake of
user u about a specific concept c, and N is the total number       brevity, in this paper we only report the results of a com-
of concepts dealt with by u.                                       parative analysis of our approach with two traditional ap-
   The third contribution is the objectivity O(u, c). With         proaches that do not consider sentiment: (i) cosine similarity
this term we denote how many tweets about a concept c              in a Vector Space Model (VSM) where vectors are weighted
do not contain sentiments or opinions and therefore may be         hashtags, and (ii) the function S1 proposed by Hannonet
objective. This may be important because objective tweets          al. [13]. We used different metrics to express the evaluation
are typically news, so quite significant for the similarity of     results. Success at Rank K (S@K) provides the mean prob-
user profiles but less relevant for the sentiment analysis.        ability that a relevant user is located in the top K positions
   O(u, c) is defined as follows:                                  of the list of suggested users. Mean Reciprocal Rank (MRR)
                                                                   indicates the average position of a user in the recommended
                               N eutral(u, c)                      list. Mean Average Precision at cut-off K (MAP@K) is the
      O(u, c) =                                              (7)
                  P os(u, c) + N eg(u, c) + N eutral(u, c)         average of the precision value for each of the top-K rec-
                                                                   ommended users. Figure 1 shows the obtained evaluation
where P os(u, c), N eg(u, c) and N eutral(u, c) are the sums       results. As can be seen, our approach outperforms the other
of the positive, negative, neutral tweets written by the user      ones according to each evaluation metric. These findings
u relative to the concept c, respectively.                         confirm that sentiment is a valuable feature to be consid-
   Based on such contributions, we proposed a novel weight-        ered in order to improve the user recommender systems.
ing function, we called sentiment-volume-objectivity (SVO)         As a marginal note, the absolute values of the achieved re-
function, that takes into account all of them. It is defined       sults are high due to the characteristics of the built dataset,
as follows:                                                        where the relations among users are significantly dense. Fi-
         SV O(u, c) = αS(u, c) + βV (u, c) + γO(u, c)        (8)   nally, we also analyzed the user recommender performance
                                                                   in terms of variations of the three parameters α, β, and
where α, β, and γ are three constants ∈ [0, 1], such that          γ (see equation 8). In order to determine the best values
α + β + γ = 1. The function SV O(u, c) ∈ [0, 1] is the             of those parameters, we implemented a mini-batch gradient
weighting function ω(u, c) that appears in the Equations 2         descent algorithm. The best results, according to aforemen-
and 3.                                                             tioned metrics, was achieved running the evaluation with
  The experimental evaluations (Section 5) shows the com-          α = 0.3, β = 0.6, and γ = 0.1. Based on the proposed
putation of the values of the parameters α, β, and γ that          model and the used dataset, these weights appear to high-
maximize the performance of the recommender.                       light the contribution of the volume and the sentiment in
comparison with the objectivity.                                     Technologies, volume 61 of Lecture Notes in Business
                                                                     Information Processing, pages 49–60. Springer Berlin
                                                                     Heidelberg, 2010.
                                                                 [5] C. Biancalana, F. Gasparetti, A. Micarelli, and
                                                                     G. Sansonetti. An approach to social recommendation
                                                                     for context-aware mobile services. ACM Trans. Intell.
                                                                     Syst. Technol., 4(1):10:1–10:31, Feb. 2013.
                                                                 [6] C. Biancalana, F. Gasparetti, A. Micarelli, and
                                                                     G. Sansonetti. Social semantic query expansion. ACM
                                                                     Trans. Intell. Syst. Technol., 4(4), 2013. Forthcoming
                                                                     issue.
                                                                 [7] C. Biancalana and A. Micarelli. Social tagging in
                                                                     query expansion: A new way for personalized web
                                                                     search. In CSE (4), pages 1060–1065. IEEE Computer
                                                                     Society, 2009.
                                                                 [8] J. Chen, W. Geyer, C. Dugan, M. Muller, and I. Guy.
                                                                     Make new friends, but keep the old: recommending
                                                                     people on social networking sites. In Proceedings of the
                                                                     27th International Conference on Human Factors in
                                                                     Computing Systems, CHI ’09, pages 201–210, New
Figure 1: Comparative analysis among the proposed                    York, NY, USA, 2009. ACM.
approach and two other state-of-the-art methods.                 [9] S. Faridani. Using canonical correlation analysis for
                                                                     generalized sentiment analysis, product
                                                                     recommendation and search. In Proceedings of the fifth
6.   CONCLUSIONS                                                     ACM Conference on Recommender systems, RecSys
   In this paper we have described a user recommender sys-           ’11, pages 355–358, New York, NY, USA, 2011. ACM.
tem for Twitter. Our work emphasizes the use of implicit        [10] J. Freyne, M. Jacovi, I. Guy, and W. Geyer.
sentiment analysis in order to improve the performance of            Increasing engagement through early recommender
the recommendation process. We have defined a novel weight-          intervention. In Proceedings of the third ACM
ing function that takes into account sentiment, volume, and          Conference on Recommender Systems, RecSys ’09,
objectivity related to the user interests. This technique al-        pages 85–92, New York, NY, USA, 2009. ACM.
lowed us to build more complete user profiles than tradi-       [11] A. Go, R. Bhayani, and L. Huang. Twitter sentiment
tional content-based approaches. Preliminary results show            classification using distant supervision. Processing,
the benefits of our proposed model compared with some                pages 1–6, 2009.
state-of-the-art methods.                                       [12] I. Guy, I. Ronen, and E. Wilcox. Do you know?:
   As future work we are planning a deep sensitivity anal-           recommending people to invite into your social
ysis to investigate whether social interactions, user prefer-        network. In Proceedings of the 14th International
ence and dataset characteristics shape parameters α, β, and          Conference on Intelligent User Interfaces, IUI ’09,
γ. We will also include some improvements of the recom-              pages 77–86, New York, NY, USA, 2009. ACM.
mendation process taking into account other elements (e.g.,     [13] J. Hannon, K. McCarthy, and B. Smyth. Finding
named-entities, persons, products) and semantic represen-            useful users on twitter: twittomender the followee
tations of hashtags (e.g., [6][7]). A future study will also         recommender. In Proceedings of the 33rd European
focus on the use of the implicit sentiment analysis within           Conference on Advances in Information Retrieval,
the collaborative filtering in social networks.                      ECIR’11, pages 784–787, Berlin, Heidelberg, 2011.
                                                                     Springer-Verlag.
7.   REFERENCES                                                 [14] H. John, B. Mike, and S. Barry. Recommending
 [1] F. Abel, Q. Gao, G.-J. Houben, and K. Tao. Analyzing            twitter users to follow using content and collaborative
     temporal dynamics in twitter profiles for personalized          filtering approaches. RecSys’10 : Proceedings of the
     recommendations in the social web. In Proceedings of            4th ACM Conference on Recommender Systems,,
     ACM WebSci ’11, 3rd International Conference on                 26-30(10):8, 09 2010.
     Web Science, Koblenz, Germany. ACM, June 2011.             [15] B. Liu. Sentiment analysis and subjectivity. Handbook
 [2] A. Agarwal, B. Xie, I. Vovsha, O. Rambow, and                   of Natural Language Processing,, pages 627–666, 2010.
     R. Passonneau. Sentiment analysis of twitter data. In      [16] A. Pak and P. Paroubek. Twitter as a corpus for
     Proceedings of the Workshop on Languages in Social              sentiment analysis and opinion mining. volume 2010,
     Media, LSM ’11, pages 30–38, Stroudsburg, PA, USA,              pages 1320–1326, 2010.
     2011. Association for Computational Linguistics.           [17] V. K. Singh, M. Mukherjee, and G. K. Mehta.
 [3] G. Arru, D. Feltoni Gurini, F. Gasparetti, A. Micarelli,        Combining collaborative filtering and sentiment
     and G. Sansonetti. Signal-based user recommendation             classification for improved movie recommendations. In
     on twitter. Social Recommender Systems 2013, 2013.              Proceedings of the 5th International Conference on
 [4] M. Bank and J. Franke. Social networks as data                  Multi-Disciplinary Trends in Artificial Intelligence,
     source for recommendation systems. In F. Buccafurri             MIWAI’11, pages 38–50, Berlin, Heidelberg, 2011.
     and G. Semeraro, editors, E-Commerce and Web                    Springer-Verlag.