70
Opinion mining for social media Diana Maynard University of Sheffield, UK

Opinion mining for social media

Embed Size (px)

DESCRIPTION

invited talk at Charles University, Prague, September 2012

Citation preview

Page 1: Opinion mining for social media

Opinion mining for social media

Diana MaynardUniversity of Sheffield, UK

Page 2: Opinion mining for social media

Who Wants to be a Millionaire?

Ask the audience?

Or Phone a Friend?

Page 3: Opinion mining for social media

How did the Royal Wedding influence the UK's health?

Page 4: Opinion mining for social media

Can Twitter help us predict the stock market?

“Hey Jon, Derek in Scunthorpe's having a bacon and egg butty. Is that good for wheat futures?”

Page 5: Opinion mining for social media

Can Twitter predict earthquakes?

Page 6: Opinion mining for social media

Outline

• Introduction - social media, opinion mining and the Arcomem project

• What is opinion mining and why is it hard?• Current research in the Arcomem project• What does the future hold?

Page 7: Opinion mining for social media

The Social Web

Information, thoughts and opinions are shared prolifically these days on the social web

Page 8: Opinion mining for social media

Drowning in information

• It can be difficult to get the relevant information out of such large volumes of data in a useful way

• Social web analysis is all about the users who are actively engaged and generate content

• Social networks are pools of a wide range of articulation methods, from simple "I like it" buttons to complete articles

Page 9: Opinion mining for social media

Opinion Mining

• Along with entity, topic and event recognition, opinion mining forms the cornerstone for social web analysis

Page 10: Opinion mining for social media

What is Opinion Mining?

• OM is a relatively recent discipline that studies the extraction of opinions using IR, AI and/or NLP techniques.

• More informally, it's about extracting the opinions or sentiments given in a piece of text

• Also referred to as Sentiment Analysis (though technically this is a more specific task)

• Web 2.0 nowadays provides a great medium for people to share things.

• This provides a great source of unstructured information (especially opinions) that may be useful to others (e.g. companies and their rivals, other consumers, governments...)

Page 11: Opinion mining for social media

It's about finding out what people think...

Page 12: Opinion mining for social media

Opinion Mining is Big Business

● Someone who wants to buy a camera● Looks for comments and reviews

● Someone who just bought a camera● Comments on it● Writes about their experience

● Camera Manufacturer● Gets feedback from customer● Improve their products● Adjust Marketing Strategies

Page 13: Opinion mining for social media

Analysing and preserving opinions• We want to collect, store and later retrieve public opinions about events

and their changes or developments over time• Not only can online social networks provide a snapshot of such

situations, but they can actually trigger a chain of reactions and events• Ultimately these events might led to societal, political or administrative

changes• Since the Royal Wedding, Pilates classes have become incredibly popular

in the UK solely as a result of social media.

Page 14: Opinion mining for social media

On a more serious note...● We can measure the impact of a political entity or event on the overall

sentiment about another entity or event, over the course of time.● Aggregation of opinions over entities and events to cover sentences and

documents● Combined with time information and/or geo-locations, we can then

analyse changes to opinions about the same entity/event over time, and other statistical correlations

Page 15: Opinion mining for social media

But there are lots of tools that do this already....

• Here are some examples:– Twitter sentiment http://twittersentiment.appspot.com/– Twends: http://twendz.waggeneredstrom.com/– Twittratr: http://twitrratr.com/– SocialMention: http://socialmention.com/

Page 16: Opinion mining for social media

Why not use existing sentiment apps?

• Easy to search for opinions about famous people, brands and so on

• Hard to search for more abstract concepts, perform a non-keyword based string search– e.g. to find opinions about Lady Gaga's' dress, you can only

search on “Lady Gaga” to get hits• And the opinion finding they do isn't very good...

Page 17: Opinion mining for social media

Why are these sites unsuccessful?

• They don't work well at more than a very basic level• They mainly use dictionary lookup for positive and negative

words• They classify the tweets as positive or negative, but not with

respect to the keyword you're searching for• First, the keyword search just retrieves any tweet mentioning

it, but not necessarily about it as a topic• Second, there is no correlation between the keyword and the

sentiment: the sentiment refers to the tweet as a whole• Sometimes this is fine, but it can also go horribly wrong

Page 18: Opinion mining for social media

Whitney Houston wasn't very popular...

Page 19: Opinion mining for social media

Or was she?

Page 20: Opinion mining for social media

Negative tweets about Whitney?

• the #nationalenquirers cover photo of #whitneyhouston lying in a casket has sparked outrage in the #media world

• feeling bad for #whitneyhouston right now• It's such a shame #whitneyhouston is dead

Page 21: Opinion mining for social media

What did people think of the Olympics?

Page 22: Opinion mining for social media

Twittrater's view of the Olympics

• A keyword search for Olympics shows exactly how existing systems fail to cut the mustard

• Lookup of sentiment words is not enough if– they're part of longer words– they're used in different contexts– the tweet itself isn't relevant– they're used in a negative or sarcastic sentence– they're ambiguous

Page 23: Opinion mining for social media
Page 24: Opinion mining for social media

What's the capital of Spain?

A: Barcelona

B: Madrid

C: Valencia

D: Seville

Page 25: Opinion mining for social media

What's the height of Mt Kilimanjaro?

A: 19,341 ft

B: 23,341 ft

C: 15,341 ft

D: 21,341 ft

Page 26: Opinion mining for social media

Go for the majority or trust an expert?• It depends what kind of question you're asking• In Who Wants to Be a Millionaire, people tend to ask the audience

fairly early on, because once the questions get hard, they can't rely on the audience getting it right

• Similarly with opinion mining, you have to know who to trust

What's the height of Mt Kilimanjaro?

What's the capital of Spain?

A: BarcelonaB: MadridC: ValenciaD: Seville

A: 19,341 ftB: 23,341 ftC: 15,341 ftD: 21,341 ft

Page 27: Opinion mining for social media

Arcomem project

• EU-funded research project involving memory institutions like archives, museums, and libraries in the age of the Social Web.

• Arcomem aims to – help transform archives into collective memories that are

more tightly integrated with their community of users– exploit Social Web and the wisdom of crowds to make

Web archiving a more selective and meaning-based process

• http://vimeo.com/45954490

Page 28: Opinion mining for social media

Key questions

• What are the opinions on crucial social events and who are the main protagonists?

• How are these opinions distributed in relation to demographic user data?

• How have these opinions evolved?• Who are the opinion leaders?• What is their impact and influence?

Page 29: Opinion mining for social media

ETOEs detection in Arcomem• ETOES - Entities, Topics, Opinions and Events• ETOEs detection is used to guide the crawler and to add useful

metadata to the information stored for future search• Opinion mining builds on entities, terms and events identified,

finding relevant opinions about them• Text-based sentiment analysis performed by GATE tools (USFD) in

English and German • Text-based analysis is then combined with topic detection to

produce clustered opinions over documents• Image- and video-based opinion mining also plays a supporting

role, e.g. match new images against existing images which have been manually annotated as positive or negative

Page 30: Opinion mining for social media

ETOEs Workflow

Linguistic Preprocessing

Entity Extraction

Opinion Mining Topic Identification

Event Extraction

Relation Extraction

Dynamics Capturing

Word Sense Determination

Page 31: Opinion mining for social media

Integration Architecture

Page 32: Opinion mining for social media

Main Research Directions New techniques for opinion mining based around entities and events in

social media - different from typical product reviews. Approach involves building up a number of linguistic subcomponents Includes techniques for multimedia opinion analysis Investigating the reusability of these components for different

domains, document types, languages etc (Knowledge Transfer) Experiments on cross- domain/language adaptation

• Aggregation of opinions over a document Extension of work from LivingKnowledge project on drilling down

into subtopics about specific entities, rather than just getting information about general topics

Provide summaries of opinions for multiple occurrences of entities in a document

Page 33: Opinion mining for social media

Text-based Opinion Mining in Arcomem

• Performed basic sentiment analysis on various English and German datasets

• Documents may be in multiple languages, e.g. Greek crisis documents contain both English and Greek sentences

• Entities and events used as seeds for opinion objects• Experimenting with sentiment lexicons for initial lookup -

currently SentiWordNet (English), SentiWS (German) and additions automatically derived from test corpora

• Components for detection of negatives, swear words etc• Output is an opinion feature on the entity/event, plus polarity

and score features where appropriate

Page 34: Opinion mining for social media

Opinion Mining sub-components• Top level sub-components

source and target identification (entity/event-based) opinion-feature association (uses linguistic relations)

• Dealing with the complexities of natural language incorrect English negatives conditional statements slang/swear words/ irony/sarcasm spam opinion detection

Page 35: Opinion mining for social media

What can we realistically hope to achieve?

● Opinion mining is hard, and it's harder because:● we have lots of different text types and domains.

● we're processing social media

● we're processing multiple language

● we don't necessarily know what we're looking for

● Experimenting with different techniques and subcomponents to build up a complex OM system

● Experimenting with techniques for cross-language adaptation

Page 36: Opinion mining for social media

GATE (General Architecture for Text Engineering)

● GATE is a tool for Language Engineering in development in Sheffield since 2000.

● GATE includes:

– components for language processing, e.g. parsers, machine learning tools, stemmers, IR tools, IE components for various languages...

– tools for visualising and manipulating text, annotations, ontologies, parse trees, etc.

– various information extraction tools– evaluation and benchmarking tools

• More info and freely available at http://gate.ac.uk

Page 37: Opinion mining for social media

Applications• Developed a series of initial applications for opinion mining

from social media using GATE• Based on previous work identifying political opinions from

tweets• Extended to more generic analysis about any kind of entity or

event, in 2 domains– Greek financial crisis– Rock am Ring (German rock festival)

• Uses a variety of social media including twitter, facebook and forum posts

• Based on entity and event extraction

Page 38: Opinion mining for social media

Machine learning approach ML: automating the process of inferring new data from existing data

In GATE, that means creating annotations or adding features to annotations by learning how they relate to other annotations

For example, we haveToken annotations with string features and Product annotations

● ML could learn that a Product close to the Token “stinks” expresses a negative sentiment, then add a polarity =“negative” feature to the Sentence.

The new Acme Model 33 stinks !Token Token Token Token Token Token Token

ProductSentence

Page 39: Opinion mining for social media

Rule-based techniques

• These rely primarily on sentiment dictionaries, plus some rules to do things like attach sentiments to targets, or modify the sentiment scores

• Examples include:– analysis of political tweets (Maynard and Funk, 2011)– analysis of opinions expressed about political events and

rock festivals in social media (Maynard, Bontcheva and Rout, 2012)

– SO-CAL (Taboada et al, 2011) for detecting positive and negative sentiment of ePinions reviews on the web.

Page 40: Opinion mining for social media

Why Rule-based?

• Although ML applications are typically used for Opinion Mining, this task involves documents from many different text types, genres, languages and domains

• This is problematic for ML because it requires many applications trained on the different datasets, and methods to deal with acquisition of training material

• Aim of using a rule-based system is that the bulk of it can be used across different kinds of texts, with only the pre-processing and some sentiment dictionaries which are domain and language-specific

Page 41: Opinion mining for social media

GATE Application

• Structural pre-processing, specific to social media types• Linguistic pre-processing (including language detection), NE,

term and event recognition• Additional targeted gazetteer lookup• JAPE grammars• Aggregation of opinions• Dynamics

Page 42: Opinion mining for social media

Structural pre-processing on Twitter

Original markups set

Page 43: Opinion mining for social media

Linguistic pre-processing

• Language identification (per sentence) using TextCat• Standard tokenisation, POS tagging etc using GATE• Modified versions of ANNIE and TermRaider for NE and term

recognition• Event recognition using specially developed GATE application

(e.g. band performance, economic crisis, industrial strike)

Page 44: Opinion mining for social media

Language ID with TextCat

Page 45: Opinion mining for social media

Basic approach for opinion finding

• Find sentiment-containing words in a linguistic relation with entities/events (opinion-target matching)

• Use a number of linguistic sub-components to deal with issues such as negatives, irony, swear words etc.

• Starting from basic sentiment lookup, we then adjust the scores and polarity of the opinions via these components

Page 46: Opinion mining for social media

Sentiment finding components

• Flexible Gazetteer Lookup: matches lists of affect/emotion words against the text, in any morphological variant

• Gazetteer Lookup: matches lists of affect/emotion words against the text only in non-variant forms, i.e. exact string match (mainly the case for specific phrases, swear words, emoticons etc.)

• Sentiment Grammars: set of hand-crafted JAPE rules which annotate sentiments and link them with the relevant targets and opinion holders

• RDF Generation: create the relevant RDF-XML for the annotations according to the data model (so they can be used by other components)

Page 47: Opinion mining for social media

Opinions on Greek Crisis Text

Page 48: Opinion mining for social media

Austrian Parliament• Our partners in the Austrian Parliament have quite specific

requests for opinion mining on Parliamentary texts (in German): identification of comments being in favour or against a draft

bill if possible, distinguish between the reasons for dislike (e.g.

because it goes too far, or does not go far enough) if possible, also distinguish alternative concepts in the

comments • These are difficult challenges, mainly to be tackled in the later

stages of the project as we extend beyond positive/negative/neutral opinions

• Different strategies required, e.g. not necessarily starting from entities and events, but making more use of topics

Page 49: Opinion mining for social media

Sentiment Finding in Parliamentary docs

Page 50: Opinion mining for social media

Opinion scoring• Sentiment gazetteers (developed from sentiment words in

WordNet) have a starting “strength” score• These get modified by context words, e.g. adverbs, swear

words, negatives and so on

Page 51: Opinion mining for social media

Opinions about Entities in Rock am Ring

Page 52: Opinion mining for social media

Opinions about sentences in RockamRing

Page 53: Opinion mining for social media

Challenges imposed by social media

• Language: specific pre-processing for Twitter. use shallow analysis techniques with back-off strategies; incorporate specific subcomponents for swear words, sarcasm etc.

• Relevance: topics and comments can rapidly diverge. Solutions involve training a classifier or using clustering techniques

• Target identification: use an entity-centric approach• Contextual information: use metadata for further information,

also aggregation of data can be useful

Page 54: Opinion mining for social media

Short sentences, e.g. tweets

• Social media, and especially tweets, can be problematic because sentences are very short and/or incomplete

• Typically, linguistic pre-processing tools such as POS taggers and parsers do badly on such texts

• Even things like language identification tools can have problems• The best solution is to try not to rely too heavily on these tools

– Does it matter if we get the wrong language for a sentence?– Do we actually need full parsing?– Can we use other clues when POS tags may be incorrect?

Page 55: Opinion mining for social media

Dealing with incorrect English

• Frequent problem in any NLP task involving social media• Incorrect capitalisation, spelling, grammar, made-up words (eg swear

words, infixes)• Some specific pre-processing• Backoff strategies include

● using more flexible gazetteer matching● using case-insensitive resources (but be careful)● avoiding full parsing and using shallow techniques● using very general grammar rules● adding specialised gazetteer entries for common misspellings, or

using co-reference techniques

Page 56: Opinion mining for social media

Tokenisation

• Plenty of “unusual”, but very important tokens in social media: – @Apple – mentions of company/brand/person names– #fail, #SteveJobs – hashtags expressing sentiment, person

or company names– :-(, :-), :-P – emoticons (punctuation and optionally letters)– URLs

• Tokenisation key for entity recognition and opinion mining• A study of 1.1 million tweets: 26% of English tweets have a

URL, 16.6% - a hashtag, and 54.8% - a user name mention [Carter, 2013].

Page 57: Opinion mining for social media

Example

#WiredBizCon #nike vp said when @Apple saw what http://nikeplus.com did, #SteveJobs was like wow I didn't expect this at all.

● Tokenising on white space doesn't work that well: ● Nike and Apple are company names, but if we have tokens such

as #nike and @Apple, this will make the entity recognition harder, as it will need to look at sub-token level

● Tokenising on white space and punctuation characters doesn't work well either: URLs get separated (http, nikeplus), as are emoticons and email addresses

Page 58: Opinion mining for social media

The GATE Twitter Tokeniser

• Treat RTs, emoticons, and URLs as 1 token each• #nike is two tokens (# and nike) plus a separate annotation

HashTag covering both. Same for @mentions• Capitalisation is preserved, but an orthography feature is

added: all caps, lowercase, mixCase• Date and phone number normalisation, lowercasing, and

other such cases are optionally done later in separate modules

• Consequently, tokenisation is faster and more generic

Page 59: Opinion mining for social media

De-duplication and Spam Removal

• Approach from [Choudhury & Breslin, #MSM2011]:• Remove as duplicates/spam:

– Messages with only hashtags (and optional URL)– Similar content, different user names and with the same

timestamp are considered to be a case of multiple accounts

– Same account, identical content are considered to be duplicate tweets

– Same account, same content at multiple times are considered as spam tweets

Page 60: Opinion mining for social media

Normalisation• “RT @Bthompson WRITEZ: @libbyabrego honored?! Everybody

knows the libster is nice with it...lol...(thankkkks a bunch;))”• OMG! I’m so guilty!!! Sprained biibii’s leg! ARGHHHHHH!!!!!!• Similar to SMS normalisation• For some later components to work well (POS tagger, parser), it

is necessary to produce a normalised version of each token• BUT uppercasing, and letter and exclamation mark repetition

often convey strong sentiment, so we keep both versions of tokens

• Syntactic normalisation: determine when @mentions and #tags have syntactic value and should be kept in the sentence, vs replies, retweets and topic tagging

Page 61: Opinion mining for social media

Irony and sarcasm

• Life's too short, so be sure to read as many articles about celebrity breakups as possible.

• I had never seen snow in Holland before but thanks to twitter and facebook I now know what it looks like. Thanks guys, awesome!

• On a bright note if downing gets injured we have Henderson to come in.

Page 62: Opinion mining for social media

How do you know when someone is being sarcastic?

• Use of hashtags in tweets such as #sarcasm• Large collections of tweets based on hashtags can be used to

make a training set for machine learning• But you still have to know which bit of the tweet is the

sarcastic bitTo the hospital #fun #sarcasmMan , I hate when I get those chain letters & I don't resend them , then I die the next day .. #Sarcasmlol letting a baby goat walk on me probably wasn't the best idea. Those hooves felt great. #sarcasm

Page 63: Opinion mining for social media

How else can you deal with it?

• Look for word combinations with opposite polarity, e.g. “rain” or “delay” plus “brilliant”

Going to the dentist on my weekend home. Great. I'm totally pumped. #sarcasm• Inclusion of world knowledge / ontologies can help (e.g.

knowing that people typically don't like going to the dentist, or that people typically like weekends better than weekdays.

• It's an incredibly hard problem and an area where we expect not to get it right that often

• Still very much work in progress for us

Page 64: Opinion mining for social media

Evaluation• Very hard to measure opinion polarity beyond

positive/negative/neutral• On a small corpus of 20 facebook posts, we identified

sentiment-containing sentences with 86% Precision and 71% Recall

• Of these, the polarity accuracy was 66%• While this is not that high, not all the subcomponents are

complete in the system, so we would expect better results with improved methods for negation and sarcasm detection

• NE recognition was high on these texts: 92% Precision and 69% Recall (compared with other NE evaluations on social media)

Page 65: Opinion mining for social media

Comparison of Opinion Finding in Different Tasks

Corpus Sentiment detection

Polarity detection

Target assignment

Political Tweets 78% 79% 97.9%

Financial Crisis Facebook 55% 81.8% 32.7%

Financial Crisis Tweets 90% 93.8% 66.7%

Page 66: Opinion mining for social media

Image-opinion identificationFacial expression analysis/classification

– Working on processing pipeline for this– Helps with facial similarity calculations and

face recognition– Can be used to predict sentiment/polarity– Can be combined with analysis text from

documentCoarse-grained opinion classification

– Looking at image-feature classification for abstract concepts (sentiment / privacy / attractiveness)

– e.g. looking at image colours, placement of interesting images in the picture

Page 67: Opinion mining for social media

Multimodal opinion analysis● Investigate correlation between images and

whole-document opinions● Do documents asserting specific opinions

get illustrated with the same imagery?● e.g. articles about euro-scepticism in the

UK might be illustrated with images of specific Conservative peers….

● Is there correlation between low-level image features and specific opinions?

● Investigate finer-grained (i.e. sub-document) correlations between imagery and opinions● e.g. sentence-level correlations

incorporating analysis of the document layout

Page 68: Opinion mining for social media

Summary

• Ongoing work on developing opinion mining tools and adapting them to social media

• Deal with multilinguality, ungrammatical English, and very short posts (tweets)

• Components for negation, swear words, sarcasm etc

• Promising initial evaluations• Much further work still to come, e.g.

integration with multimedia components

Page 69: Opinion mining for social media

Further information

• Work done in the context of the EU-funded ARCOMEM and TrendMiner projects

• See http://www.arcomem.eu and http://www.trend-miner.eu for more details

• More information about GATE at http://gate.ac.uk• More information about opinion mining see the LREC 2012 Tutorial

“Opinion Mining: Exploiting the Sentiment of the Crowd” • Module 12 of the GATE Training Course (new material since June

2012) https://gate.ac.uk/family/training.html

Page 70: Opinion mining for social media

Questions?