Human Emotion and Sentiment Analysis using Machine Learning
Abstract
Emotion recognition is an essential field of study in the current scenario that can be useful for variety of purposes. Emotions is indicated in several forms such as speech, facial expressions, gestures, and written text etc. Emotion recognition from text is considered under content-based classification and is a category of Natural Language Processing (NLP). In this work, authors tried to predict the human emotions from twitter text data which can be useful for human emotion prediction and interpretation of sentiment analysis. The dataset used in this work was downloaded from Kaggle open source repository and Python was used for implantation. The subjectivity and polarity of the sentiments were also analyzed using Python TextBlob. The Machine Learning (ML) algorithms such as Naïve Bayes (NB), Logistic Regression (LR), Bagging, and Support Vector Machine (SVM) was applied on the original dataset to measure the efficiency of these algorithms. We had also analyzed the presence of amount of types of emotion present in the dataset and then we removed those data which were present in less amount. Again on the reduced dataset, we applied these same ML algorithms and measured the efficiency using parameters like recall, precision, F-measure etc. The accuracies obtained for LR, NB, Bagging, and SVM classifier are found to be 85%, 69%, 84%, and 86% respectively in the original dataset and it was found to be 93%, 85%, 92%, and 94% respectively in the reduced dataset. From the experimentation, it was found that SVM performed better in both the cases and for each of the considered algorithm the accuracy was improved in the reduced dataset as compared to the considered dataset.
Keywords
Emotion; Machine Learning; Sentiment Analysis; Polarity; Subjectivity