Professional Documents
Culture Documents
sentiment Examples
tm.plugin.sentiment
Online Sentiment Analysis using R
Mario Annau
1 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Table of Contents
1 Motivation
2 Related work
3 The tm library
4 tm.plugin.sentiment
5 Examples
2 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
3 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Google News
Search for Microsoft
4 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
5 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
6 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
7 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
8 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
2010 2011 according android announced apple apples attachmate billion blue
microsoft
nasdaq news nov
read redmond reports rivals
novell operating
sales
percent phone plans
salesforcecom
microsofts million mobile monday msft
platform potential price products quarter
search service services seventh share
shares
smartphone
software stock stocks successful system tech technology test
thestreet
time unified users version video wall web week windows york
1
generated using snippets and tm.plugin.sentiment, content taken from
Yahoo! Boss XML abstracts
9 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
25.0
24.5
24.0
23.5
0.00
Aug 26 Aug 30 Sep 01 Sep 03 Sep 08 Sep 10 Sep 14 Sep 16 Sep 20 Sep 22
2010 2010 2010 2010 2010 2010 2010 2010 2010 2010
10 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Table of Contents
1 Motivation
2 Related work
3 The tm library
4 tm.plugin.sentiment
5 Examples
11 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Literature
12 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Literature
Paul Tetlock
Sentiment analysis of popular Wall Street journal column
“Abreast of the Market”
[Tetlock, 2007]
Giving Content to Investor Sentiment: The Role of Media in
the Stock Market
Journal of Finance 62, 1139-1168, 2007
Use bag–of–words model and dictionary from the General
Inquirer
Negative news sentiment category (total: 77) has most
predictive power for market prices like the Dow Jones
Industrial Avg. (DOW 30)
13 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Literature
Lydia/Textmap
14 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Products
Commercial Products
Thomson One
Dow Jones News Analytics
Raven Pack [ravenpack.com] Bayes training, vector
classification, word/phrase lists, pattern detection and market
response-based analysis are just a few techniques RavenPack
deploys in conducting news sentiment analysis.
15 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Products
16 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Products
17 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Products
Pros:
Large set of operators (esp. through WEKA)
Workflow orientation for transparency
Cons:
Customization, changes often have to take place in JAVA code
18 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Products
19 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Products
Pros:
Excellent scripting language, also interactive
Quality of libraries (especially for our purposes: NLTK
Can easily integrated with GUI’s (e.g. PyQt)
Cons:
Compared to R: Worse support for stat. functions
20 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Table of Contents
1 Motivation
2 Related work
3 The tm library
4 tm.plugin.sentiment
5 Examples
21 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
tm – Short Intro
tm – Short Intro
22 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
23 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Source–Reader Concept
Source–Reader Concept
24 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Table of Contents
1 Motivation
2 Related work
3 The tm library
4 tm.plugin.sentiment
5 Examples
25 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Overview
Overview
26 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Overview
27 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Data retrieval
28 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
29 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Sources Available
For ease of use many different news sources have already been
implemented in tm.plugin.sentiment:
News Sources from RSS Feeds like Google News, Yahoo News
APIs (free registrations required) like Reuters Spotlight, NY
Times, Yahoo BOSS, Bing
30 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Content Extraction
[Gottron, 2008]
Content Extraction: Identifying the Main Content in HTML
Documents
Johannes Gutenberg-University, Mainz, 2008
31 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Source: AI Depot
32 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
33 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Preprocessing
Preprocessing
34 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Sentiment Calculation
Sentiment Calculation
35 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Sentiment Calculation
Sentiment Indicators2
p−n
polarity = (1)
p+n
n+p
subjectivity = (2)
N
p
pos refs per ref = (3)
N
n
neg refs per ref = (4)
N
p−n
senti diffs per ref = (5)
N
2
taken from the Lydia/Textmap project
36 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Sentiment Visualization
25.0
24.5
24.0
23.5
0.00
Aug 26 Aug 30 Sep 01 Sep 03 Sep 08 Sep 10 Sep 14 Sep 16 Sep 20 Sep 22
2010 2010 2010 2010 2010 2010 2010 2010 2010 2010
37 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Table of Contents
1 Motivation
2 Related work
3 The tm library
4 tm.plugin.sentiment
5 Examples
38 / 39
Motivation Related work The tm library tm.plugin.sentiment Examples
Examples
39 / 39