## 6 Opinion Event Detection in the Social Web
### Implementation
#### 6.3.2 Opinion Event Extraction  
An opinion event is for us a period of time where there is a sudden and significant change in either the number or the value of opinions expressed about an entity. We can therefore use burst detection algorithms to find the time span of an event. A burst detection algorithm takes as input a list of values \([v_{1},v_{2},\ldots,v_{n}]\), where each value \(v_{i}\) represents a time period \(i\) of fixed size and returns the time periods that differ significantly from their context.  
There are several possible burst detection algorithms. For our experiments we used a variant of [PERSON]'s method [42]. We chose this algorithm because it is less sensitive to noise in the input value, and therefore less prone to split continuous events into multiple parts than other, threshold-based, methods. [PERSON]'s algorithm models a stream as being produced by a probability distribution that has multiple states. Each state corresponds to a specific output frequency. The states are arranged as a sequence such that low output frequencies correspond to small state indices and high output frequencies to large ones. Each state transition is associated with a cost. Using dynamic programming, the burst detector finds an optimal state sequence that balances the difference of the value \(v_{i}\) and the expected value of the state at index \(i\) against the cost of state transition. Bursts correspond to the indices where the optimal state sequence has a state other than the base state.  
We adapted [PERSON]'s algorithm in two ways. First, the algorithm is designed only for frequency values. In our implementation we introduce states that are shifts by a multiple of the standard deviation of the input data. This allows us to find bursts in any real-valued time series. Second, the algorithm can only detect bursts corresponding to an increase, as it only models states where the value is above average. We introduce additional burst states that correspond to values below average and are thus also able to find bursts corresponding to a decrease, _i.e._, periods where the value is significantly below average. The latter modification is especially useful for real-valued time series such as the series of the average opinion.  
To detect events, we run the modified burst detection algorithm on each of the following 5 time series:  
* average opinion: the average opinion per bin;* frequency: the total number of opinions per bin;
* positive opinions: the number of negative opinions per bin;
* subjectivity: the average subjectivity of a bin as the average of the absolute value of the opinions.  
We assign event types based on the bursting time series and direction of burst (see Table 2). As the different time series are often correlated, we typically find similar bursts on more than one time series. We merge the resulting events when they overlap for at least \(\omega\,\%\) of their durations, by setting the time span of the final event as the union of the individual event's time spans. The final event also has multiple event types. In our experiments we chose \(\omega=25\,\%\).