scieee AI-readable full text Open interactive document viewer

Stock market sentiment lexicon acquisition using microblogging data and statistical measures

Oliveira, Nuno Miguel Rocha; Cortez, Paulo; Areal, Nelson

Abstract

Lexicon acquisition is a key issue for sentiment analysis. This paper presents a novel and fast approach for creating stock market lexicons. The approach is based on statistical measures applied over a vast set of labeled messages from StockTwits, which is a specialized stock market microblog. We compare three adaptations of statistical measures, such as pointwise mutual information (PMI), two new complementary statistics and the use of sentiment scores for affirmative and negated con- texts. Using StockTwits, we show that the new lexicons are competitive for measuring investor sentiment when compared with six popular lexicons. We also applied a lexicon to easily produce Twitter investor sentiment indicators and analyzed their correlation with survey sentiment indexes. The new microblogging indicators have a moderate correlation with popular Investors Intelligence (II) and American Association of Individual Investors (AAII) indicators. Thus, the new microblogging approach can be used alternatively to traditional survey indicators with advantages (e.g., cheaper creation, higher frequencies).

Full text

Stock market sentiment lexicon acquisition using microblogging data and statistical measures Nuno Oliveiraa,∗, Paulo Corteza, Nelson Arealb aALGORITMI Centre, Department of Information Systems, University of Minho, 4804-533 Guimar˜aes, Portugal bDepartment of Management, University of Minho, 4710-057 Braga, Portugal Abstract Lexicon acquisition is a key issue for sentiment analysis. This paper presents a novel and fast approach for creating stock market lexicons. The approach is based on statistical measures applied over a vast set of labeled messages from StockTwits, which is a specialized stock market microblog. We compare three adaptations of statistical measures, such as pointwise mutual information (PMI), two new complementary statistics and the use of sentiment scores for affirmative and negated contexts. Using StockTwits, we show that the new lexicons are competitive for measuring investor sentiment when compared with six popular lexicons. We also applied a lexicon to easily produce Twitter investor sentiment indicators and analyzed their correlation with survey sentiment indexes. The new microblogging indicators have a moderate correlation with popular Investors Intelligence (II) and American Association of Individual Investors (AAII) indicators. Thus, the new microblogging approach can be used alternatively to traditional survey indicators with advantages (e.g., cheaper creation, higher frequencies). Keywords: Sentiment analysis; Stock market; Microblogging data 1. Introduction Recently, social media (e.g., Twitter, Facebook, message boards) has enabled a burst of unstructured opinion content that is potentially valuable for diverse decision-making processes [1]. Due to the volume and velocity properties of social media data, human analysis is impracticable and thus sentiment analysis (SA) is used to automatically mine large amounts of opinionated contents in order to summarize the opinions [2]. Several SA approaches apply common supervised classifiers ∗Corresponding author at: R. das Lavouras, 29, 4505-462 Lob˜ao, Portugal. Tel:.+351936607860. Email addresses: [email protected] (Nuno Oliveira), [email protected] (Paulo Cortez), [email protected] (Nelson Areal) Preprint submitted to Elsevier February 1, 2016 such as Support Vector Machines [3], Naive Bayes [4] or ensembles [5, 6]. Yet, the utilization of sentiment lexicons allows unsupervised classification of text, relieving the need for arduous manual labeling of text. Moreover, sentiment lexicons permit the creation of important features for supervised SA [7]. The sentiment lexicon is a list of words with a sentiment value (e.g., positive, negative) and it is considered a key element for SA [8]. For example, the sentence “this car is great” can be easily detected as positive if the lexicon has a term “great” with a positive value. SA is being increasingly used to predict stock market variables [9, 10, 11, 12]. In particular, microblogging data are a useful source for supporting stock market decisions [13, 14]. Users post very frequently and data are readily available at low cost, allowing real-time assessment that can be exploited during the trading day. However, there has been little effort in producing lexicons adapted to the financial domain and microblogs. A financial lexicon was manually built by Loughran and McDonald [15] using text documents extracted from the U.S. Securities and Exchange Commission portal from 1994 to 2008. Mao et al. [16] proposed a procedure to automatically construct a Chinese financial lexicon by exploring a large news corpus classified as positive or negative according to the contemporaneous stock returns. Yet, these lexicons did not consider microblog messages, which is often informal and has character constraints. Furthermore, adopting a manual approach (e.g., [15]) is not feasible in practical terms given the huge effort required to label the large volumes of microblog texts. Moreover, the existing domain independent lexicons (e.g., [17, 18, 19]) may be ineffective for stock market contents. For instance, the word “explosive” is negative in most contexts but it may be positive in financial messages (e.g., “explosive rise”). In this work, we present a novel automated approach for the acquisition of microblog stock market lexicons. Our main contributions are: i) The adaptation of three statistical measures (e.g., pointwise mutual information) and creation of two new complementary statistics. These measures are applied in labeled messages of the StockTwits microblogging service to calculate a stock market sentiment score. To address negation more efficiently, sentiment scores are also created for affirmative and negated contexts. ii) The comparison of the resulting stock market lexicons created using the StockTwits test data with six large popular lexical resources: Harvard General Inquirer (GI) [17], opinion lexicon (OL) [2], Macquarie Semantic Orientation Lexicon (MSOL) [20], MPQA subjectivity lexicon (MPQA) [18], SentiWordNet (SWN) 3.0 [19] and financial sentiment dictionaries (FIN) [15]. 2 iii) The assessment of the information content of sentiment indicators produced with a created and a baseline lexicons using a different microblog data source (Twitter). The new Twitter sentiment indicators are correlated with two traditional survey sentiment indicators: Investors Intelligence (II) and American Association of Individual Investors (AAII). This paper is structured as follows. Section 2 shows related work. Section 3 presents the microblogging data, lexicon methods and sentiment indicators. Section 4 describes the experiments conducted and analyzes the obtained results. Finally, conclusions are drawn in Section 5. 2. Related Work The sentiment lexicon is considered a key element for SA [8]. The utilization of lexicons permits the execution of effective unsupervised approaches [21, 22] and provides high quality features for supervised SA [23, 7]. Moreover, lexicons can be applied to diverse tasks such as SA, opinion retrieval [24] or opinion question answering and summarization [25], and they can be applied to diverse domains such as stock markets [15], electronic products [2] or the movie industry [26]. The creation of opinion lexicons is an important topic that has been studied for some time under two main approaches: manual and automatic creation. Manual creation is the most labor intensive and expensive approach because it requires experts to manually classify the sentiment value of each term. MPQA subjectivity lexicons [18] and General Inquirer [17] are two important examples of this methodology. Automatic creation requires much less human effort and allows for the faster inclusion of a larger set of lexical items. However, this is often achieved at the expense of accuracy. There is substantial literature about the automatic construction of lexicons. Many of these studies apply text corpora for this procedure. Hatzivassiloglou and McKeown [27] extracted conjoined adjectives from a large Wall Street Journal corpus and produced a list of adjectives labeled as positive or negative. Using an initial set of adjectives with predetermined orientation labels, they developed a supervised learning algorithm to assign the sentiment polarity. First, they applied a log-linear regression model to determine if each pair of conjoined adjectives had the same or different orientations. Then, a clustering algorithm was used to divide the adjectives into two different positive and negative sets. Wiebe [28] extracted subjective adjectives from corpora by applying a method for clustering words based on distributional similarity [29] and another method to compute polarity and gradability [27]. Turney and Littman [21] tested two co-occurrence measures, Pointwise Mutual Information (PMI) and Latent Semantic Analysis (LSA), on the AltaVista 3 Advanced Search engine in order to assign a semantic orientation to each word. The most accurate approach calculated the PMI of each term with pre-classified positive and negative words. A term was considered positive if the sum of its PMI scores with positive words was greater than the total PMI score with negative words, and vice-versa. Qiu et al. [30] explored diverse syntactic relations between opinion words and targets to iteratively extract further opinion words and targets. An initial seed set of opinion words was expanded and opinion targets were collected by continuously identifying terms having those syntactic associations with already extracted terms. Kiritchenko et al. [3] generated lexicons from tweets containing specific hashtag words and emoticons. These symbols were used as signals of the message sentiment (positive or negative). The sentiment score of each term was calculated using the PMI measures with positive and negative messages. These authors also produced distinct scores for negated and non-negated segments to properly obtain the sentiment in these contexts. Lexical databases and thesaurus are also extensively applied in the creation of opinion lexicons. Kamps et al. [31] calculated the synonymy shortest path on the WordNet database (wordnet. princeton.edu) of adjectives to the words “good” and “bad” and determined their sentiment orientation based on these values. Kim and Hovy [32] created a system that automatically extracts holders and sentiment of each opinion about a given topic. This system includes a module for computing word sentiment. Synonymy and antonymy relations from WordNet are applied in this module in order to expand a small set of seed words and to calculate the strength of sentiment polarity. Esuli and Sebastiani [33] applied text classification techniques to the glosses of subjective words in order to determine their sentiment polarity. Mohammad et al. [20] produced a large lexicon using a set of affix patterns and the Macquarie thesaurus. The sentiment of every thesaurus paragraph was classified using a set of positive and negative words collected utilizing affix patterns. Then, each lexical item assumed the most common sentiment label of paragraphs containing the respective term. Baccianella et al. [19] produced the SentiWordNet lexicon by automatically calculating sentiment values to all WordNet synsets. First, these synsets were classified by a group of classifiers trained with pre-classified synsets. The different classification results were combined to generate a sentiment score to each synset. In a second phase, two iterative random-walk procedures were executed for the positivity and negativity values. These processes applied a graph with directed links from synsets included in glosses of other synsets. The random walk phase began with the values created in the previous step and finished when the processes had converged. Neviarouskaya et al. [34] created a lexicon by expanding an initial set of lexicon entries through synonymy, antonymy 4 and hyponymy relations, derivation and compounding. Other works explore both text corpora and lexical databases. Hu and Liu [2] utilized consumer reviews and Wordnet to select and classify opinion words associated to frequent product attributes. First, they extracted all adjectives included in the sentences of consumer reviews mentioning those product features. The sentiment orientation was assigned according to their semantic association in Wordnet with a seed list of words with known sentiment orientation. Each adjective assumed the same sentiment of synonyms or the inverse polarity of antonyms. The seed list was iteratively expanded with these newly classified words until no further words had antonyms or synonyms in the list. Takamura et al. [35] proposed the utilization of a spin model, where each word had a sentiment polarity (positive or negative), to produce an opinion lexicon. They created a lexical network based on the occurrence of terms in glosses of other terms, the synonymy, antonymy and hypernymy relations in thesaurus and some conjunctive expressions in corpus. Then, the mean-field method was applied on the network to determine the semantic orientations. Lu et al. [36] automatically generated a context-dependent sentiment lexicon by combining the utilization of domain independent lexicons, sentiment ratings of reviews, synonym and antonym relations in Wordnet and linguistic rules. The utilization of generic lexicons or lexicons associated to other domains may be ineffective to SA on stock market text because sentiment is sensitive to the domain [21]. For example, the verb “underestimate” has often a negative sentiment but an underestimated stock can constitute an opportunity to buy, thus denoting a positive value within the stock market domain. However, the creation of opinion lexicons for the financial domain has been scant. One of the most popular works in this context is by Loughran and McDonald [15], who manually created six word lists (i.e., positive, negative, litigious, uncertainty, modal strong and modal weak) from words occurring in at least 5% of a large collection of 10,000 documents between 1994 and 2008. Also in 2014, Mao et al. [16] presented a procedure to automatically produce a Chinese financial lexicon. A large Chinese news corpus was labeled according to the stock returns. Then, a set of seed words was selected based on the Document Frequency value with news associated with very high or very low returns. The lexicon was expanded by considering the statistical association with seed words and the economic significance of candidate terms. The final lexicon was obtained by an iterative optimization process. In summary, the majority of the studies applies text corpora (e.g., [27, 28, 2, 35, 30, 3, 16]) and/or existing lexical databases and thesaurus (e.g., [31, 32, 2, 33, 35, 26, 20, 19, 34, 37]). The 5 extraction of opinion words or targets are mainly based on syntactic relations (e.g., [27, 30]), part of speech (e.g., adjectives [27, 28, 2]), co-occurrence with terms (e.g., [2]) and semantic relations in WordNet (e.g., [32, 34]). The calculation of the sentiment polarity or score is mostly performed by statistical measures (e.g., PMI [21, 3]), text classification of glosses (e.g., [33, 20, 19]), semantic associations (e.g., sinonymy, antonymy relations in WordNet [31, 32, 2, 34]), syntactic relations (e.g., [30]) and clustering methods (e.g., [27, 28]). Only one study produced different sentiment scores for affirmative and negated contexts [3], although applied for generic Twitter messages and thus not specifically adjusted to the stock market domain, as performed in this paper. Some of these studies extract and classify opinions words simultaneously by iteratively expanding a pre-labeled seed list by semantic or syntactic relations (e.g., [2, 30]). The newly collected words assume the same or the opposite polarity of the associated term. Some of these approaches are ineffective for the creation of specialized domain lexicons. Methods based on WordNet or thesaurus produce domain independent lexicons, possibly unadjusted for stock market contents [38]. Therefore, the utilization of methods such as semantic relations in WordNet and text classification of glosses are unsatisfactory for our purpose. The usage of a small group of syntactic relations (e.g., conjunctions [27, 35]) does not allow for the selection of a large set of words. Moreover, extracting only adjectives (e.g., [2, 31, 27]) ignores terms with a strong sentiment, such as “love” and “hate” verbs. In addition, the expansion of a seed list of classified words (e.g., [30]) is less effective than the application of classified text corpora. Since we have classified data exclusively about stock markets, we do not need to restrict the collection to words co-occurring with specific terms (e.g., [2]) and clustering methods (e.g., [27, 28]) become less relevant to assign sentiment polarity. In this work, we propose a novel automated approach for the creation of microblog stock market lexicons. Three adaptations (e.g., PMI) and two new proposed statistics were applied in a large data set of classified data provided by a microblogging platform exclusively dedicated to stock markets (stocktwits.com). We believe this is the largest labeled data set used in the creation of stock market lexicons. Additionally, sentiment scores were created for affirmative and negated contexts in order to address negation properly. Within our knowledge, this work presents the first stock market lexicons with two different context scores for each entry. 6 3. Material and Methods 3.1. Microblogging Data Microblogging data are useful for the creation of investor sentiment indicators. The community of investors using these services is growing and becoming more representative. The character limit demands greater objectivity. Microblogging users usually react promptly to events, allowing a near real-time sentiment assessment. Data is quite vast and freely available allowing a more frequent production of indicators than traditional sources, such as extensive surveys. The selection of messages containing cashtags reduces the amount of irrelevant data and permits the creation of sentiment indicators related to particular stocks. A cashtag is composed by a ”$” character and a stock ticker (e.g., $AAPL) and it is usually applied in messages about that stock. In this work, we use StockTwits data to create stock market lexicons and Twitter data in the production of sentiment indicators that are used to correlate with traditional sentiment indicators. StockTwits is a microblogging service exclusively dedicated to stock market conversations (stocktwits.com) that has currently more than 300,000 users. StockTwits users can label their own text messages as “bullish” (optimistic opinion) or “bearish” (pessimistic view). Author supplied sentiment labels are already explored in SA on other social media (e.g., blogs [38]) and topics. In this paper, we explore these labeled messages, as kindly provided by StockTwits from June 2, 2010 to March 31, 2013, in a total of 350,000 posts1. We note that such dimension is significantly higher when compared with the majority of works on this topic. Twitter (twitter.com) is the most popular microblogging service. Unlike StockTwits, it is a generic platform. Yet, Twitter users also apply cashtags in stock market conversations. In the creation of microblogging sentiment indicators, we used Twitter for reasons of data availability. Using Twitter REST API (https://dev.twitter.com/docs/api) and the R language (or statistical environment), we collected all tweets containing cashtags of all stocks traded in US stock markets from 22nd of December 2012 to 27th of March 20152. 3.2. Baseline Lexicons For comparison purposes, we adopt six large and popular lexicons: 1The total number of StockTwits messages over the same period is nearly 6 millions. 2The total number of collected Twitter messages mentioning 3762 different cashtags is approximately 19 millions. 7 •GI [17] – comprises around 11,000 words (http://www.wjh.harvard.edu/~inquirer/spreadsheet_ guide.htm). In particular, we used all words of the “Positiv” and “Negativ” attributes. •OL [2] – contains nearly 6,000 positive and negative terms. The lexicon also contains common social media misspelled words (http://www.cs.uic.edu/~liub/FBS/opinion-lexicon-English. rar). •MSOL [20] – classifies more than 75,000 n-grams as positive or negative (http://saifmohammad. com/Lexicons/MSOL-June15-09.txt.zip). •MPQA [18] – with around 8,000 entries (http://mpqa.cs.pitt.edu/lexicons/subj_lexicon/). It contains a list of strong and weak subjective terms. We assigned half of the sentiment score (i.e., 0.5 or -0.5) to weaker terms. •SWN [19] – with continuous sentiment values to the nearly 117,000 synsets (i.e., group of words that are semantically equivalent in some context) of the WordNet lexical database (http: //sentiwordnet.isti.cnr.it/downloadFile.php). A word may have multiple scores, since it can belong to diverse synsets. To solve this issue, we averaged the positive and negative values for all (word, POS tag) pairs. •FIN [15] – contains word lists commonly applied in financial text documents (http://www3. nd.edu/~mcdonald/Word_Lists.html). We adopted the terms classified as negative (2349) and positive (354). 3.3. Lexicon Creation This work applies two different validation approaches. To build a single large lexicon and evaluate its performance, we adopt a holdout split method, where the first 75% StockTwits classified messages are used to create lexicons (training set) and the remaining (most recent) 25% posts are used for evaluation purposes (test set). To perform a robust comparison of the distinct lexicon creation methods, we adopt a realistic rolling window method [39], where the labeled data are split into 20 equally sized parts ordered by time. The first 2/3 messages (training set) of each data window is utilized to create lexicons and the last 1/3 (test set) are applied in the evaluation. After performing the data pre-processing tasks, we selected all items having a minimum number of occurrences in the training set (Omin). The removal of non-frequent items is a usual preprocessing task in the creation of lexicons (e.g., [30, 15, 3, 16]). This operation permits the elimination of many orthographic errors. Also, some statistical measures (e.g., PMI) are unsatisfactory estimators 8 of association for infrequent terms [3]. Since the dimension of training data sets for each evaluation procedure is very different, we defined a different minimum number of occurrences (Omin) for each evaluation scheme. The usage of different combinations of statistical measures on training data generates several lexicons. First, we produce three lexicons by applying adaptations of three known statistical measures (Term frequency-inverse document frequency (TF-IDF), Information Gain (IG) and Pointwise Mutual Information (PMI)) to calculate the sentiment score of each selected item. Then, we create three more versions of previous lexicons (i.e., a total of 12 lexicon versions) by utilizing two new complementary statistics (Pdays(l) and Massoc(l)). In order to refine the sentiment score, the value obtained by the latter measures is multiplied by the score produced by each adapted measure. Additionally, we tested the calculation of sentiment scores for affirmative and negated contexts. The previously described procedure is used for separate affirmative and negated training data. 3.3.1. Data Pre-Processing In order to prepare the microblogging data for the lexicon creation, we performed various preprocessing tasks using the R tool [40]: •substitute all cashtags by a unique term, thus avoiding cashtags to gain a sentiment value related with a particular time period; •replace numbers by a single tag, since the whole set of distinct numbers is too vast; •for privacy reasons, all mentions and URL addresses were normalized to “@user” and “URL”, respectively; •exclude messages composed only by cashtags, url links, mentions or punctuation (7,176 messages were removed). Next, we adopted the Stanford CoreNLP tool [41] to execute common natural language processing operations, such as tokenization, part of speech (POS) tagging and lemmatization. The holdout split method uses a large training set with 250,000 posts and thousands of distinct terms. Thus, for this evaluation scheme we included only terms with more than Omin = 10 occurrences in the training data set and excluded all punctuation, resulting in approximately 7,000 unigrams and 27,000 bigrams analyzed. The rolling window method creates lexicons in each one of the 20 data partitions. In this validation scheme, the training set of the partitions is much 9 •TWTSML uses the selected stock market lexicon (SML), i.e., the PMIBiScr lexicon created using 75% of StockTwits data (Section 3). Affirmative or negated context scores are applied in the respective segments. •TWTSWN applies the SWN lexicon (the selected baseline lexicon, Section 3). Six different values are computed for each time period: TWTSMLbull,t = SMLbull,t/(SMLbull,t + SMLbear,t) (14) TWTSMLbear,t = SMLbear,t/(SMLbull,t + SMLbear,t) (15) TWTSMLspread,t = TWTSMLbull,t −TWTSMLbear,t (16) TWTSWNbull,t = SWNbull,t/(SWNbull,t + SWNbear,t) (17) TWTSWNbear,t = SWNbear,t/(SWNbull,t + SWNbear,t) (18) TWTSWNspread,t = TWTSWNbull,t −TWTSWNbear,t (19) where: •SMLbull,t corresponds to the sum of all positive SA scores (i.e., greater than zero) using SML (i.e., PMIBiScr lexicon) on all tweets from a given ttime period. •SMLbear,t corresponds to absolute value of the sum of all negative SA scores (i.e., less than zero) using SML on all tweets for time t. •SWNbull,t corresponds to the sum of all positive SA scores using the selected baseline lexicon (i.e., SWN lexicon) on all tweets for time t. •SWNbear,t corresponds to absolute value of the sum of all negative SA scores using the SWN lexicon on all tweets for time t. We used survey and Twitter indicators from February 1, 2013 to March 27, 2015. This time period is subsequent to the applied in the creation of the selected stock market lexicon. Since both AAII and II use ratios, we also created bullish and bearish ratios. We decided to use SA scores instead of the number of bullish or bearish messages because we consider that they better indicate the sentiment strength. Additionally, we calculated the bull-bear spread (TWTSMLspread, TWTSWNspread), a common measure of sentiment (e.g., [51, 52]). Different Twitter sentiment indicators (i.e., TWTSMLbull, TWTSMLbear, TWTSMLspread, TWTSWNbull, TWTSWNbear, TWTSWNspread,) were computed for each survey sentiment indicator correspond- 16 ing to their time periods. Each Twitter sentiment indicator is correlated to their AAII and II counterparts (e.g., TWTSMLbull with AAIIbull, TWTSWNspread with IIspread). 4. Results 4.1. Lexicon Evaluation In this section we present the SA results for the tested lexicons. We start by analyzing the use of the proposed statistical measures in the computation of a unique sentiment score for each item. We experimented four different scores for the three main statistical measures (PMI, TFIDF, IG): •Scr corresponds to the value calculated by the main statistical measure (SPMI,STFIDF,SIG); •Assoc is the product of Scr and Massoc; •Days is the product of Scr and Pdays; •All is the product of Scr,Massoc and Pdays. Table 2 shows all classification metrics for the created lexicons using a unique context score and table 3 indicates which lexicons obtain statistically significant higher CC1 and FAvg values compared with other lexicons according to the paired Student’s t-test and the Wilcoxon signed rank test. The alternative hypothesis of these tests is that the lexicon in the row has higher results than the lexicon in the column. The best overall results (e.g., highest CC1, CC2 and FAvg values) are obtained by the PMIAll method, which delivers statistically significant higher CC1 and FAvg values than all other lexicons. The complementary metrics proved to be useful because they improved the evaluation results for all main statistical measures. Every lexicon applying Massoc or Pdays metrics obtain statistically significant higher CC1 and FAvg values than their Scr counterparts (e.g., PMIAssoc, TFIDFAll and IGDays are higher than PMIScr, TFIDFScr and IGScr, respectively). The Massoc measure permits slight gains in both F1Bull and F1Bear scores. The Pdays metric is able to substantially improve F1Bull values while maintaining the F1Bear very similar. Next, we compare the selected PMIAll with diverse reference lexicons. The SA results obtained by these lexical resources are presented in Tables 4 and 5. PMIAll based lexicons achieve the best results for all evaluation metrics by a significant margin. For example, sentiment classification using this lexicon obtains a 18.2 (FAvg), 18.7 (CC2) and 21.4 (CC1) percentage point difference in the holdout split scheme when compared with the baseline resource that has the highest overall results 17 Table 2: Classification results for the created lexicons with unique context score (in %, best values in bold) Lexicon CC1 Unc CC2 PBull RBull F1Bull PBear RBear F1Bear FAvg Panel A: Evaluation results of holdout split method PMIScr 75.2 0.5 75.5 88.6 76.5 82.1 51.9 71.5 60.1 71.1 PMIAssoc 75.6 0.5 76.0 88.5 77.4 82.6 52.6 70.6 60.3 71.4 PMIDays 78.8 0.5 79.1 86.0 85.4 85.7 59.5 59.6 59.6 72.6 PMIAll 78.8 0.5 79.2 86.0 85.5 85.8 59.7 59.5 59.6 72.7 TFIDFScr 74.3 0.5 74.7 88.6 75.1 81.3 50.6 71.9 59.4 70.4 TFIDFAssoc 74.8 0.5 75.1 88.4 76.2 81.8 51.3 70.8 59.5 70.7 TFIDFDays 78.4 0.5 78.7 85.6 85.4 85.5 58.8 58.3 58.6 72 TFIDFAll 78.5 0.5 78.8 85.5 85.5 85.5 59.1 58.1 58.6 72.1 IGScr 70.5 0.5 70.8 89.4 68.5 77.5 46.1 76.3 57.4 67.5 IGAssoc 71.6 0.5 71.9 89.5 70.1 78.6 47.3 75.9 58.3 68.4 IGDays 76.0 0.5 76.4 87.2 79.5 83.2 53.4 65.9 59.0 71.1 IGAll 76.4 0.5 76.7 86.9 80.4 83.5 54.1 64.9 59.0 71.3 Panel B: Average evaluation results of rolling window method PMIScr 71.1 0.5 71.4 90.0 69.0 78.0 45.7 77.0 56.9 67.4 PMIAssoc 71.5 0.5 71.9 89.9 69.8 78.4 46.2 76.7 57.3 67.9 PMIDays 77.3 0.5 77.7 87.4 81.5 84.3 54.1 64.4 58.5 71.4 PMIAll 77.5 0.5 77.8 87.3 81.7 84.4 54.6 64.2 58.7 71.5 TFIDFScr 71.6 0.5 71.9 89.1 70.8 78.8 45.6 73.4 55.8 67.3 TFIDFAssoc 72.1 0.5 72.5 89.0 71.7 79.3 46.3 73.1 56.3 67.8 TFIDFDays 77.1 0.5 77.5 86.4 82.4 84.3 54.0 60.5 56.6 70.5 TFIDFAll 77.3 0.5 77.7 86.5 82.7 84.5 54.5 60.4 56.9 70.7 IGScr 67.4 0.5 67.7 90.5 63.8 74.2 42.7 78.7 54.3 64.2 IGAssoc 68.0 0.5 68.3 90.5 64.7 74.9 43.2 78.5 54.6 64.8 IGDays 75.2 0.5 75.5 88.4 77.4 82.3 50.6 68.6 57.3 69.8 IGAll 75.5 0.5 75.8 88.4 77.8 82.6 51.0 68.5 57.6 70.1 18 Table 3: Paired Student’s t-test and the Wilcoxon signed rank test for pairwise comparison of lexicons using unique context scores. The following symbols denote significance at the 5% level: a - paired Student’s t t-test for FAvg; b - Wilcoxon signed rank test for FAvg; c - paired Student’s t t-test for CC1; d - Wilcoxon signed rank test for CC1. Alternative hypothesis: lexicon in the row has higher values than the lexicon in the column PMIScr PMIAssoc PMIDays PMIAll TFIDFScr TFIDFAssoc TFIDFDays TFIDFAll IGScr IGAssoc IGDays IGAll PMIScr — abcd abcd PMIAssoc abcd — abcd abcd PMIDays abcd abcd — abcd abcd ab ab abcd abcd abcd abcd PMIAll abcd abcd abcd — abcd abcd ab ab abcd abcd abcd abcd TFIDFScr — abcd abcd TFIDFAssoc cd abcd — abcd abcd TFIDFDays abcd abcd abcd abcd — abcd abcd acd cd TFIDFAll abcd abcd abcd abcd abcd — abcd abcd abcd acd IGScr — IGAssoc abcd — IGDays abcd abcd abcd abcd abcd abcd — IGAll abcd abcd abcd abcd abcd abcd abcd — (i.e., SWN). All these improvements are statistically significant. In addition, the approximately 20,000 lexical entries that belong to the lexicons created in this work are included in more messages (only 0.5% of the posts are not classified). In contrast, the generic SWN lexicon, which contains a larger number of lexical items (117,000), presents a higher unclassification rate (5.1%). The financial lexicon (FIN) achieves the lowest FAvg, CC1 and CC2 values, despite having the second highest PBull. The poorer FIN unclassified message performance (66%) confirms that there is a considerable difference between the lexical terms extracted from financial text documents and StockTwit messages. In effect, there are several popular StockTwits terms, such as “bearish”, “bullish”, “breakout”, “put” and “short”, that are not present in FIN. Since “bullish” and “bearish” are distinctive terms of stock market terminology, we verified their presence and classification in baseline lexicons. FIN and GI lexicons do not contain these terms and MSOL lexicon incorrectly classifies ”bullish” as negative. The remaining lexicons assign the correct classification to these words. Next, we analyze the differences between the selected large lexicon (PMIAll, 20550 items) and baseline lexicons (SWN, 117,000 entries). The lexicons are quite distinct, since only 2695 lexical terms (13% of PMIAll) belong to both lexicons. Indeed, the presence of diverse stock market terms in generic opinion lexicons is unlikely [38]. Also, 42% of these common terms (1121) have different sentiment polarities, as shown in Table 6. In particular, Table 6 presents examples of terms associated with: stock price changes (e.g., dip, downside, explosive, outperform, rip, sink); 19 Table 4: Classification results for the selected lexicon creation method and baseline lexicons (in %, best values in bold) Lexicon CC1 Unc CC2 PBull RBull F1Bull PBear RBear F1Bear FAvg Panel A: Evaluation results of holdout split method PMIAll 78.8 0.5 79.2 86.0 85.5 85.8 59.7 59.5 59.6 72.7 FIN 16.8 66.0 49.3 83.5 13.9 23.8 34.3 25.1 29.0 26.4 GI 37.7 25.8 50.8 82.5 36.2 50.3 37.5 42.1 39.7 45.0 MSOL 53.4 1.8 54.3 79.1 58.6 67.3 33.9 38.2 35.9 51.6 MPQA 36.9 37.5 59.0 80.6 40.6 54.0 34.3 26.3 29.8 41.9 OL 31.8 43.0 55.9 82.6 32.7 46.8 37.7 29.4 33.1 39.9 SWN 57.4 5.1 60.5 79.9 59.7 68.3 34.1 50.7 40.7 54.5 Panel B: Average evaluation results of rolling window method PMIAll 77.5 0.5 77.8 87.3 81.7 84.4 54.6 64.2 58.7 71.5 FIN 17.3 63.7 47.8 84.2 13.9 23.8 32.8 27.4 29.3 26.5 GI 37.4 25.8 50.4 82.6 36.1 50.2 35.8 41.1 37.8 44.0 MSOL 52.3 1.2 53.0 80.2 55.8 65.6 32.5 41.9 36.1 50.8 MPQA 39.1 34.7 59.8 81.3 42.6 55.8 35.2 28.4 31.1 43.5 OL 34.1 39.5 56.3 83.5 34.6 48.9 38.2 32.3 34.7 41.8 SWN 58.9 4.4 61.6 80.6 61.4 69.7 33.8 51.1 40.4 55.0 Table 5: Paired Student’s t-test and the Wilcoxon signed rank test for pairwise comparison of PMIAll method with baseline lexicons. The following symbols denote significance at the 5% level: a - paired Student’s t t-test for FAvg; b - Wilcoxon signed rank test for FAvg; c - paired Student’s t t-test for CC1; d - Wilcoxon signed rank test for CC1. Alternative hypothesis: lexicon in the row has higher values than the lexicon in the column FIN GI MSOL MPQA OL SWN PMIAll abcd abcd abcd abcd abcd abcd stock expectations (e.g., overvalue, underestimate); and stock operations (e.g., long). Under non financial contexts, these terms can suggest different sentiment values. For example, “underestimate” is in general a negative verb but when related with stocks it can suggest an opportunity to buy. These differences highlight the importance of producing specialized stock market lexicons. For demonstration purposes, Figure 1 plots a word cloud of the most interesting PMIAll bullish and bearish terms. Diverse terms with different sentiment polarity or absent from SWN stand out in this figure. Table 6: Examples of lexical terms with different sentiment value in PMIAll and SWN Item POS tag PMIAll SWN Item POS tag PMIAll SWN careful adjective negative positive overvalue verb negative positive dip noun positive negative outperform verb positive negative rip verb positive negative downside noun negative positive sink verb negative positive explosive adjective positive negative long adjective positive negative underestimate verb positive negative 20 Bullish Bearish short breakout strong lower b/o sell clear top poise eye wave cup rest ^ breakdown negative winner abv ugly ep distribution ~coil eurusd clearing nce ave downward failure bto im judge death struggle wrap toast mover downtrend fork jury rocket jj eurozone nasty rock power shooting vascepa fert vringo tp warning south undervalue amrn north outperform nymo sub ruling warn reit slide vulnerable royalty bio tza ouch anchor constructive operational collapse pipeline joe rising advancer zte hype perk gann agricole ath b/out dive plunge iwm es_f award rollover arna shorter ramp lovaza harmonic lookin ss bearishbuck ftd partnership aca cnh overvalue toppy drag buyable french spanish greek reshort agreement recession pacer fading rolling carrier hep wfmus unable aussie weaker midnight puke bullflag ymb grant vaccine dark cap hagopian b/d af dan scoop shortable unemployment slip spectrum italy gbpusd fellow ino shortie m−a verizon prop lawyer xmas zynga warrant uspto lach lang sovereign lookout w/handle ominous mini pathetic mjna soil djium italian spank deflation morgan skyrocket double−bottom allowance victory pill azn beleive liz ree fry basf ctix consistently liftoff cheapie fave pre−order dea breakeven turd tumble kijun−sen europe attorney jz deficit umlp uglier bearflag mbus overweight briefing zigzag violation weakest sellstop snda cup−n−handle haul overreaction thanx lousy uvxy shrink breed kerx epa gium ralph bearishness tanking groupon fxy unsustainable exclusivity lng derivative crb yo b.s. timber hungry complacency acad jackson nhod crow signal−below aman amb belviq highs/up luke sectorsurfer softly deteriorate .:) callz fusion inovio misek month−relative take−profit fugly capacity cup−handle sf cyclical hopium stan andora csdb clever naysayer reduce−it topic freefall abyss meg titanic woodsh cyprus lmlp appa arena cheapy docket informative scramble therapy weakening bum b−mod gsk juror sierra cure carnage eurchf imf overprice tranche cpc risk−off util re−short swap toxic rounded statin stunningly bait rba euraud hesitation Figure 1: Bullish and bearish word cloud for a stock market lexicon (PMIAll). The utility of affirmative and negated context scores is assessed by comparing PMIAll, TFIDFAll and IGAll with the equivalent lexicons containing affirmative and negated context scores (PMIBiScr, TFIDFBiScr, IGBiScr). Thus, all sentiment scores apply the complementary metrics (Massoc and Pdays). Tables 7 and 8 show the evaluation results. Table 7: Classification results for unique and dual context scores (in %, best values in bold) Lexicon CC1 Unc CC2 PBull RBull F1Bull PBear RBear F1Bear FAvg Panel A: Evaluation results of holdout split method PMIAll 78.8 0.5 79.2 86.0 85.5 85.8 59.7 59.5 59.6 72.7 TFIDFAll 78.5 0.5 78.8 85.5 85.5 85.5 59.1 58.1 58.6 72.1 IGAll 76.4 0.5 76.7 86.9 80.4 83.5 54.1 64.9 59.0 71.3 PMIBiScr 79.0 0.5 79.3 86.2 85.4 85.8 59.8 60.3 60.1 73.0 TFIDFBiScr 78.5 0.5 78.9 86.0 85.1 85.5 59.0 59.6 59.3 72.4 IGBiScr 76.7 0.5 77.0 87.0 80.8 83.8 54.7 64.8 59.3 71.5 Panel B: Average evaluation results of rolling window method PMIAll 77.5 0.5 77.8 87.3 81.7 84.4 54.6 64.2 58.7 71.5 TFIDFAll 77.3 0.5 77.7 86.5 82.7 84.5 54.5 60.4 56.9 70.7 IGAll 75.5 0.5 75.8 88.4 77.8 82.6 51.0 68.5 57.6 70.1 PMIBiScr 78.3 0.5 78.7 86.4 84.2 85.2 56.8 60.0 58.1 71.7 TFIDFBiScr 77.3 0.5 77.7 86.5 82.6 84.4 54.4 60.7 57.0 70.7 IGBiScr 75.6 0.5 76.0 88.6 77.8 82.7 51.2 69.2 58.0 70.3 The application of affirmative and negated context scores appears to be beneficial. Despite the reduced difference, lexicons having two context scores improve or maintain almost all evaluation results compared to the unique score counterparts. IGBiScr obtains statistically significant higher CC1 and FAvg values than IGAll and PMIBiScr produces statistically significant higher CC1 values 21 Table 8: Paired Student’s t-test and the Wilcoxon signed rank test for pairwise comparison of lexicons using unique and two context scores. The following symbols denote significance at the 5% level: a - paired Student’s t t-test for FAvg; b - Wilcoxon signed rank test for FAvg; c - paired Student’s t t-test for CC1; d - Wilcoxon signed rank test for CC1. Alternative hypothesis: lexicon in the row has higher values than the lexicon in the column PMIAll TFIDFAll IGAll PMIBiScr TFIDFBiScr IGBiScr PMIAll — ab abcd ab abcd TFIDFAll — acd cd IGAll — PMIBiScr cd abcd abcd — abcd abcd TFIDFBiScr acd — cd IGBiScr abcd — than PMIAll. Moreover, PMIBiScr lexicon has statistically significant higher CC1 and FAvg values than all IG and TFIDF lexicons. Figure 2 shows the sentiment scores of all PMIBiScr items for both contexts. We can observe that the sentiment reversion in negation is not always appropriate. Indeed, only 41% have their sentiment orientation modified in negated contexts. Moreover, many items have much stronger sentiment value in negated contexts than in affirmative contexts and vice-versa. For example, the term bearish has a -6.634 score in affirmative contexts and just - 0.794 in negated contexts. For instance, saying “not bearish” does not signify the same as being bullish. Usually it just means that the opinion is not pessimistic. In the opposite situation, bailout has -5.392 points for negated contexts and only -0.657 for affirmative segments. The refusal of a bailout may imply the business downfall while its application may not necessarily mean a successful future. Negation handling is not a straightforward procedure, it may vary according to each term. Thus, the use of two context scores may be very useful in this matter. The PMIBiScr lexicon created using the first 75% labeled messages is available at https://github.com/nunomroliveira/stock_ market_lexicon. 4.2. Correlation with Survey Sentiment Indicators To evaluate the relevance of microblogging sentiment indicators created using the stock market lexicon, we assess the association between Twitter sentiment indicators and two popular survey sentiment indicators: AAII and II. A strong correlation may indicate that the microblogging sentiment indicator can be an acceptable alternative or proxy. The correlation calculation uses 112 observations for AAII and 110 observations for II. Table 9 presents the respective Pearson’s correlation values. The obtained results show that Twitter sentiment indicators have a statistical significant moderate correlation with diverse survey sentiment values. Indeed, only the bullish value of AAII is poorly correlated with both Twitter sentiment indicators. II indicators present higher correlation 22 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ● ● ● ●● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● −6 −4 −2 0 2 4 6 −4 −2 0 2 4 Affirmative Context Score Negated Context Score Figure 2: Distribution of sentiment scores for affirmative and negated contexts Table 9: Pearson’s correlation values of Twitter sentiment indicators with survey sentiment indicators (?– p-value <0.01, – p-value <0.05, best correlation values for each survey sentiment value in bold) Pair Correlation Pair Correlation (TWTSMLbear, AAIIbear)0.489?(TWTSWNbear, AAIIbear) 0.436? (TWTSMLbull, AAIIbull)0.233(TWTSWNbull, AAIIbull) 0.220 (TWTSMLspread, AAIIspread)0.376?(TWTSWNspread, AAIIspread) 0.342? (TWTSMLbear, IIbear) 0.540?(TWTSWNbear, IIbear)0.628? (TWTSMLbull, IIbull)0.533?(TWTSWNbull, IIbull) 0.445? (TWTSMLspread, IIspread)0.585?(TWTSWNspread, IIspread) 0.551? values than AAII, so it may indicate that Twitter users posting about stock market are informed traders because II is more associated to professional investors than AAII [51]. Moreover, sentiment indicators produced with the selected stock market lexicon (SML, i.e., PMIBiScr) are more correlated to almost all survey sentiment values than indicators created with the selected baseline lexicon (i.e., SWN). Only IIbear is less correlated with TWTSML values than with TWTSWN values. Sentiment indicators created using automated computational methods have various advantages regarding the traditional sentiment indicators produced from surveys. For instance, the creation of these sentiment indicators is faster and cheaper, permits higher frequencies (e.g., daily) and may be targeted to a more restricted set of stocks (e.g., stock market indices or individual stocks). Therefore, the application of SA in microblogging data may constitute a valuable alternative to 23 the creation of investor sentiment indicators. Additionally, the utilization of stock market lexicons allows an easy and fast unsupervised production of these indicators. 5. Conclusions With the expansion of social media (e.g., Twitter, message boards), the interest in sentiment analysis (SA) as increased, allowing the summary of opinions from large amounts of opinionated messages and thus support decision-making in several domains, including stock markets. A sentiment lexicon is a crucial resource for SA, enabling an easy and fast unsupervised SA and avoiding the expensive and arduous task of manually labeling data. Moreover, opinion lexicons permit the creation of very informative features for supervised SA. However, there are very few financial lexicons (e.g., [15, 16]) and the existing domain independent lexicons (e.g., [17, 18, 19]) may not be adjusted to the stock market domain. In this paper, we propose an automated and fast approach to create stock market lexicons for microbloging messages. We employed a large labeled data set of StockTwits messages and tested three adaptations and two novel statistical measures to calculate the sentiment score. Also, we suggest the use of sentiment scores for affirmative and negated contexts in order to improve the difficult task of negation processing. The results on the test data confirmed that these newly created lexicons substantially increase the SA when compared with six reference lexicons. The improvements in evaluation metrics obtained by the created lexicons are statistically significant. Furthermore, the use of the proposed complementary metrics proved to be useful. Lexicons applying any of these measures obtain statistically higher evaluation results in SA than their counterparts that do not use the complementary metrics. Moreover, the utilization of affirmative and negated context scores appears to be beneficial. Lexicons applying these measures improve or maintain almost all evaluation results compared to their counterparts. Some of these improvements are statistically significant. A substantial contribution of this work is to make publicly available a large stock market lexicon with context scores. This is accessable at: https://github.com/nunomroliveira/stock_market_lexicon. Also in this work, we selected a stock market lexicon (SML, i.e., PMIBiScr) and a baseline lexicon (SWN) to easily generate investor sentiment indicators from Twitter messages holding cashtags of stocks traded in US markets. Twitter based sentiment indicators showed a significant moderate Pearson’s correlation with the widely applied AAII and II survey sentiment indicators. Therefore, the Twitter based sentiment indicator can be used as an acceptable proxy for survey sentiment indicators. Moreover, the sentiment indicators created with the proposed lexicon showed higher 24 correlations values than indicators produced with the baseline lexicon in five of the six analyzed survey indicators. A microblogging sentiment indicator presents several advantages when compared with survey sentiment indicators: it is faster and cheaper to produce, it allows higher frequencies (e.g., daily) and it can be adjusted to both stock market indices and individual stocks. The proposed procedure allows the fast and effortless creation of a lexicon properly adapted to stock market contents. This lexicon may permit an easy and effective unsupervised SA related to the stock market domain, such as the creation of investor sentiment indicators. However, this process requires labeled stock market documents and such data sets are in short supply. Our results suggest that the proposed microblogging sentiment lexicon approach might be a useful source of information for stock market participants, and this merits future research. For instance, a collective intelligence approach can be used to more easily assign sentiments to unlabeled text and identify stock market terms, thus widening the applicability of the proposed procedure to other stock market message sources (e.g., Twitter) and producing more accurate and comprehensive lexicons. Active learning algorithms may complement this approach by automatically selecting a reduced but more relevant set of text messages for human classification, thus reducing the manual labeling effort. Moreover, it is important to analyze the informative content of microblogging sentiment indicators to forecast stock market behavior. Sentiment indicators created by SA using stock market lexicons can be included in models to predict diverse stock market variables (e.g., returns, trading volume, volatility) in order to assess their predictive ability. In future work, we will also explore other text processing possibilities, such as the inclusion of exclamation points or question marks, which could be relevant in microblogs. Acknowledgments This work was supported by FCT - Funda¸c˜ao para a Ciˆencia e Tecnologia within the Project Scope UID/CEC/00319/2013. We would like to thank the anonymous reviewers for their helpful suggestions. We also thank StockTwits for the provision of their data. References [1] A. Montoyo, P. Mart´ınez-Barco, A. Balahur, Subjectivity and sentiment analysis: An overview of the current state of the area and envisaged developments, Decision Support Systems 53 (4) (2012) 675–679. 25