EU Twitter Sentiment Analysis

Analysis of the sentiment in the twittersphere towards the UK leaving or remaining in the EU


  1. In this article we look at the sentiment of hashtags in our dataset. We look at sentiment in general and, in particular, at how difficult this is to measure. In previous articles we discussed in detail the hashtags used by the groups campaigning for the UK to either remain in or to leave the European Union (@StrongerIn, @vote_leave, @LeaveEUOfficial).
  2. One of the aspects we want to address in our work is the identification of sentiment in our dataset. We want to ask questions such as: 1) are people from the UK positive or negative about the EU? and 2) can we quantify this by topic and/or geography?

    Identifying the target of a sentiment expressed in a tweet or a piece of text in general is a hard task. There is software available that measures the strength and direction of sentiment in a segment of text but it is harder to identify what that sentiment is expressed towards. This is what we call the target of the sentiment and it is difficult to automatically extract this target.
  3. For example we have the tweet below. We can clearly see that this tweet is pro-remain. If we use a general sentiment analysis tool the text from this tweet would have a positive sentiment score based on the language that is used. We can see that there are two targets in this sentence who both have positive sentiment. There is Sir John Major who 'is clear' and Britain who 'is stronger in Europe'.
  4. After the identification of sentiment polarity, strength and target we would like to combine this information to see how this relates to more general topics of discussion and to the relationship between the UK and the EU. In the tweet above even though a pro-remain sentiment is expressed it is difficult to automatically relate the positive sentiment towards the UK and a pro-remain point of view. We can with this tweet use further context and qualifying information, such as the hashtag but not all tweets contain this information. Of course, not all EU-related tweets have a stance on the future of the UK-EU relationship. We are currently looking into ways to address this issue in more detail and will report our results at a later date.
  5. To present an initial overview of sentiment in the data collected we are calculating the percentage of hashtags in the data which express a polarity either pro-leave or pro-remain.
  6. We launched the Neuropolitics Research Labs website on the 1st December ( you can look at this for more details of our work).
  7. As part of this site we have launched the interactive #ImagineEurope Twitter Demonstrator. This provides access to visualisations of the Twitter data we have collected since 7th August 2015.
  8. On the #ImagineEuropeTwitter demo there is a sentiment dial, a map showing locations extracted from Tweets and a wordle of commonly used hashtags. This is an overview of the entire data set. There are further pages that can be linked to that show sentiment, locations and hashtag wordles by day.
  9. The dataset presented in our interactive twitter demonstrator is gathered using a set of hashtags relating to the upcoming referendum on the UK's inclusion in the EU. We discussed how we collected the data in a previous article. Since then we have added in new hashtags to reflect the on going discussion and those used by the leave and remain campaigns. These are '#migrant','#refugee', '#strongerin', '#leadnotleave', '#voteremain','#britainout', '#leaveeu', '#voteleave', '#beleave','#loveeuropeleaveeu'
  10. We have initially adopted the approach of counting the hashtags in our set that clearly have a pro-leave or a pro-remain bias. There are 10 remain hashtags used in the sentiment calculation these are #yes2eu,#yestoeu, #betteroffin #votein, #ukineu #bremain #strongerin,#leadnotleave, #voteremain, #votein. There are also 10 leave hashtags used. These are #brexit, #no2eu, #notoeu, #betteroffout, #voteout, #britainout, #leaveeu,#loveeuropeleaveeu #voteleave #beleave.
  11. We can see from the dial most of the data in our sets contains leave hashtags. We can break this down to show the counts per hashtag.
  12. This break down shows that the #brexit hashtag is the most used. This hashtag is not always used to signal support of #brexit. In fact we discussed in a previous post how this hashtag is being used by both pro-leave and pro-remain groups. #brexit appears to be used as label of the referendum discussion in general rather then an indicator of sentiment direction.
  13. To move beyond the current solution we are working with the The Tag Research Laboratory at the University of Sussex. They are involved in research into social media analysis. We are working with them to adapt their software to our data to find a solution to this tricky sentiment problem.
  14. This is written as part of the #ImagineEurope project. The project is part of the Economic and Social Research Council's UK in a Changing Europe programme Look out for our regular updates as the project tracks developments in the debate on the UK's continued membership of the EU and follow us @myimageoftheEU on twitter for more information on this and other projects.