<?xml version="1.0"?><!DOCTYPE article SYSTEM "/project/take/software/searchbench_offline_processing/paperxml_generator/aclextractor/src/python/../resource/dtd/paperxml.dtd"><article><header><firstpageheader><page local="1" global="436"/><title>Twitter Based System: Using Twitter for Disambiguating Sentiment Ambiguous Adjectives</title><pubinfo>Proceedings of the 5th International Workshop on Semantic Evaluation, ACL 2010,pages 436^-39, Uppsala, Sweden, 15-16 July 2010. ©2010 Association for Computational Linguistics</pubinfo><author surname="Pak" givenname="Alexander"><org  name="CNRS" country="France"/></author><author surname="Paroubek" givenname="Patrick"><org  name="CNRS" country="France"/></author></firstpageheader><frontmatter><p><b>Twitter Based System: Using Twitter for Disambiguating Sentiment Ambiguous Adjectives</b></p><p><b>Alexander Pak, Patrick Paroubek</b></p><p>Université de Paris-Sud, Laboratoire LEVI SI-CNRS, Bâtiment 508, F-91405 Orsay Cedex, France alexpak@limsi.fr, pap@limsi.fr</p></frontmatter><abstract>In this paper, we describe our system which participated in the SemEval 2010 task of disambiguating sentiment ambigu­ous adjectives for Chinese. Our system uses text messages from Twitter, a popu­lar microblogging platform, for building a dataset of emotional texts. Using the built dataset, the system classifies the meaning of adjectives into positive or negative sen­timent polarity according to the given con­text. Our approach is fully automatic. It does not require any additional hand-built language resources and it is language in­dependent. </abstract></header><body><section number="1" title="Introduction"><p>The dataset of the SemEval task (Wu and lin, 2010) consists of short texts in Chinese contain­ing target adjectives whose sentiments need to be disambiguated in the given contexts. Those adjec­tives are: <b>y</b>*v big, <footnote anchor="7"/>JN small, many, ^ few, r(i high, low, jf£ thick, <i>W </i>thin, <i>ffî. </i>deep, shallow, Jt heavy, light,       huge, Jty*v grave.</p><p>Disambiguating sentiment ambiguous adjec­tives is a challenging task for NLP. Previous stud­ies were mostly focused on word sense disam­biguation rather than sentiment disambiguation. Although both problems look similar, the latter is more challenging in our opinion because impreg­nated with more subjectivity. In order to solve the task, one has to deal not only with the semantics of the context, but also with the psychological as­pects of human perception of emotions from the written text.</p><p>In our approach, we use Twitter<footnote anchor="1"/> microblogging platform to retrieve emotional messages and form two sets of texts: messages with positive emotions and those with negative ones (Pak and Paroubek, 2010). We use emoticons<footnote anchor="2"/> as indicators of an emo­tion (Read, 2005) to automatically classify texts into positive or negative sets. The reason we use Twitter is because it allows us to collect the data with minimal supervision efforts. It provides an API<footnote anchor="3"/> which makes the data retrieval process much more easier then Web based search or other re­sources.</p><footnote label="1"> http://twitter.com</footnote><p>After the dataset of emotional texts has been obtained, we build a classifier based on n-grams Naïve Bayes approach. We tested two approaches to build a sentiment classifier:</p><p>1. In the first one, we collected Chinese texts from Twitter and used them to train a classi­fier to annotate the test dataset.</p><p>2. In the second one, we used machine trans­lator to translate the dataset from Chinese to English and annotated it using collected En­glish texts from Twitter as the training data.</p><p>We have made the second approach because we were able to collect much more of English texts from Twitter than Chinese ones and we wanted to test the impact of machine translation on the performance of our classifier. We have exper­imented with Google Translate and Yahoo Ba-belfish<footnote anchor="4"/>. Google Translate yielded better results.</p></section><section number="2" title="Related work"><p>In (Yang et al, 2007), the authors use web-blogs to construct a corpora for sentiment analysis and use emotion icons assigned to blog posts as indica­tors of users' mood. The authors applied SVM and CRF learners to classify sentiments at the sentence level and then investigated several strategies to de­termine the overall sentiment of the document. As<page local="2" global="437"/></p><footnote label="2">An emoticon is a textual representation of an author's emotion often used in Internet blogs and textual chats 3 http://dev . twitter, com/doc/get/search 4 http://babelfish.yahoo.com/</footnote><p>the result, the winning strategy is defined by con­sidering the sentiment of the last sentence of the document as the sentiment at the document level.</p><p>J. Read in (Read, 2005) used emoticons such as ":-)" and ":-(" to form a training set for the sen­timent classification. For this purpose, the author collected texts containing emoticons from Usenet newsgroups. The dataset was divided into "pos­itive" (texts with happy emoticons) and "nega­tive" (texts with sad or angry emoticons) samples. Emoticons-trained classifiers: SVM and Naïve Bayes, were able to obtain up to 70% accuracy on the test set.</p><p>In (Go et al., 2009), authors used Twitter to collect training data and then to perform a senti­ment search. The approach is similar to the one in (Read, 2005). The authors construct corpora by using emoticons to obtain "positive" and "neg­ative" samples, and then use various classifiers. The best result was obtained by the Naïve Bayes classifier with a mutual information measure for feature selection. The authors were able to obtain up to 84% of accuracy on their test set. However, the method showed a bad performance with three classes ("negative", "positive" and "neutral").</p><p>In our system, we use a similar idea as in (Go et al., 2009), however, we improve it by using a combination of unigrams, bigrams and trigrams ( (Go et al, 2009) used only unigrams). We also handle negations by attaching a negation particle to adjacent words when forming ngrams.</p></section><section number="3" title="Our method"><subsection number="3.1" title="Corpus collection"><p>Using Twitter API we collected a corpus of text posts and formed a dataset of two classes: positive sentiments and negative sentiments. We queried Twitter for two types of emoticons considering eastern and western types of emoticons<footnote anchor="5"/> :</p><doubt alpha="56.0" length="25" tooSmall="False" monospace="0.0">Happy emoticons: :-), :),</doubt><p>o , etc.</p><p>• Sad emoticons: :-(, :(, T_T, ;_;, etc.</p><p>We were able to obtain 10,000 Twitter posts in Chinese, and 300,000 posts in English evenly split between negative and positive classes.</p><p>The collected texts were processed as follows to obtain a set of n-grams:</p><p>1. Filtering - we remove URL links (e.g. http://example.com), Twitter user names (e.g.</p><p>@alex - with symbol @ indicating a user name), Twitter special words (such as "RT"<footnote anchor="6"/>), and emoticons.</p><p>2. Tokenization - we segment text by split­ting it by spaces and punctuation marks, and form a bag of words. For English, we kept short forms as a single word: "don't", "I'll", "she'd".</p><p>3. Stopwords removal - in English, texts we re­moved articles ("a", "an", "the") from the bag of words.</p><p>4. N-grams construction - we make a set of n-grams out of consecutive words.</p><p>A negation particle is attached to a word which precedes it and follows it. For example, a sen­tence "I do not like fish" will form three bigrams: "I do+not", "do+not like", "not+like fish". Such a procedure improves the accuracy of the classi­fication since the negation plays a special role in opinion and sentiment expression (Wilson et al., 2005). In English, we used negative particles 'no' and 'not'. In Chinese, we used the following par­ticles:</p><p>1.</p><p>is not + noun</p><doubt alpha="61.5" length="39" tooSmall="False" monospace="0.0">2.7fc- does not + verb, will not + verb</doubt><doubt alpha="60.0" length="30" tooSmall="False" monospace="0.0">3.Ü (S'J)- do not (imperative)</doubt><doubt alpha="63.2" length="38" tooSmall="False" monospace="0.0">4.M (l&amp;M) -does not have3.2 Classifier</doubt><p>We build a sentiment classifier using the multi­nomial Naïve Bayes classifier which is based on Bayes' theorem.</p><doubt alpha="37.5" length="8" tooSmall="False" monospace="0.0">P(s\M) =</doubt><doubt alpha="43.8" length="16" tooSmall="False" monospace="0.0">P(s)-P(M\s) P{M)</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">(1)</doubt><p>where <b>s </b>is a sentiment, <b>M </b>is a text. We assume that a target adjective has the same sentiment po­larity as the whole text, because in general the lengths of the given texts are small.</p><p>Since we have sets of equal number of positive and negative messages, we simplify the equation:</p><doubt alpha="50.0" length="6" tooSmall="False" monospace="0.0">P{s\M)</doubt><doubt alpha="45.5" length="11" tooSmall="False" monospace="0.0">P{M\s) P{M)</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">(2)</doubt><footnote>http://en.wikipedia.org/wiki/Emoticon#Asian_style</footnote><footnote label="6">An abbreviation for retweet, which means citation or re-posting of a message</footnote><page local="3" global="438"/><doubt alpha="40.0" length="15" tooSmall="False" monospace="0.0">P(s\M) ~ P(M\s)</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">(3)</doubt><p>We train Bayes classifiers which use a presence of an n-grams as a binary feature. We have ex­perimented with unigrams, bigrams, and trigrams. Pang et al. (Pang et al, 2002) reported that uni­grams outperform bigrams when doing sentiment classification of movie reviews, but Dave et al. (Dave et al., 2003) have obtained contrary re­sults: bigrams and trigrams worked better for the product-review polarity classification. We tried to determine the best settings for our microblogging data. On the one hand high-order n-grams, such as trigrams, should capture patterns of sentiments expressions better. On the other hand, unigrams should provide a good coverage of the data. There­fore we combine three classifiers that are based on different n-gram orders (unigrams, bigrams and trigrams). We make an assumption of conditional independence of n-gram for the calculation sim­plicity:</p><doubt alpha="33.3" length="39" tooSmall="False" monospace="0.0">P{s\M) ~ P{Gl\s) ■ P{G2\s) ■ P(G3\s)(4)</doubt><p>where <i>Gl </i>is a set of unigrams representing the message, <i>G2 </i>is a set of bigrams, and G3 is a set of trigrams. We assume that n-grams are condition­ally independent:</p><doubt alpha="50.0" length="16" tooSmall="False" monospace="0.0">P(Gn\s) =HP(g\s)</doubt><doubt alpha="75.0" length="4" tooSmall="False" monospace="0.0">g£Gn</doubt><p>Where <i>Gn </i>is a set of n-grams of order <i>n.</i></p><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">(5)</doubt><doubt alpha="42.4" length="33" tooSmall="False" monospace="0.0">P{s\M)~HP(g\s)-HP(g\s)- [] P(g\s)</doubt><doubt alpha="50.0" length="14" tooSmall="False" monospace="0.0">g£Gl g£G2 g£G3</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">(6)</doubt><p>Finally, we calculate a log-likelihood of each sen­timent:</p><doubt alpha="39.5" length="38" tooSmall="False" monospace="0.0">L(s\M) = £ log(P(g\s)) + £ log(P(g\s))</doubt><doubt alpha="55.6" length="9" tooSmall="False" monospace="0.0">g£Gl g£G2</doubt><doubt alpha="35.7" length="14" tooSmall="False" monospace="0.0">+ El°9(p(g\s))</doubt><doubt alpha="50.0" length="4" tooSmall="False" monospace="0.0">g£G3</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">(7)</doubt><p>In order to improve the accuracy, we changed the size of the context window, i.e. the number of words before and after the target adjective used for classification.</p></subsection></section><section number="4" title="Experiments and Results"><p>In our experiments, we used two datasets: a trial dataset containing 100 sentences in Chinese and</p><doubt alpha="50.0" length="20" tooSmall="False" monospace="0.0">15 20 25 window size</doubt><p>■google —yahoo</p><doubt alpha="0.0" length="5" tooSmall="False" monospace="0.0">40 45</doubt><figure caption="Figure 1: Micro accuracy when using Google Translate and Yahoo Babelfish"></figure><doubt alpha="0.0" length="4" tooSmall="False" monospace="0.0">0.65</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">0.6</doubt><doubt alpha="0.0" length="4" tooSmall="False" monospace="0.0">0.55</doubt><doubt alpha="16.7" length="6" tooSmall="False" monospace="0.0">E 0.45</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">0.4</doubt><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">10</doubt><doubt alpha="0.0" length="17" tooSmall="False" monospace="0.0">30    35    40 45</doubt><figure caption="Figure 2: Macro accuracy when using Google Translate and Yahoo Babelfish"></figure><p>a test dataset with 2917 sentences. Both datasets were provided by the task organizers. Micro and macro accuracy were chosen as the evaluation metrics.</p><p>First, we compared the performance of our method when using Google Translate and Yahoo Babelfish for translating the trial dataset. The re­sults for micro and macro accuracy are shown in Graphs 1 and 2 respectively. The x-axis repre­sents a context window-size, equal to a number of words on both sides of the target adjective. The y-axis shows accuracy values. From the graphs we see that Google Translate provides better results, therefore it was chosen when annotating the test dataset.</p><p>Next, we studied the impact of the context win­dow size on micro and macro accuracy. The impact of the size of the context window on the accuracy of the classifier trained on Chinese texts is depicted in Graph 3 and for the classifier trained on English texts with translated test dataset croblogs using emoticons.<page local="4" global="439"/> The techniques used in our approach can be applied to any other language. Our system is fully automate and does not utilize any hand-built lexicon. We were able to achieve up to 64% of macro and 61% of micro accuracy at the SemEval 2010 task</p><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>F</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>j \ i     <b>: jj \ </b>1 / :</p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>: /  J*      </b><b>***</b><b> </b><b>"«c^/</b></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>i      i      i i</b></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><p>For the future work, we would like to collect more Chinese texts from Twitter or similar mi-croblogging platforms. We think that increasing the training dataset will improve much the accu­racy of the sentiment disambiguation.</p><p>Figure 3 : Micro and macro accuracy for the first approach (training on Chinese texts)</p><p>Figure 4: Micro and macro accuracy for the sec­ond approach (training on English texts which have been machine translated) in Graph 4.</p><p>The second approach achieves better results. We were able to obtain 64% of macro and 61% of micro accuracy when using the second approach but only 63% of macro and 61% of micro accu­racy when using the first approach.</p><p>Another observation from the graphs is that Chinese requires a smaller size of a context win­dow to obtain the best performance. For the first approach, a window size of 8 words gave the best macro accuracy. For the second approach, we ob­tained the highest accuracy with a window size of 22 words.</p></section><section number="5" title="Conclusion"><p>In this paper, we have described our system for disambiguating sentiments of adjectives in Chi­nese texts. Our Naïve Bayes approach uses infor­mation automatically extracted from Twitter mi-</p></section><references><p>Kushal Dave, Steve Lawrence, and David M. Pen-nock. 2003. Mining the peanut gallery: opinion extraction and semantic classification of product re­views. In <i>WWW '03: Proceedings of the 12th in­ternational conference on World Wide Web, </i>pages 519-528, New York, NY, USA. ACM.</p><p>Alec Go, Lei Huang, and Richa Bhayani. 2009. Twit­ter sentiment analysis. Final Projects from CS224N for Spring 2008/2009 at The Stanford Natural Lan­guage Processing Group.</p><p>Alexander Pak and Patrick Paroubek. 2010. Twitter as a corpus for sentiment analysis and opinion mining.</p><p>In <i>Proceedings ofLREC 2010.</i></p><p>Bo Pang, Lillian Lee, and Shivakumar Vaithyanathan. 2002. Thumbs up? sentiment classification using machine learning techniques. In <i>Proceedings ofthe Conference on Empirical Methods in Natural Lan­guage Processing (EMNLP), </i>pages 79-86.</p><p>Jonathon Read. 2005. Using emoticons to reduce de­pendency in machine learning techniques for senti­ment classification. In <i>Proceedings of the ACL Stu­dent Research Workshop, </i>pages 43-48.</p><p>Theresa Wilson, Janyce Wiebe, and Paul Hoffmann. 2005. Recognizing contextual polarity in phrase­level sentiment analysis. In <i>HLT '05: Proceedings of the conference on Human Language Technology and Empirical Methods in Natural Language Pro­cessing, </i>pages 347-354, Morristown, NJ, USA. As­sociation for Computational Linguistics.</p><p>Yunfang Wu and Peng Jin. 2010. Semeval-2010 task 18: Disambiguating sentiment ambiguous ad­jectives. In <i>SemEval 2010: Proceedings of Interna­tional Workshop of Semantic Evaluations.</i></p><p>Changhua Yang, Kevin Hsin-Yih Lin, and Hsin-Hsi Chen. 2007. Emotion classification using web blog corpora. In <i>WI '07: Proceedings of the IEEE/WIC/ACM International Conference on Web Intelligence, </i>pages 275-278, Washington, DC, USA. IEEE Computer Society.</p></references></body></article>