Türkçe Metinlerde Duygu Analizi

thumbnail.default.alt
Tarih
2015-01-30
Yazarlar
Türkmenoğlu, Cumali
Süreli Yayın başlığı
Süreli Yayın ISSN
Cilt Başlığı
Yayınevi
Fen Bilimleri Enstitüsü
Instıtute of Science and Technology
Özet
Başkalarının ne düşündüğü, biz insanlar için her zaman merak konusu olmuştur. "İnsanlar ne düşünüyor?" sorusu, aynı zamanda üretim, pazarlama, hizmet ve reklamcılık firmaları için de toplumun, ürün, hizmet ve marka isimleri hakkındaki görüşlerini öğrenmeleri açısından son derece önemlidir. Genel olarak firmalar, kullanıcı/müşteri analizini, ya müşterilerden görüşlerini içeren geri bildirim formları toplayıp, elle analiz edip, çıkarımlarda bulunarak ya da bir anket firmasına yüklü miktarlar ödeyerek, anketler ile yapmaya çalışırlar. Ancak bu yöntemler istatistiksel olarak geniş kitlelere ulaşılmasında çok yetersiz, insan emeği bağlamında masraflı yöntemlerdir. Sosyal medya platformları ve diğer internet ortamları özellikle hedef kitleden geri dönüşüm alabilmek için önemli ve yeterince geniş kaynaklardır. Ancak bunları insan eliyle analiz etmek neredeyse imkansızdır. Bu noktada Duygu (Sentiment) Analizi (DA) araçları devreye girerler ki bunların, sosyal platformları gözlemlemek için en işlevsel araçlar olduğu söylenebilir. Bir metinde ilgili konu hakkındaki tutum, ancak DA yapılarak anlaşılabilir. DA bir metnin duygu barındırıp barındırmadığı ve bu duygunun olumlu ya da olumsuz olma durumunun saptanması sürecidir [1]. Duygu barındıran metinler genellikle görüş ya da değerlendirme içerirler. Bu görüş ve analizler herhangi bir konu, şahıs, marka ya da siyasi görüş hakkında olabilir. İnternet olmadan önce dijital ortamdaki veri ve bu veriye ulaşım imkanları çok kısıtlıydı. İnternet'in yaygınlaşmasıyla beraber insanlar belli konular hakkındaki görüşlerini forumlar, bloglar ve sosyal medya platformlarında paylaşmaya başladılar. Bu paylaşımlardaki görüşler, sosyal analiz ve anketler için olduğu gibi firmaların da kendileri, ürünleri veya hizmetleri ile ilgili araştırmaları ve analizleri için değerli kaynaklar oluştururlar. Dijital platformlarda hızla biriken büyük oranda verinin insanlar tarafından işlenmesi çok zor olduğundan otomatik olarak bilgisayarlarla yapılması kaçınılmaz bir durum olmuştur. Bu verilerin bilgisayarlar tarafından hızlı bir şekilde işlenebilmesi ise, bu kaynakların, piyasada kullanılabilmesine imkan sağlamıştır. Duygu analizi, Doğal Dil İşleme (DDİ) ve metin madenciliği için zor bir çalışma alanıdır. Piyasa değerinin olması ve pratik sonuçlar alınabilmesi hem akademik çalışmaların hem de endüstrinin bu alana ciddi bir şekilde yönelmesini sağlamıştır. Ancak görüş/duygu bildiren kaynakları WEB üzerinde bulmak ve onlara ulaşıp işlemek hâlâ zorlu bir görev olarak karşımızda durmaktadır. Çünkü her biri büyük miktarda görüş/duygu barındıran geniş sayıda farklı kaynaklar mevcuttur ve bu kaynakların birçoğunda, görüş/duygu uzun metinler içerisinde gizli bir şekilde yer alır. Bir insan için ilgili kaynakları bulmak, o kaynaklardan ilgili görüş/duygu içeren kısımları bulup onları özetlemek ve kullanılabilir bir biçimde organize etmek çok zor ve zahmetli bir iştir. Bundan dolayı, otomatik olarak görüş/duygu keşfetmek, analiz etmek ve özetlemek için özel sistemlere ihtiyaç vardır. Görüş madenciliği olarak da bilinen DA, bu ihtiyaçlardan doğar. Sosyal analiz ve anketlerin otomatik olarak yapılabilmesi için DA'nin büyük veri kümeleri üzerinde otomatik olarak bilgisayarlara yaptırılması gerekir. Otomatik DA yapılırken belli teknikler kullanılmaktadır. Bunlardan en çok kullanılanları Makine Öğrenmesi (MÖ) ve sözlük tabanlı DA teknikleridir. Bu tekniklerin kullanıldığı çalışmaların birçoğu İngilizce üzerinde yoğunlaşmasına rağmen diğer diller için de çalışmalar popüler olmaya başlamıştır. Bu tez çalışmasında hem İngilizce hem de Türkçe için yapılan çalışmalarda kullanılan MÖ ve sözlük tabanlı DA metotları yeni özellikler eklenerek oluşturulup farklı iki veri kümesi üzerinde değerlendirildi. Bu çalışmada daha önce İngilizce ve Türkçe için çalışılmış metotlardan MÖ ve sözlük tabanlı DA olmak üzere iki ayrı DA metodu Türkçe için gerçeklenmiştir. Bu metotları kısa ve uzun metinler olmak üzere iki farklı Türkçe veri kümesine uygulayıp başarımlarını ölçtük. Türkçenin yapısal özelliklerini de göz önüne alacak şekilde ön işlemler uyguladı. Öncelikle bir deasciifying (Türkçeleştirme) ve düşük seviye normalleştirme uygulanarak Türkçeye uygun yazılmayan ve çok tekrarlı harfler içeren kelimeler düzeltildi. Kelimeler asıl anlamlarını köklerinde barındırdığıdan gereksiz ekler atılıp, asıl anlamı içeren kelime kökülerine ulaşıldı. Bunu yaparken varlık/yokluk (-lı,-li,-sız,-siz) eklerini ve olumsuzluk bildiren ekleri (-me,-ma) ya kaldırmadık ya da ona özel bir işaret koyarak muhafaza ettik. şimdiye kadar yapılan çalışmalardan farklı olarak hem MÖ hem de sözlük tabanlı DA için bazı yeni özellikler eklendi. Bu yeni özellikler sözlük tabanlı DA için bileşik kelimeler ve varlık/yokluk eki barındıran kelimelerdir. Sözlük tabanlı DA için her kelimesi taşıdığı duygu yönelimine göre puanlandırılmış bir sözlük kullanılarak bir metnin duygu yönelimini bulmaya çalıştık. Kullanılan sözlüğü oluşturmak için Thellwal ve diğ. [2] çalışmalarında kullanıldıkları Sentistrength sözlüğünü Türkçeye çevrildi. Ayrıca sözlükte eksik olan diğer gerekli sözcükler, birleşik kelimeler ve varlık/yokluk eki barındıran kelimeler eklemek kaydıyla sözlük genişlettilmiştir. Kelime köklerine inildiğinden dolayı kelimler ad-sıfat veya fill olmak üzere iki ayrı etiketle etiketlenmiştir. Sözlük tabanlı DA olumlu-olumsuz ve olumlu-olumsuz-nötr senaryoları olarak uygulandı ve sonuçları değerlendirildi. Genel olarak, işlenecek metindeki kelimelerden duygu sözlüğünde yer alanlarının sözlükteki puanlarının toplanmasıyla elde edilen puana göre sınıflandırma yapılmıştır. Diğer taraftan MÖ tabanlı DA için n-gram'lar öznitelik olarak bag-of-words şeklinde kullanılmıştır. Bu iki metodun güçlü ve zayıf yönlerini görülebilmesi için kısa ve uzun yorum metinler içeren iki farklı veri kümesi üzerinde test edildi. Bu veri kümeleri; diğerine kıyasla daha kısa ve kuralsız yorumlardan oluşan Twitter veri kümesi ve görece daha uzun, nispeten daha kurallı yazılmış film yorumlarından oluşan Film Yorumları veri kümesidir. Twitter veri kümesine uygulandığında sözlük tabanlı DA metodu ile %75.2, MÖ tabanlı DA metodu ile ise, Karar Destek Makineleri (KDM) sınıflandırıcısı kullanılarak, %85 başarı elde edilmiştir. Film yorumları veri kümesine uygulandığında ise sözlük tabanlı DA metodu ile %79,5, MÖ tabanlı DA metodu ile KDM sınıflandırıcısı kullanılarak %89 başarı elde edilmiştir. Twitter verisi, gramer ve yapısal kural eksikliğinden dolayı DDİ çalışmaları için ez zor verilerden biridir. Film yorumları veri kümesi daha kurallı ve düzgün metinlerden oluştuğundan ve tek hedefe (film) odaklı olduğundan, her iki yaklaşımda da daha iyi sonuç vermiştir. Bu çalışmada birçok ön işlem uygulanmıştır. Bu ön işlemler duygu analizi ve özellikle Türkçe için önemlidirler. Bileşik kelimelerin yakalanması ve varlık/yokluk eklerinin kullanılması sözlük tabanlı duygu analizi yaklaşımında önemli etki yaratmıştır. Bu yöntemlerin etkisi, gizli bilgilerin ortaya çıkarılıp işlenmesinin umut verici olduğu göstermiştir. Gizli bilginin yanında varolan bilginin cümledeki hangi nesneye yönelik olduğu da çok önemlidir. Daha ileriki çalışmalar için bağlılık analizi yapılarak sadece ilgilendiğimiz nesne ile ilgili kelimelerin dikkate alınması sağlanabilir. MÖ metodu KDM sınıflandırıcısıyla beraber, birçok çalışmada olduğu gibi bizim çalışmamızda da en yüksek başarımı sağlamaktadır. Fakat, eğitilme ihtiyacı olduğundan ve eğitim kümesi için büyük miktarlarda etiketli veri gerektiğinden, MÖ tabanlı yaklaşım tercih edilmeyebilir. Sözlük tabanlı duygu analizi için herhangi bir eğitim kümesi gerekmediğinden etiketleme işine de gerek kalmamaktadır. Oluşturduğumuz sözlük her ne kadar elle oluşturulmuş olsa da genel amaçlı olduğundan, dışarıdan girilen herhangi bir metni sözlüğe göre değerlendirip sınıflandırabileceğinden, alan bağımsızdır ve hiçbir eğitim kümesi gerektirmez. Elimizdeki eğitim kümesini kullanarak daha alana özel bir sözlük oluşturmak ve başarımı daha da yükseltmek mümkündür. Ancak bu durumda sözlük tabanlı DA'nin avantajlarından olan eğitim seti gerektirmemeyi kaybetmiş oluruz. Sözlük tabanlı duygu analizi denetimsiz ve alan bağımsız bir çalışma olmasına rağmen elde ettiğimiz başarı umut vericidir.
There is a remarkable curiosity inside us to know what others think. It is also important for production, marketing, service and advertising firms to learn the attitude of people towards their goods, brands and services. Firms used to monitor customer attitudes by receiving feedback forms from their customers and analyze them manually or made some questionnaire to survey companies with charge of money. However these methods were not able to capture statistically sufficient size masses and were costly in terms of human labor and money. Social media platforms, which are easily accessible platforms, provide remarkable sources to get feedbacks from target masses, but it is impossible to analyze these feedbacks by human labor. Therefore, automated sentiment analysis tools are crucial for companies' customer services to have the capability of capturing complaints and/or positive feedbacks in the right time. Processing by computers allows these data to be used in the market. Implementing an efficient sentiment analysis tool will increase the customer satisfaction and will decrease the costs. This is the motivation of sentiment analysis research area. We can say that: sentiment analysis is one of the most useful tool for social media monitoring. A text with sentiment generally includes opinions, attitudes and evaluating. Opinions and attitudes can be towards a topic, a person, a brand or a politic view. They are not only valuable sources for social researches and surveys but also quite important for firms to analyze responses and feedbacks about their goods and services. Sentiment analysis is needed to capture the attitude of a text towards any topic. Sentiment analysis is the process of determining whether a text includes sentiment or not and classifying the sentiment into positive, negative and neutral classes. Although, sentiment analysis is a hard task for NLP and Data Mining research areas, giving practical solutions and having high market value results increasing academic and market interest in it. Accessing data including sentiment on WEB and processing it are still hard tasks to be solved, because there are huge number of sources including sentiment and most of sentiments are hidden in long texts. Before development of WEB, there were almost no information on digital platforms and no possibility of access to this information. People started to share their opinions on certain topics on digital platforms. The amount of accessible information with opinion on the Web has been increasing with the contribution of forums, columns, blogs, and social media. Processing this information, extracting the subjectivity and classifying the sentiment are the main challenges of the sentiment analysis that need to be solved. Sarcasm and irony also have remarkable importance and interest in both psychology [3] and NLP [4] [5] research area. Increasing the accuracy in detecting sarcasm will increase the performance of the sentiment analysis. Unfortunately it is also a difficult task to identify the sarcasm in a natural text even for a human [4]. Sentiment analysis or opinion mining is the computational study of opinions, sentiments and emotions expressed in text [1]. Extracting opinions and analyzing the polarity of these opinions are the main problems of the sentiment analysis. Various approaches are utilized to solve these problems in academic researches. Most of them are on subjectivity classification and sentiment classification. Subjectivity classification is a problem of classifying any document as objective or subjective and sentiment classification is the classification of these subjective documents into positive or negative [1] classes according to their sentimental polarity. NLP and machine learning techniques are extensively used for Sentiment Analysis. Knowing the characteristics of the language are essential for NLP and Sentiment Analysis because different languages require different preprocessing techniques. Sentiment analysis approaches are mainly based on either machine learning or lexicon based methods. Both methods have advantages and disadvantages in terms of accuracy and human labor. Our goal is to show the comparison of the strengths and weaknesses of these methods on two different types of datasets. As a lexicon based method, we build a framework similar to the systems described in Thelwall et al. [2] and Vural et al. [6]. To implement machine learning based sentiment analysis, we have investigated several machine learning methods like Pang et al. [7] and Ero˘gul [8]. The majority of sentiment analysis approaches are concentrated on English. However,there exists a number of sentiment analysis studies on Turkish [8] [6]. Ero˘gul [8] handled the sentimental analysis problem as a supervised machine learning classification problem and applied different ML techniques with different features like unigrams, bigrams, POS tags and combination of them. Vural et al. [6] presented a lexicon based sentiment analysis framework using Turkish version Sentistrength [2] lexicon. They used an approach based on summing lexicon scores of sentiment oriented words in related text. In this work, we applied both ML based and Lexicon based SA methods on Turkish with additional features. In order to evaluate the performance of lexicon based and ML based sentiment analyzers, we use two datasets exhibiting different characteristics. Our first dataset is comprised of tweets which suffer from orthographic and grammatical problems. Tweets are usually difficult to process for NLP purposes since they frequently contain abbreviations, missing vocals that need devocalization and ungrammatical constructs both due to the character limitation of Twitter and mobile devices with limited text entry capabilities. We collect another dataset that consists of movie reviews which are more grammatical and orthographic than tweets. We applied our tests for binary (positive and negative) and trinary (positive-negative and neutral) classification. Pre-processing is one of the most important steps of the sentimental analysis in Turkish. Having a very productive inflectional and observational morphology, Turkish is a difficult language to process. A number of preprocessing steps are required for both lexicon based and ML based approaches due to the productive Turkish morphology. In this study, we employ deasciification, basic text normalization, morphological analysis, morphological disambiguation and multi-words expressions extraction preprocessing steps. Text normalization pre-processing steps such as spelling correction are necessary prior to morphological analysis step since the data is noisy. A finite-state-machine based morphological analyzer [9] is used to produce root of words, suffixes and morphological tags. This level produce ambiguous results. Since the morphological analysis stage produces ambiguous results, a morphological disambiguation module is required. We used a rule based morphological disambiguator [10]. Multi-words expressions extraction aims to identify the segments of the texts which are generally sequential but not compositional [11]. We use Kemal Oflazer's MWEs extraction application's Perl script to handle the MWEs extraction problem. Finally we identify and combine expressions which have different meanings and may have/haven't sentiment when they separate from each other, e.g. "kafayı ye-" (literally eat the head) none of the words have an sentiment polarity by their self but it means "to get mentally deranged" and has negative sentiment polarity when they are together. We added these sentiment holding MWEs to our lexicon. Our lexicon based sentiment analysis approach depends on comparing features of a given text with a pre-determined sentimentally oriented lexicon. Sentiment analysis does not require a detailed pre-processing [12] phase before classification for English but it is necessary for Turkish and similar agglutinating languages. Turkish is an agglutinating language in which it is possible to add many suffixes to word roots. These derivational and inflectional suffixes can change the POS tag and sentimentally orientation of the word. Important suffixes for sentiment analysis are considered to be the negation suffix (+ma/+me) and absence/presence suffixes (+sız/+siz (without), +lı/+li (with)) which can change the sentiment orientation of a nominal word. Handling these suffixes increase the performance of the sentiment analysis [13] [7]. The morphological analysis is needed to handle linguistic features for sentiment analysis, e.g. roots, POS tags, suffixes and adjuncts of the words. For a lexicon based sentiment analyzer, it is necessary to have a sentimentally oriented lexicon which is effective to detect the sentiment of a sentence. Since there were no Turkish lexicon we manually translated a basic English lexicon (Sentistrength, 2547 words) [2] into Turkish. Although there were some other more detailed lexicon in literature, such as SenticNet [14], WordNet-Affect [15], we used Sentistrength lexicon as a baseline lexicon. We reconstructed it by adding 700 MWEs, 650 words with absence/presence suffixes, 110 extra needed words for Turkish (slangs, curses and some special words) and we removed 350 root words due to adding them again as words with absence/presence suffixes. Actually we use Sentistrength as a starting point. After reconstructing, our final lexicon contains 2784 nominals and 873 verbs totally 3657 terms which have a polarity magnitude between [-5, +5]. Because of negation (-me, -ma) and absence/presence suffixes (+sız/+siz (without), +lı/+li (with)) suffixes, we must be careful when finding root of the words. It is not effective technique to use regular expressions like 'isolat*' which stands for 'isolate' 'isolated' 'isolation' 'isolating' in English, because of differentiation of words with suffixes in Turkish. Negation occurs in two different ways for Turkish. The first is using negation words ("de˘gil", "yok") and second is using negation suffixes (–me, -ma). When negation suffixes met we add negation word ("de˘gil") after related words, so that all negation forms become standardized. During calculating the sentiment score of texts, negation words change the sign of the sentiment score of the related word. We use a booster words list ("çok", "baya", "en" etc.) which have a boosting effect when met before an adjective. We handle punctuations like '!' after sentimental terms as boosters but giving less strength. Instead of with/without words in English we have absence/presence suffixes (+sız/+siz (without), +lı/+li (with)) in Turkish which are added to nouns and change their POS tag to adjective. It is a kind of negation and changes the polarity of the following word. If any absence/presence suffixes met we do not eliminate these suffixes ("umut-suz"). As we mentioned before we also add these sentimental adjectives with absence/presence suffixes to the lexicon. So in sentiment score calculating process we compare these words with Lexicon. The ML approach treats the sentiment analysis as a supervised classification problem. Supervised classification requires a sufficently large labeled dataset for proper training but Lexicon based sentiment analysis does not. Determining of feature set is another key process for ML classification. In order to create the feature vector, we use unigrams and bigrams by using inverse-document-frequency (TF-IDF) feature ranking and selection method. We conduct our experiments using SVM, NB and Decision Trees (J48) classification algorithms. 10 fold cross validation technique is utilized to train and test our supervised classifiers. We use accuracy measure, the number of instances that predicted correctly, to evaluate performance of our systems. We activate and deactivate modules to show the contribution of each module to performance of sentiment analyzers. According to results, each module has a contribution to the performance of Lexicon based sentiment analysis method but the most effective ones are Negation handling and MWEs handling for Twitter dataset and deasciification and negation handling for Movie dataset. The performance of Lexicon based sentiment analysis Method is 75.2% for Twitter dataset and 79.5% for Movie dataset. Results show that MWEs extraction and handling absence/presence suffixes bring reasonable improvement to performance of Lexicon based method. Since Movie reviews are too long and have too many sentimental words, MWEs extraction option does not bring enough improvement. As most researchers [1] [8] reported, our results also show that SVM hashighest accuracy than other algorithms for ML approach. The best performance of ML Based Sentiment Analysis Method is 85.0% (SVM) for Twitter dataset and 89.5% (SVM) for Movie dataset. Using unigrams and bigrams together gives the best performance for almost all classifiers on both datasets. Results indicate that bigrams can handle most of consecutive cases such as negation, boosting and MWEs. As surface forms of words include enough linguistic information such as negation and absence/presence suffixes, the usage of surface forms that combined with unigrams increases the performance of ML based method slightly for Movie dataset. But it decreases the performance for Twitter dataset since Twitter dataset is too noisy and feature selection threshold leaves most of bigrams below the feature selection threshold (min. 20 occurrence in Movie dataset and min. 5 occurrence in Twitter dataset). It decreases the performance when combined with unigrams+bigrams for Movie dataset also. In comparison of these two methods, ML based method performs better than Lexicon based method on both short (Twitter dataset) and long informal texts (Movie dataset). The results show that accuracy of Movie dataset is better than accuracy of Twitter dataset in both Lexicon based and ML based sentiment analysis methods. Although Lexicon based sentiment analysis is unsupervised, it works well when text does not include sarcasm or irony.
Açıklama
Tez (Yüksek Lisans) -- İstanbul Teknik Üniversitesi, Fen Bilimleri Enstitüsü, 2015
Thesis (M.Sc.) -- İstanbul Technical University, Instıtute of Science and Technology, 2015
Anahtar kelimeler
Duygu Analizi, Makine Öğrenmesi, Bilgi Çıkarımı, Doğal Dil İşleme (ddi), Sentiment Analysis, Machine Learning, Information Extraction, Nlp (naturel Language Processing)
Alıntı