SentimentanalysisisakeytaskinNaturalLanguageProcessing(NLP)thatinvolvesclassifying emotions, opinions, and sentiments from text. Traditional machine learning models such as Naïve Bayes, Support Vector Machines (SVM), and Random Forest have been commonly used for this purpose, but they struggletocapturethecomplexsequentialdependencieswithintext.ThisstudyexplorestheuseofBi-directional Long Short-Term Memory (BiLSTM) networks, combined with pre-trained GloVe embeddings, for sentiment classification. The performance of the BiLSTM model is compared to traditional models and the transformer- based BERT model to assess its computational efficiency and accuracy. While BERT outperforms BiLSTM in accuracy, the BiLSTM model offers competitive performance with greater computational efficiency. This research lays the groundwork for future improvements in sentiment analysis, particularly in real-time applications and multilingual data processing.
Introduction
Sentiment analysis is critical for applications such as social media monitoring, consumer feedback, and mental health evaluation. The growing volume of text data has led to the development of scalable and accurate methods to extract sentiment and emotional context. Traditional machine learning models like Naïve Bayes, SVM, and Random Forest have limitations in capturing the sequential and contextual nature of text. Deep learning models, especially Bi-directional Long Short-Term Memory networks (BiLSTM), are more effective because they analyze text in both forward and backward directions, capturing richer context and long-term dependencies.
This research explores BiLSTM combined with GloVe word embeddings (which encode semantic relationships in a continuous vector space) for sentiment classification. The study compares BiLSTM + GloVe against traditional ML models and the transformer-based model BERT. Results show that while BERT achieves the highest accuracy (~90%), BiLSTM with GloVe attains a strong accuracy of 83.42% with significantly lower computational cost, making it suitable for resource-constrained environments.
The methodology includes collecting a multilingual, code-mixed dataset with annotated emotions (e.g., anxiety, depression, stress), followed by preprocessing, tokenization, feature extraction using GloVe, model training, and evaluation using accuracy, precision, recall, and F1-score. BiLSTM outperforms traditional ML models by effectively capturing the sequential dependencies in text, though it is slightly less accurate than BERT.
The study highlights the trade-off between accuracy and efficiency, positioning BiLSTM with GloVe embeddings as a balanced, practical solution for real-time sentiment analysis and emotion detection, especially where computational resources are limited.
Conclusion
This research successfully integrates advanced machine learning and deep learning techniques for emotion detection, using GloVe embeddings with BiLSTM networks to achieve high accuracy in sentiment classification. The study highlights the power of deep learning models in addressing challenges like handlingmultilingualdatasetsandculturally diverse contexts, which are vital for real- world sentiment analysis applications. The combination of GloVe embeddings and BiLSTM networks has proven highly effective, as these models can capture the complexities of sentiment and emotion in textual data.
The findings demonstrate that these models are particularly suited for applications in mental health, customer feedback, andsocial media monitoring, where understanding sentiment is critical.
Looking ahead, future research will focuson enhancing contextual understanding through advanced transformer models like BERT to capture deeper language patterns. Additionally, there will be a focus on handling code-mixed and low-resource languages to improve the versatility of sentiment analysis systems across different linguistic and cultural contexts. Furthermore, real-time sentiment analysis will be explored to enable timely responses in critical applications such as crisis management and customer service. In Conclusion,with furtheradvancements, this approach can be expanded to handle a broader range of languages making it an invaluabletoolforavarietyofindustries.
References
[1] P.Rajendran,N.S.Vishnu,andK.A.R. S. M. Y. Ganesh, “A Comparative StudyofEmotionDetectioninTextusing Deep Learning Models,” International Journal of Computer Applications, vol. 177,no.1,pp.10–18,2020.[DOI:10.5120/ijca2020917949].
[2] Sharma, R. Kumar, and S. S. Bhattacharyya, “Emotion Detection using BiLSTM and GloVe for Mental Health Diagnosis,” IEEE Transactions on Affective Computing, vol. 12, no. 3, pp. 387–397,2021.[DOI:10.1109/TAFFC.2020.2995268].
[3] S. S. V. B. S. J. Meena, “An Overview of Recent Advances in Sentiment Analysis Techniques for Text Classification,” Journal of Artificial Intelligence Research, vol. 69, pp. 1–24, 2021. [DOI: 10.1613/jair.1.11816].
[4] R. B. Gupta, S. C. Garg, and M. G. Krishna, “Challenges in Sentiment Analysis: A Comprehensive Survey,” Journal of Data Science, vol. 22, no. 3,31–56,2022.[DOI: 10.1214/jds2022.049].
[5] L. Zhang, J. Song, and C. Y. Y. Liu, “Emotion Detection from Text: A Survey on Methods and Challenges,” International Journal of Machine Learning and Cybernetics, vol. 13, no. 4,1153–1167, 2022. [DOI: 10.1007/s13042-022-01645-3].
[6] R. K. Sharma, P. R. Kumar, and S. Gupta, “Recent Advances in NLP and Emotion Detection Models for Mental Health Applications,” IEEE Access, vol. 10, pp. 55678–55695, 2022. [DOI:10.1109/ACCESS.2022.3168417].
[7] Narayan, D. S. Vijay, and R. K. Verma, “Addressing Data Imbalance in Sentiment Analysis Tasks,” Computer Science Review, vol. 49, pp. 1–15, 2023. [DOI: 10.1016/j.cosrev.2023.100467].
[8] M. S. Dev, M. Kumar, and R. Tiwari, “Applications of Sentiment Analysis in Business and Healthcare: A Review,” Journal of Applied Computing and Informatics, vol. 21, no. 2, pp. 56–70,2023. [DOI: 10.1016/j.jaci.2022.12.003].
[9] Alonso, O., et al., \"Tokenization and its impact on text analysis,\" Journal of NLP Studies, 2020.
[10] Chen, J., et al., \"Emotion detection in text using machine learning and deep learning methods,\" IEEE Transactions on Affective Computing, 2021.
[11] Devlin, J., et al., \"BERT: Pre-training of deep bidirectional transformers for language understanding,\" NAACL-HLT, 2020.
[12] Kumar, R., & Bhatia, S., \"Text preprocessing for emotion detection: Techniques andchallenges,\" International Journal of Data Science, 2021.
[13] Li, X., et al., \"Improving emotion recognition with GloVe embeddings,\" Journal of Machine Learning Research, 2021.
[14] Mikolov, T., et al., \"Efficient Estimation of Word Representations in Vector Space,\" ICLR, 2018.
[15] Pennington, J., et al., \"GloVe: Global Vectors for Word Representation,\" EMNLP, 2014.
[16] Rao, S., et al., \"Applications of sentiment analysis in mental health care,\" International Journal of Healthcare Research, 2021.
[17] Sun, X., et al., \"BERT-based models for emotion classification,\" Journal of AI Research, 2020.
[18] Vaswani, A., et al., \"Attention is all you need,\" NeurIPS, 2017.
[19] Xu, W., et al., \"Challenges in emotion detection in text: A systematic review,\" Journal of AI and Emotion Science, 2020.
[20] Yang, Z., et al., \"Sentiment and emotion detection using deep learning techniques,\" Journal of Deep Learning in NLP, 2020.
[21] Zhao, P., et al., \"Annotation methods for emotion detection in text,\" Machine Learning and Applications, 2021.