Detecting Events and Patterns in the Social Web with Statistical Learning
Vasileios Lampos
Computer Science Department University of Sheffield
- V. Lampos
bill@lampos.net Detecting Events and Patterns in the Social Web 1/34
1/34
Detecting Events and Patterns in the Social Web with Statistical - - PowerPoint PPT Presentation
Detecting Events and Patterns in the Social Web with Statistical Learning Vasileios Lampos Computer Science Department University of Sheffield 1 / 34 V. Lampos bill@lampos.net Detecting Events and Patterns in the Social Web 1/34 Outline
Computer Science Department University of Sheffield
bill@lampos.net Detecting Events and Patterns in the Social Web 1/34
1/34
bill@lampos.net Detecting Events and Patterns in the Social Web 2/34
2/34
(Debatin et al., 2009)
bill@lampos.net Detecting Events and Patterns in the Social Web 3/34
3/34
bill@lampos.net Detecting Events and Patterns in the Social Web 4/34
4/34
Figure 1: Some biased and anonymised examples of tweets (limit of 140 characters/tweet, # denotes a topic)
(a) (user will remain anonymous) (b) they live around us (c) citizen journalism (d) flu attitude
bill@lampos.net Detecting Events and Patterns in the Social Web 5/34
5/34
bill@lampos.net Detecting Events and Patterns in the Social Web 6/34
6/34
bill@lampos.net Detecting Events and Patterns in the Social Web 7/34
7/34
) (
) (u
M
) (u
) (u
S
State of the World
Figure 2: Nowcasting the magnitude of an event (ε) emerging in the real world from Web information
bill@lampos.net Detecting Events and Patterns in the Social Web 8/34
8/34
5 10 15 20 25 30 2 4 6 8 10 12 14 16
Figure 3: Inferred rainfall rates for Bristol, UK (October, 2009)
bill@lampos.net Detecting Events and Patterns in the Social Web 9/34
9/34
|P(u)|
bill@lampos.net Detecting Events and Patterns in the Social Web 10/34
10/34
T
bill@lampos.net Detecting Events and Patterns in the Social Web 11/34
11/34
w
ℓ2
(Tibshirani, 1996)
(Efron et al., 2004)
bill@lampos.net Detecting Events and Patterns in the Social Web 12/34
12/34
(Manning, Raghavan and Schütze, 2008)
L(w) ≤ L( ˆ w) + Q, with Q ∼ min W 2
1
N + p N , W 2
1
N + W1 √ N
w) and ˆ wℓ1 ≤ W1
(Bartlett, Mendelson and Neeman, 2011)
bill@lampos.net Detecting Events and Patterns in the Social Web 13/34
13/34
Figure 4: Events co-occurring with the inference target may affect feature selection, especially when the sample size is small.
180 200 220 240 260 280 300 320 340 50 100 150 200 250 300
Day Number (2009) Event Score
Flu (England & Wales) Hypothetical Event I Hypothetical Event II
(Lampos, 2012a)
bill@lampos.net Detecting Events and Patterns in the Social Web 14/34
14/34
Table 1: Top-20 1-grams correlated with flu rates in England/Wales (06–12/2009)
1-gram Event
latitud Latitude Festival 0.9367 flu Flu epidemic 0.9344 swine
harri Harry Potter Movie 0.9112 slytherin
potter
benicassim Benicàssim Festival 0.8966 graduat Graduation (?) 0.8965 dumbledor Harry Potter Movie 0.8870 hogwart
quarantin Flu epidemic 0.8822 gryffindor Harry Potter Movie 0.8813 ravenclaw
princ
swineflu Flu epidemic 0.8633 ginni Harry Potter Movie 0.8620 weaslei
hermion
draco
snape
(Lampos, 2012a)
bill@lampos.net Detecting Events and Patterns in the Social Web 15/34
15/34
bill@lampos.net Detecting Events and Patterns in the Social Web 16/34
16/34
Figure 5: Font size is proportional to the weight of each feature; flipped n-grams are negatively weighted. All words are stemmed (Porter, 1980).
(Lampos and Cristianini, 2012)
bill@lampos.net Detecting Events and Patterns in the Social Web 17/34
17/34
Figure 6: Font size is proportional to the weight of each feature; flipped n-grams are negatively weighted. All words are stemmed (Porter, 1980).
(Lampos and Cristianini, 2012)
bill@lampos.net Detecting Events and Patterns in the Social Web 18/34
18/34
5 10 15 20 25 30 20 40 60 80 100 120
Days Flu Rate − C.England & Wales Actual Inferred
(a) Central England/Wales (flu)
5 10 15 20 25 30 20 40 60 80 100 120
Days Flu Rate − S.England Actual Inferred
(b) South England (flu)
5 10 15 20 25 30 2 4 6 8 10 12 14 16
Days Rainfall rate (mm) − Bristol Actual Inferred
(c) Bristol (rain)
Figure 7: Examples of flu and rainfall rates inferences from Twitter content
(Lampos and Cristianini, 2012)
bill@lampos.net Detecting Events and Patterns in the Social Web 19/34
19/34
Figure 8: Flu Detector uses the content of Twitter to nowcast flu rates in several UK regions
(Lampos, De Bie and Cristianini, 2010)
bill@lampos.net Detecting Events and Patterns in the Social Web 20/34
20/34
bill@lampos.net Detecting Events and Patterns in the Social Web 21/34
21/34
Table 2: Mood terms from WordNet Affect
Fear Sadness Joy Anger afraid depressed admire angry fearful discouraged cheerful despise frighten disheartened enjoy enviously horrible dysphoria enthousiastic harassed panic gloomy exciting irritate ... ... ... ... (92 terms) (115 terms) (224 terms) (146 terms)
|D|
n
i
i
i
f
(td,u) i
: normalised frequency of a mood term i during time interval u in day d∈D
bill@lampos.net Detecting Events and Patterns in the Social Web 22/34
22/34
Figure 9: Circadian (24-hour) mood patterns based on UK Twitter content
Fear Score
3 6 9 12 15 18 21 24
0.1 Winter Summer 3 6 9 12 15 18 21 24
0.1 Aggregated Data
Sadness Score
3 6 9 12 15 18 21 24
0.1 3 6 9 12 15 18 21 24
0.1
Joy Score
3 6 9 12 15 18 21 24
0.1 3 6 9 12 15 18 21 24
0.1
Hourly Intervals Anger Score
3 6 9 12 15 18 21 24
0.05
Hourly Intervals
3 6 9 12 15 18 21 24
0.05
bill@lampos.net Detecting Events and Patterns in the Social Web 23/34
23/34
Figure 10: Autocorrelation of circadian mood patterns based on hourly lags revealing periodicities
1 12 24 36 48 60 72 84 96 108 120 132 144 156 168 0.2 0.4
Autocorr.
(a) Fear
1 12 24 36 48 60 72 84 96 108 120 132 144 156 168 0.1 0.2 0.3 0.4
Autocorr.
(b) Sadness
1 12 24 36 48 60 72 84 96 108 120 132 144 156 168 −0.2 0.2 0.4
Autocorr.
(c) Joy
1 12 24 36 48 60 72 84 96 108 120 132 144 156 168 0.1 0.2 0.3
Autocorr.
(d) Anger
bill@lampos.net Detecting Events and Patterns in the Social Web 24/34
24/34
Figure 11: Daily time series for the mood of Joy based on Twitter content geo-located in the UK , e d by st is.
ied d ying location s,
Jul 09 Jan 10 Jul 10 Jan 11 Jul 11 Jan 12 −2 2 4 6 8 10 933 Day Time Series for Joy in Twitter Content Date Normalised Emotional Valence
* RIOTS * CUTS * XMAS * XMAS * XMAS * roy.wed. * halloween * halloween * halloween * valentine * valentine * easter * easter
raw joy signal 14−day smoothed joy
(Lansdall, Lampos and Cristianini, 2012a&b)
bill@lampos.net Detecting Events and Patterns in the Social Web 25/34
25/34
Figure 12: Daily time series for the mood of Anger based on Twitter content geo-located in the UK
Jul 09 Jan 10 Jul 10 Jan 11 Jul 11 Jan 12 −4 −3 −2 −1 1 2 3 4 5 933 Day Time Series for Anger in Twitter Content Date Normalised Emotional Valence
* RIOTS * CUTS * XMAS * XMAS * XMAS * roy.wed. * halloween * halloween * halloween * valentine * valentine * easter * easter
raw anger signal 14−day smoothed anger
(Lansdall, Lampos and Cristianini, 2012a&b)
bill@lampos.net Detecting Events and Patterns in the Social Web 26/34
26/34
Figure 13: Change point detection using a 100-day moving window
Jul 09 Jan 10 Jul 10 Jan 11 Jul 11 Jan 12 −1 −0.5 0.5 1 1.5 Date Difference in mean Anger Fear Date of Budget Cuts Date of Riots
(Lansdall, Lampos and Cristianini, 2012a)
bill@lampos.net Detecting Events and Patterns in the Social Web 27/34
27/34
Figure 14: Projections of 4-dimensional mood signals on their top-2 principal
components (based on 2011 Twitter content)
−1.5 −1 −0.5 0.5 1 −0.5 −0.4 −0.3 −0.2 −0.1 0.1 0.2 0.3 0.4 Saturday Sunday Monday Tuesday Wednesday Thursday Friday 1st Principal Component 2nd Principal Component Days of the Week
(a) Days of the week (2011)
−8 −6 −4 −2 2 4 6 8 −2 2 4 6 8 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 5253 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 8687 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 1st Principal Component 2nd Principal Component Days in 2011
(b) Days of the year (2011) Days 1/45/358/365: New Year’s / Valentine’s / Christmas Eve / New Year’s Eve Days 122/204/221: O.B. Laden’s death / Winehouse’s death, Breivik / UK riots (Lampos, 2012a)
bill@lampos.net Detecting Events and Patterns in the Social Web 28/34
28/34
Figure 15: Mood of the Nation uses the content of Twitter to nowcast mood rates in several UK regions
(Lampos, 2012a)
bill@lampos.net Detecting Events and Patterns in the Social Web 29/34
29/34
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 59 60 61 62 63 64 65 66 67 68 20 25 30 35 40 45 50 55 Polls Voting Intention Percent CON Inferred LAB Inferred LIBDEM Inferred CON Poll LAB Poll LIBDEM Poll
(a) Inferences of voting intention polls prior to the UK 2010 General Election (b) Content similarity network
Figure 16: Further information extraction examples from Twitter content
(Lampos, 2012a & 2012b)
bill@lampos.net Detecting Events and Patterns in the Social Web 30/34
30/34
bill@lampos.net Detecting Events and Patterns in the Social Web 31/34
31/34
Currently participating in the TrendMiner EU-FP7 project. How user-generated web content can be used to... ⊸ model political opinion ⊸ infer voting intention polls, election/referendum outcome ⊸ nowcast/predict financial indicators
bill@lampos.net Detecting Events and Patterns in the Social Web 32/34
32/34
Download the slides from http://goo.gl/F1G7a
bill@lampos.net Detecting Events and Patterns in the Social Web 33/34
33/34
1.
Unintended Consequences. Journal of Computer-Mediated Communication 15, pp. 83–108, 2009. 2.
3(4), n. 72, 2012. 3.
B, 58(1), pp. 267–288, 1996. 4.
407–499, 2004. 5. C.D. Manning, P. Raghavan and H. Schütze. Introduction to Information Retrieval. Cambridge University Press,
6. P.L. Bartlett, S. Mendelson and J. Neeman. L1-regularized linear regression: persistence and oracle inequalities. Probability Theory and Related Fields, pp. 1–32, 2011. 7. M.F. Porter. An algorithm for suffix stripping. Program 14(3), pp. 130–137, 1980. 8.
9.
PKDD ’10, pp. 599–602, 2010. 10.
Proceedings of WWW ’12, pp. 1221–1226, 2012.(a) 11.
26–28, 2012.(b) 12.
Learning Methods. PhD Thesis, University of Bristol, p. 243, 2012.(a) 13.
CoRR, 2012.(b)
bill@lampos.net Detecting Events and Patterns in the Social Web 34/34
34/34