Submit your papersSubmit Now
For Enquiries: [email protected]
IIARD LogoIIARD

Text-Based Sentiment Analysis Using Natural Language Processing

Dibie Chinonso Emmanuel

Abstract

Sentiment analysis, a vital application of Natural Language Processing , enables the extraction and classification of emotions from textual data, offering valuable insights across domains like business intelligence and social media monitoring. This study aimed to develop an enhanced text-based sentiment analysis model to accurately classify sentiments in diverse English-language textual data, such as social media posts, while addressing challenges like linguistic nuances and context dependency. Using the Sentiment140 dataset, the methodology involved data preprocessing (text normalization, tokenization, lemmatization), feature engineering with TF-IDF, and training a Support Vector Machine model as a baseline, with potential for advanced models like bidirectional GRUs or transformers. The system was deployed as a web application with a Flask backend and React frontend, allowing users to input text and receive real-time sentiment predictions with confidence scores. The SVM model achieved an accuracy of 75% and an F1-score of 74% on a test set of 2,000 samples, demonstrating its effectiveness for binary sentiment classification (positive/negative). However, the model struggled with nuanced sentiments like sarcasm, highlighting the need for advanced contextual models. The study contributes to NLP by providing a practical, scalable sentiment analysis solution, with implications for real-time social media monitoring and customer feedback analysis, while identifying future directions for incorporating transformer- based models and data augmentation to enhance performance.

Keywords

sentiment analysisnatural language processingsupport vector machineTF-IDFtext classification

References

Alawida, M., Mejri, S., Mehmood, A., Chikhaoui, B., & Isaac Abiodun, O. (2023). A comprehensive study of ChatGPT: Advancements, limitations, and ethical considerations in natural language processing and cybersecurity. Information, 14(8), 462. Bayer, M., Kaufhold, M. A., Buchhold, B., Keller, M., Dallmeyer, J., & Reuter, C. (2023). Data augmentation in natural language processing: A novel text generation approach for long and short text classifiers. International Journal of Machine Learning and Cybernetics, 14(1), 135–150. Belal, M., She, J., & Wong, S. (2023). Leveraging ChatGPT as text annotation tool for sentiment analysis. arXiv preprint arXiv:2306.17177. Berger, J., & Packard, G. (2022). Using natural language processing to understand people and culture. American Psychologist, 77(4), 525. Cambria, E., Schuller, B., Xia, Y., & Havasi, C. (2013). New avenues in opinion mining and sentiment analysis. IEEE Intelligent Systems, 28(2), 15–21. Caucheteux, C., & King, J. R. (2022). Brains and algorithms partially converge in natural language processing. Communications Biology, 5(1), 134. Eddine Zekaoui, N., Yousfi, S., Rhanoui, M., & Mikram, M. (2023). Analysis of the evolution of advanced transformer-based language models: Experiments on opinion mining. arXiv e-prints, arXiv-2308. Guellil, I., Saâdane, H., Azouaou, F., Gueni, B., & Nouvel, D. (2021). Arabic natural language processing: An overview. Journal of King Saud University–Computer and Information Sciences, 33(5), 497–507. Hariri, W. (2023). Unlocking the potential of ChatGPT: A comprehensive exploration of its applications, advantages, limitations, and future directions in natural language processing. arXiv preprint arXiv:2304.02017. Hovy, D., & Prabhumoye, S. (2021). Five sources of bias in natural language processing. Language and Linguistics Compass, 15(8), e12432. Jia, J., Liang, W., & Liang, Y. (2023). A review of hybrid and ensemble in deep learning for natural language processing. arXiv preprint arXiv:2312.05589. Kalyan, K. S., Rajasekharan, A., & Sangeetha, S. (2021). Ammus: A survey of transformer- based pretrained models in natural language processing. arXiv preprint arXiv:2108.05542. Khan, M. T., Durrani, M., Ali, A., Inayat, I., Khalid, S., & Khan, K. H. (2016). Sentiment analysis and the complex natural language. Complex Adaptive Systems Modeling, 4, 1– 19. Koroteev, M. V. (2021). BERT: A review of applications in natural language processing and understanding. arXiv preprint arXiv:2103.11943. Li, B., Hou, Y., & Che, W. (2022). Data augmentation approaches in natural language processing: A survey. AI Open, 3, 71–90. Mandloi, L., & Patel, R. (2020, June). Twitter sentiments analysis using machine learning methods. In 2020 International Conference for Emerging Technology (pp. 1– 5). IEEE. Naithani, K., & Raiwani, Y. P. (2023). Realization of natural language processing and machine learning approaches for text-based sentiment analysis. Expert Systems, 40(5), e13114. Narechania, A., Srinivasan, A., & Stasko, J. (2020). NL4DV: A toolkit for generating analytic specifications for data visualization from natural language queries. IEEE Transactions on Visualization and Computer Graphics, 27(2), 369–379. Nasukawa, T., & Yi, J. (2003, October). Sentiment analysis: Capturing favorability using natural language processing. In Proceedings of the 2nd International Conference on Knowledge Capture (pp. 70–77). Olivetti, E. A., Cole, J. M., Kim, E., Kononova, O., Ceder, G., Han, T. Y. J., & Hiszpanski, A. M. (2020). Data-driven materials research enabled by natural language processing and information extraction. Applied Physics Reviews, 7(4). Ombabi, A. H., Ouarda, W., & Alimi, A. M. (2020). Deep learning CNN–LSTM framework for Arabic sentiment analysis using textual information shared in social networks. Social Network Analysis and Mining, 10, 1–13. Pruksachatkun, Y., Phang, J., Liu, H., Htut, P. M., Zhang, X., Pang, R. Y., ... & Bowman, S. R. (2020). Intermediate-task transfer learning with pretrained models for natural language understanding: When and why does it work? arXiv preprint arXiv:2005.00628. Rajput, A. (2020). Natural language processing, sentiment analysis, and clinical analytics. In Innovation in Health Informatics (pp. 79–97). Academic Press. Song, G. (2021). Sentiment analysis of Japanese text and vocabulary learning based on natural language processing and SVM. Journal of Ambient Intelligence and Humanized Computing, 1–12. William, P., Lanke, G. R., Inukollu, V. N. R., Singh, P., Shrivastava, A., & Kumar, R. (2023). Framework for design and implementation of chat support system using natural language processing. In 2023 4th International Conference on Intelligent Engineering and Management (pp. 1–7). IEEE. William, P., Shrivastava, A., Chauhan, P. S., Raja, M., Ojha, S. B., & Kumar, K. (2023). Natural language processing implementation for sentiment analysis on tweets. In Mobile Radio Communications and 5G Networks: Proceedings of Third MRCN 2022 (pp. 317–327). Springer Nature Singapore. Xu, W., Chen, J., Ding, Z., & Wang, J. (2024). Text sentiment analysis and classification based on bidirectional Gated Recurrent Units model. arXiv preprint arXiv:2404.17123. Zhang, T., Schoene, A. M., Ji, S., & Ananiadou, S. (2022). Natural language processing applied to mental illness detection: A narrative review. NPJ Digital Medicine, 5(1), 1–13. Zhang, W., Li, X., Deng, Y., Bing, L., & Lam, W. (2021, August). Towards generative aspect- based sentiment analysis. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers) (pp. 504–510).

More Articles from INTERNATIONAL JOURNAL OF COMPUTER SCIENCE AND MATHEMATICAL THEORY

Stochastic Techno-Economic Optimization of off-Grid Solar– Wind–Hydrogen–Battery Hybrid Renewable Energy Systems for Rural Electrification Using the Salp Swarm Algorithm

Author: Ganiyu Adedayo Ajenikoko, Andrew Oyekanmi Oke, Adekunle Sarafadeen Jimoh, Abdulbasit Oladayo Ajenikoko, Muhammed Daramola Kolapo, Israel Damilare, Olukotun, Corresponding Author

Comparative Performance Evaluation of Bayesian-Optimized Random Forest and Conventional Machine Learning Techniques for Predictive Maintenance of Nigerian Aging Transmission Lines

Author: Ganiyu Adedayo Ajenikoko, Abeega Andrew Aboityo, Abdulbasit Oladayo, Ajenikoko, Moshood Kola Omotosho, Abdul-Muezz Adesina Shittu, Israel Ogooluwa, Akinpade

The Imperative of Electronic Voting System for Transparent and Credible Elections in Nigeria

Author: Nwagu Okwudiri Godswill, Nnodi Joy Tochukwu PhD, Emenalom Samuel Chibueze