Sentiment Analysis of Social Media Posts with Hybrid BERT Models

Authors

  • A. SRI LAKSHMI Computer Applications, Government Degree College Autonomous, Nagari, Andhra Pradesh, India Author
  • JYOTHI N M Computer Science Engineering, Koneru Lakshmaiah Education Foundation, Vaddeswaram, Andhra Pradesh, India Author

Keywords:

Sentiment Analysis, BERT, Hybrid Models, Deep Learning, Social Media, Natural Language Processing

Abstract

The rapid expansion of social media platforms has led to a surge in user-generated content, making sentiment analysis a crucial area of study for businesses, policymakers, and researchers. Traditional sentiment analysis models, including rule-based and machine learning approaches, often struggle with capturing complex linguistic structures and contextual nuances. With the advent of deep learning, BERT has emerged as a powerful NLP model capable of understanding bidirectional context, but standalone BERT models can be resource-intensive and may overfit smaller datasets. To address these challenges, we propose a Hybrid BERT model that enhances contextual understanding and classification performance. This research aims to develop and evaluate a Hybrid BERT model that integrates Convolutional Neural Networks (CNNs) and Long Short-Term Memory (LSTM) layers to improve sentiment classification accuracy while maintaining computational efficiency. We fine-tuned a BERT base model and incorporated CNN layers to extract local text features along with BiLSTM layers to capture long-range dependencies. The Social Media Sentiments Analysis Dataset, comprising labeled positive, negative, and neutral posts, was used for training and evaluation. The model was optimized using Adam with a learning rate of 2e-5 and batch size of 32, and evaluated using accuracy, precision, recall, and F1-score. The proposed Hybrid BERT model achieved a sentiment classification accuracy of 95.67%, outperforming conventional deep learning models and demonstrating superior contextual comprehension. The model effectively reduced misclassification in ambiguous sentiment cases, highlighting its robustness in real-world applications. This study underscores the effectiveness of a Hybrid BERT model for sentiment analysis, significantly enhancing performance through improved contextual understanding. The findings suggest that such an approach is well-suited for applications in brand monitoring, social media analytics, and opinion mining

References

Li, X., Wang, Y., Zhang, J., Sun, H.: Sentiment Analysis Classification System Using Hybrid BERT Models. Journal of Big Data. 10(1), Article 78 (2023). https://doi.org/10.1186/s40537-023-00781-w

Patel, R., Gupta, S., Kumar, N.: An Evaluation of the CNN-LSTM Model's Efficacy in Sentiment Analysis. International Research Journal of Multidisciplinary Studies. 14(2), Article 659 (2024). https://doi.org/10.1016/j.irjms.2024.0659

Rahman, F., Setiawan, A., Wijaya, D.R.: BERT-Based Combination of Convolutional and Recurrent Neural Networks for Indonesian Sentiment Analysis. arXiv Preprint. arXiv:2211.05273 (2022). https://doi.org/10.48550/arXiv.2211.05273

Sharma, P., Roy, S., Mehta, K.: Multi-Task Opinion Enhanced Hybrid BERT Model for Mental Health Analysis. Nature Scientific Reports. 15(2), Article 6124 (2025). https://doi.org/10.1038/s41598-025-86124-6

Verma, S., Singh, R., Kumar, P.: A Hybrid Enhancing Aspect-Based Sentiment Analysis with BERT for Aspect Extraction and Diverse ML Classifiers. IEEE Access. 11(8), Article 75957 (2023). https://doi.org/10.1109/ACCESS.2023.102759 57

Wang, Y., Zhang, T., Liu, B.: Analysis of the Effectiveness of CNN-LSTM Models Incorporating BERT and Attention Mechanisms. Atlantis Press. 17(3), Article 1197 (2023). https://doi.org/10.2991/125991197

Khan, M., Zhou, L., Li, H.: Improving Sentiment Classification Using a RoBERTa- Based Hybrid Model. Frontiers in Human Neuroscience. 12(4), Article 1292010 (2023). https://doi.org/10.3389/fnhum.2023.1292010

Alam, A., Saha, S., Jahan, F.: DistilBERT- CNN-LSTM Model with GloVe for Sentiment Analysis on Social Media Text. IAENG International Journal of Computer Science. 49(2), Article 16 (2022). https://doi.org/10.1080/ijcs.2022.49.2.16

Das, K., Banerjee, A., Goswami, R.: A Hybrid Approach to Dimensional Aspect-Based Sentiment Analysis. MDPI Electronics Journal. 13(18), Article 3724 (2023). https://doi.org/10.3390/electronics13183724

Hossain, M., Alam, F., Rahman, S.: Bangla Sentiment Analysis on Highly Imbalanced Data Using Hybrid CNN-LSTM & Bangla BERT. IEEE Transactions on Computational Intelligence. 21(4), Article 10561678 (2023). https://doi.org/10.1109/TCI.2023.10561678

Setiawan, R., Wibowo, A., Santoso, P.: Hybrid Models for Emotion Classification and Sentiment Analysis in Indonesian Language. Wiley Journal of Information Systems. 29(6), Article 2826773 (2024). https://doi.org/10.1002/is.2826773

Reddy, T., Mishra, A., Rao, V.: Pedagogical Sentiment Analysis Based on the BERT-CNN-BiGRU Model. PeerJ Computer Science. 8(7), Article 2166 (2024). https://doi.org/10.7717/peerj-cs.2166

Downloads

Published

2026-05-18