## 3 Our Approach
### Calculation of Violence Risk Score
#### 3.1.2 Extraction of Sentiment Words  
Firstly, we need to determine the words associated with emotional tendency in the microblog text. Because new expressions or words have been emerging on the Internet, the existing lexicon has to be continuously complemented. In this paper, we use two methods to extend the existing lexicon, i.e., manually annotating new sentiment words, and use semantic similarity to estimate sentiment polarity of sentiment words. Both these methods are detailed as follows:  
(1) Manually annotating new sentiment words: the sentiment words have two typical properties: polarity and strength. The sentiment vocabulary ontology provided by Dalian University of  
Figure 1: Calculation of comprehensive violence risk. Technology [25] includes 27,466 entries, in which each has a polarity value of 0, 1, or 2, representing neutral, positive, and negative, respectively, and each has one of five strength levels, i.e., 1, 3, 5, 7, 9 (the strength increases in this order). We utilize it as sentiment lexicon since it covers the majority of common expressive words. As a kind of social media, microblog text has informal and colloquial characteristics. The frequency of network terms is very high, and they play an important role in emotion detection, but these terms are not included in a typical sentiment lexicon. Thus, it is necessary to complement network words using a sentiment lexicon. In the \"wangci\" Website [26], there are popular network vocabularies and their explanation. In this paper, 494 items are manually annotated and added to our lexicon according to their polarity and strength. We set the strength value according to the same standard of sentiment ontology in [24]. (2) Semantic similarity: Some new words in a microblog may be excluded from the existing vocabulary ontology. We use a semantic similarity algorithm to extract the sentiment words. Only some specific parts of speech can be selected as sentiment words, we hence selected nouns, verbs, and adjectives for further analysis. Our semantic similarity algorithm refers to HowNet [27], which works well for measuring word similarity. It can be briefly described as follows: for two Chinese word items \(w_{1}\) and \(w_{2}\), if \(w_{1}\) has \(n\) senses (concepts): \(x_{1}\), \(x_{2}\),..., \(x_{n}\), and \(w_{2}\) has \(m\) senses: \(y_{1}\), \(y_{2}\),..., \(y_{m}\), the similarity between \(w_{1}\) and \(w_{2}\) is the maximum similarity of each sense pair, which can be formulated as:  
\[Sim(w_{1},w_{2})=\max_{i\in[1,n],i\in[1,m]}(Sim(x_{i},y_{j})) \tag{1}\]  
where the similarity of the two senses can be calculated as follows:  
\[Sim\Big{(}x_{i},y_{j}\Big{)}=\frac{\lambda}{\lambda+d(x_{1},y_{2})} \tag{2}\]  
In Equation (2), \(\lambda\) denotes a variable positive number, \(d(x_{1},y_{2})\) refers to the distance between the sense \(x_{1}\) and \(y_{2}\) in the hierarchal tree. The range of \(Sim(x_{1},y_{2})\) lies in [0, 1]. The value of \(\lambda\) and the computation of \(d(x_{1},y_{2})\) refers to HowNet. For any word, the emotional value can be calculated by the distance between the word and base words. The principle is to compute the distance between the specific word \(w\) and every word item in positive/negative base words, respectively. At last, we get the word sentiment value through the comparison between their mean values. This can be formulated as follows:  
\[S_{w}=\frac{1}{n}\sum_{i=1}^{n}Sim(w,p_{i})-\frac{1}{m}\sum_{j=1}^{m}Sim(w,n_ {j}) \tag{3}\]  
where \(p_{i}\) denotes one of the positive base words, \(n\) denotes the number of positive base words. Similarly, \(n_{j}\) denotes one of the negative base words, and \(m\) denotes the number of negative based words. Consequently, the calculated \(S_{w}\) falls into (\(-1\), \(1\)). Because words whose emotional value reaches a certain extent can be considered sentiment words, a threshold must be set to filter out those with a weak emotional value. Accordingly, we set a threshold \(T\) to determine whether or not it can be treated as a sentiment word.