{'fraction_non_alphanumeric': 0.03475720330445295, 'fraction_numerical': 0.01924239371347975, 'mean_word_length': 4.738150289017341, 'pattern_counts': {'":': 2, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Building Emotion Lexicon from Weblog Corpora

An emotion lexicon is an indispensable resource for emotion analysis. This paper aims to mine the relationships between words and emotions using weblog corpora. A collocation model is proposed to learn emotion lexicons from weblog articles. Emotion classification at sentence level is experimented by using the mined lexicons to demonstrate their usefulness.


Introduction
Weblog (blog) is one of the most widely used cybermedia in our internet lives that captures and shares moments of our day-to-day experiences, anytime and anywhere. Blogs are web sites that timestamp posts from an individual or a group of people, called bloggers. Bloggers may not follow formal writing styles to express emotional states. In some cases, they must post in pure text, so they add printable characters, such as ":-)" (happy) and ":-(" (sad), to express their feelings. In other cases, they type sentences with an internet messengerstyle interface, where they can attach a special set of graphic icons, or emoticons. Different kinds of emoticons are introduced into text expressions to convey bloggers' emotions.
Since thousands of blog articles are created everyday, emotional expressions can be collected to form a large-scale corpus which guides us to build vocabularies that are more emotionally expressive. Our approach can create an emotion lexicon free of laborious efforts of the experts who must be familiar with both linguistic and psychological knowledge.

Related Works
Some previous works considered emoticons from weblogs as categories for text classification. Mishne (2005), and  used emoticons as tags to train SVM (Cortes and Vapnik, 1995) classifiers at document or sentence level. In their studies, emoticons were taken as moods or emotion tags, and textual keywords were taken as features. Wu et al. (2006) proposed a sentencelevel emotion recognition method using dialogs as their corpus. "Happy, "Unhappy", or "Neutral" was assigned to each sentence as its emotion category. ) adopted Thayer's model (1989 to classify music emotions. Each music segment can be classified into four classes of moods. In sentiment analysis research, Read (2005) used emoticons in newsgroup articles to extract instances relevant for training polarity classifiers.

Training and Testing Blog Corpora
We select Yahoo! Kimo Blog 1 posts as our source of emotional expressions. Yahoo! Kimo Blog service has 40 emoticons which are shown in Table  1. When an editing article, a blogger can insert an emoticon by either choosing it or typing in the corresponding codes. However, not all articles contain emoticons. That is, users can decide whether to insert emoticons into articles/sentences or not. In this paper, we treat these icons as emotion categories and taggings on the corresponding text expressions.
The dataset we adopt consists of 5,422,420 blog articles published at Yahoo! Kimo Blog from January to July, 2006, spanning a period of 212 days. In total, 336,161 bloggers' articles were collected. Each blogger posts 16 articles on average.
We used the articles from January to June as the training set and the articles in July as the testing set. Table 2 shows the statistics of each set. On average, 14.10% of the articles contain emotion-tagged expressions. The average length of articles with tagged emotions, i.e., 272.58 characters, is shorter than that of articles without tagging, i.e., 465.37 characters. It seems that people tend to use emoticons to replace certain amount of text expressions to make their articles more succinct. Figure 1 shows the three phases for the construction and evaluation of emotion lexicons. In phase 1, 1,185,131 sentences containing only one emoticon are extracted to form a training set to build emotion lexicons. In phase 2, sentence-level emotion classifiers are constructed using the mined lexicons. In phase 3, a testing set consisting of 307,751 sentences is used to evaluate the classifiers.

Emotion Lexicon Construction
The blog corpus contains a collection of bloggers' emotional expressions which can be analyzed to construct an emotion lexicon consisting of words that collocate with emoticons. We adopt a variation of pointwise mutual information (Manning and Schütze, 1999) to measure the collocation strength co(e,w) between an emotion e and a word w:

w)=c(e,w)/N, P(e)=c(e)/N, P(w)=c(w)/N, c(e)
and c(w) are the total occurrences of emoticon e and word w in a tagged corpus, respectively, c(e,w) is total co-occurrences of e and w, and N denotes the total word occurrences.
A word entry of a lexicon may contain several emotion senses. They are ordered by the collocation strength co. Figure 2 shows two Chinese example words, " 哈 哈 " (ha1ha1) and " 可 惡 " (ke3wu4). The former collocates with "laughing" and "big grin" emoticons with collocation strength 25154.50 and 2667.11, respectively. Similarly, the latter collocates with "angry" and "phbbbbt". When all collocations (i.e., word-emotion pairs) are listed in a descending order of co, we can choose top n collocations to build an emotion lexicon. In this paper, two lexicons (Lexicons A and B) are extracted by setting n to 25k and 50k. Lexicon A contains 4,776 entries with 25,000 sense pairs and Lexicon B contains 11,243 entries and 50,000 sense pairs.

Emotion Classification
Suppose a sentence S to be classified consists of n emotion words. The emotion of S is derived by a mapping from a set of n emotion words to m emotion categories as follows:  For each emotion word ew i , we may find several emotion senses with the corresponding collocation strength co by looking up the lexicon. Three alternatives are proposed as follows to label a sentence S with an emotion: (a) Method 1 (1) Consider all senses of ew i as votes. Label S with the emotion that receives the most votes.
(2) If more than two emotions get the same number of votes, then label S with the emotion that has the maximum co.

(b) Method 2
Collect emotion senses from all ew i . Label S with the emotion that has the maximum co.

(c) Method 3
The same as Method 1 except that each ew i votes only one sense that has the maximum co. In past research, the approach used by  was based on the Thayer's model (1989), which divided emotions into 4 categories. In sentiment analysis research, such as Read's study (2006), a polarity classifier separated instances into positive and negative classes. In our experiments, we not only adopt fine-grain classification, but also coarse-grain classification. We first select 40 emoticons as a category set, and also adopt the Thayer's model to divide the emoticons into 4 quadrants of the emotion space. As shown in Figure 3, the top-right side collects the emotions that are more positive and energetic and the bottom-left side is more negative and silent. A polarity classi-fier uses the right side as positive and the left side as negative. Table 3 shows the performance under various combinations of lexicons, emotion categories and classification methods. "Hit #" stands for the number of correctly-answered instances. The baseline represents the precision of predicting the majority category, such as "happy" or "positive", as the answer. The baseline method's precision increases as the number of emotion classes decreases. The upper bound recall indicates the upper limit on the fraction of the 307,751 instances solvable by the corresponding method and thus reflects the limitation of the method. The closer a method's actual recall is to the upper bound recall, the better the method. For example, at most 40,855 instances (14.90%) can be answered using Method 1 in combination with Lexicon A. But the actual recall is 4.55% only, meaning that Method 1's recall is more than 10% behind its upper bound. Methods which have a larger set of candidate answers have higher upper bound recalls, because the probability that the correct answer is in their set of candidate answers is greater.

Evaluation
Experiment results show that all methods utilizing Lexicon A have performance figures lower than the baseline, so Lexicon A is not useful. In contrast, Lexicon B, which provides a larger collection of vocabularies and emotion senses, outperforms Lexicon A and the baseline. Although Method 3 has the smallest candidate answer set and thus has the smallest upper bound recall, it outperforms the other two methods in most cases. Method 2 achieves better precisions when using Thayer's emotion categories. Method 1 treats the vote to every sense equally. Hence, it loses some differentiation abilities. Method 1 performs the best in the first case (Lexicon A, 40 classes). We can also apply machine learning to the dataset to train a high-precision classification model. To experiment with this idea, we adopt LIBSVM (Fan et al., 2005) as the SVM kernel to deal with the binary polarity classification problem. The SVM classifier chooses top k (k = 25, 50, 75, and 100) emotion words as features. Since the SVM classifier uses a small feature set, there are testing instances which do not contain any features seen previously by the SVM classifier. To deal with this problem, we use the class prediction from Method 3 for any testing instances without any features that the SVM classifier can recognize. In Table 4, the SVM classifier employing 25 features has the highest precision. On the other hand, the SVM classifier employing 50 features has the highest F measure when used in conjunction with Method 3.

Conclusion and Future Work
Our methods for building an emotional lexicon utilize emoticons from blog articles collaboratively contributed by bloggers. Since thousands of blog articles are created everyday, we expect the set of emotional expressions to keep expanding. In the experiments, the method of employing each emotion word to vote only one emotion category achieves the best performance in both fine-grain and coarse-grain classification.