Sentiment Analysis of Political Parties on social media: A Machine Learning and Lexicon-Based Approach
DOI:
https://doi.org/10.32628/CSEIT24105103Keywords:
Term Frequency-Inverse Document Frequency, Multinomial Naïve Bayes, Logistic Regression, Random Forest, Support Vector Machine, K-Nearest NeighborAbstract
Social media platforms like Facebook, Twitter, Instagram, and YouTube have become central to communication and entertainment, with users sharing opinions on various topics. These opinions, often categorized as positive, negative, or neutral sentiments, provide valuable data for sentiment analysis. Our research analyzed political YouTube comments related to India’s Bhartiya Janata Party (BJP) and Indian National Congress (INC) using a combination of the AFINN lexicon and machine learning techniques. We applied feature representation methods such as Bag of Words (BoW) and Term Frequency-Inverse Document Frequency (TF-IDF), alongside five machine learning algorithms: Multinomial Naïve Bayes, Logistic Regression, Random Forest, Support Vector Machine (SVM), and K-nearest neighbor (K-NN). We aimed to determine the most efficient sentiment analysis approach by comparing the performance of these models using standard evaluation metrics. For the BJP dataset, Logistic Regression performed best with BoW, while SVM was most effective with TF-IDF. Similarly, for the INC dataset, Random Forest excelled with BoW, and SVM outperformed others with TF-IDF. The AFINN lexicon showed poor performance across both datasets, and K-NN consistently achieved lower accuracy. Our findings suggest that SVM and Random Forest are more suitable for political sentiment analysis.
Downloads
References
Liu, B. (2020). Sentiment Analysis: Mining Opinions, Sentiments, and Emotions. Cambridge University Press. DOI: https://doi.org/10.1017/9781108639286
Mazari, A.C., & Djeffal, A. (2021). Deep Learning-Based Sentiment Analysis of Algerian Dialect during Hirak 2019. In 2020 2nd International Workshop on Human-Centric Smart Environments for Health and Well-being (IHSH) (pp. 233-236). IEEE. doi: 10.1109/IHSH51661.2021.9378753 DOI: https://doi.org/10.1109/IHSH51661.2021.9378753
Joseph, F.J.J. (2019). Twitter Based Outcome Predictions of 2019 Indian General Elections Using Decision Tree. In 2019 4th International Conference on Information Technology (InCIT) (pp. 50-53). IEEE. doi: 10.1109/INCIT.2019.8911975 DOI: https://doi.org/10.1109/INCIT.2019.8911975
Ullah, M.A., Hasnayeen, M.A., Shan-A-Alahi, A., Rahman, F., & Akhter, S. (2020). A Search for Optimal Feature in Political Sentiment Analysis. In 2020 IEEE International Women in Engineering (WIE) Conference on Electrical and Computer Engineering (WIECON-ECE) (pp. 340-343). IEEE. doi: 10.1109/WIECON-ECE52138.2020.9397966 DOI: https://doi.org/10.1109/WIECON-ECE52138.2020.9397966
López-Fierro, S., Chiriboga-Calderón, C., & Pacheco-Villamar, R. (2021). If it looks, retweets and follows like a troll; Is it a troll?: Targeting the 2021 Ecuadorian Presidential Elections Trolls. In 2021 IEEE International Conference on Big Data (Big Data) (pp. 2503-2509). IEEE. doi: 10.1109/BigData52589.2021.9671864
Bhutani, B., Rastogi, N., Sehgal, P., & Purwar, A. (2019). Fake News Detection Using Sentiment Analysis. In 2019 Twelfth International Conference on Contemporary Computing (IC3) (pp. 1-5). IEEE. doi: 10.1109/IC3.2019.8844880 DOI: https://doi.org/10.1109/IC3.2019.8844880
Saha, B.N., Senapati, A., & Mahajan, A. (2020). LSTM based Deep RNN Architecture for Election Sentiment Analysis from Bengali Newspaper. In 2020 International Conference on Computational Performance Evaluation (ComPE) (pp. 564-569). IEEE. doi: 10.1109/ComPE49325.2020.9200062 DOI: https://doi.org/10.1109/ComPE49325.2020.9200062
Ansari, M.Z., Aziz, M.B., Siddiqui, M.O., Mehra, H., & Singh, K.P. (2020). Analysis of Political Sentiment Orientations on Twitter. Procedia Computer Science, 167, 1821-1828. doi: 10.1016/j.procs.2020.03.201 DOI: https://doi.org/10.1016/j.procs.2020.03.201
Kusumawardani, R.P., & Maulidani, M.W. (2020). Aspect-level Sentiment Analysis for Social Media Data in the Political Domain using Hierarchical Attention and Position Embeddings. In 2020 International Conference on Data Science and Its Applications (ICoDSA) (pp. 1-5). IEEE. doi: 10.1109/ICoDSA50139.2020.9212883 DOI: https://doi.org/10.1109/ICoDSA50139.2020.9212883
Hadi, K. A., Lasri, R., & El Abderrahmani, A. (2019). Social Media Reputation and Political Popularity: Study of a Moroccan Case. In 2019 International Conference on Intelligent Systems and Advanced Computing Sciences (ISACS) (pp. 1-4). IEEE. https://doi.org/10.1109/ISACS48493.2019.9068920 DOI: https://doi.org/10.1109/ISACS48493.2019.9068920
Garg, A., & Kaliyar, R. K. (2020). PSent20: An Effective Political Sentiment Analysis with Deep Learning Using Real-Time Social Media Tweets. In 2020 5th IEEE International Conference on Recent Advances and Innovations in Engineering (ICRAIE) (pp. 1-5). IEEE. https://doi.org/10.1109/ICRAIE51050.2020.9358379 DOI: https://doi.org/10.1109/ICRAIE51050.2020.9358379
Firmansyah, F., Windarto, A. P., Herowati, R., & Indrayanti, D. (2020). Comparing Sentiment Analysis of Indonesian Presidential Election 2019 with Support Vector Machine and K-Nearest Neighbor Algorithm. In 2020 6th International Conference on Computing Engineering and Design (ICCED) (pp. 1-6). IEEE. https://doi.org/10.1109/ICCED51276.2020.9415767 DOI: https://doi.org/10.1109/ICCED51276.2020.9415767
Svetlov, K., & Platonov, K. (2019). Sentiment Analysis of Posts and Comments in the Accounts of Russian Politicians on the Social Network. In 2019 25th Conference of Open Innovations Association (FRUCT) (pp. 299-305). IEEE. https://doi.org/10.23919/FRUCT48121.2019.8981501 DOI: https://doi.org/10.23919/FRUCT48121.2019.8981501
Shaghaghi, N., Calle, A. M., Zuluaga Fernandez, J. M., Hussain, M., Kamdar, Y., & Ghosh, S. (2021). Twitter Sentiment Analysis and Political Approval Ratings for Situational Awareness. In 2021 IEEE Conference on Cognitive and Computational Aspects of Situation Management (CogSIMA) (pp. 59-65). IEEE. https://doi.org/10.1109/CogSIMA51574.2021.9475935 DOI: https://doi.org/10.1109/CogSIMA51574.2021.9475935
Khanna, A., Bansal, A., Agarwal, A., & Maheshwari, P. (2020). Reading Political Sentiment and Mood of the Electorate Through Twitter Data. In 2020 3rd International Conference on Signal Processing and Information Security (ICSPIS) (pp. 1-4). IEEE. https://doi.org/10.1109/ICSPIS51252.2020.9340147 DOI: https://doi.org/10.1109/ICSPIS51252.2020.9340147
Sahu, K., Bai, Y., & Choi, Y. (2020). Supervised Sentiment Analysis of Twitter Handle of President Trump with Data Visualization Technique. In 2020 10th Annual Computing and Communication Workshop and Conference (CCWC) (pp. 640-646). IEEE. https://doi.org/10.1109/CCWC47524.2020.9031237 DOI: https://doi.org/10.1109/CCWC47524.2020.9031237
J. Ramteke, S. Shah, D. Godhia and A. Shaikh, "Election result prediction using Twitter sentiment analysis," 2016 International Conference on Inventive Computation Technologies (ICICT), 2016, pp. 1-5, doi: 10.1109/INVENTIVE.2016.7823280. DOI: https://doi.org/10.1109/INVENTIVE.2016.7823280
S. Shojaee, M. Murad, A. B. Azman, N. M. Sharef and S. Nadali, “Detecting deceptive reviews using lexical and syntactic features,” in 2013 13th Int. Conf. on Intelligent Systems Design and Applications, Selangor, Malaysia, pp. 53–58, 2013. DOI: https://doi.org/10.1109/ISDA.2013.6920707
Towards Data Science. "Performance Metrics - Confusion Matrix, Precision, Recall, and F1 Score." Accessed on 15th Dec 2022. Available online: https://towardsdatascience.com/performance-metrics-confusion-matrix-precision-recall-and-f1-score-a8fe076a2262.
M. Crawford, T. M. Khoshgoftaar, J. D. Prusa, A. N. Richter and H. Al Najada, “Survey of review spam detection using machine learning techniques,” Journal of Big Data, vol. 2, no. 1, pp. 1–24, 2015. DOI: https://doi.org/10.1186/s40537-015-0029-9
Towards Data Science. "Micro, Macro, Weighted Averages of F1 Score: Clearly Explained." Accessed on 15th Dec 2022. Available online: https://towardsdatascience.com/micro-macro-weighted-averages-of-f1-score-clearly-explained-b603420b292f.
Kaushik, Abhishek, & Chaudhari, Supriya. (2019). Comments on YouTube videos of top two Indian political parties named Indian National Congress and Bhartiya Janata Party (Version Version1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.3055456
GitHub. "AFINN - AFINN-165." Accessed on 20th Oct 2022. Available online: https://github.com/fnielsen/afinn/tree/master/afinn/data.
Downloads
Published
Issue
Section
License
Copyright (c) 2024 International Journal of Scientific Research in Computer Science, Engineering and Information Technology
This work is licensed under a Creative Commons Attribution 4.0 International License.