Python in Sentiment Analysis: A Review with a Focus on Social Media Text
Research Article
Open Access
CC BY

Python in Sentiment Analysis: A Review with a Focus on Social Media Text

Zhihao Chen 1*
1 School of Computer Science, Zhuhai College of Science and Technology, Zhuhai, Guangdong, 519040
*Corresponding author: 13533880122@163.com
Published on 14 October 2025
Journal Cover
ACE Vol.191
ISSN (Print): 2755-273X
ISSN (Online): 2755-2721
ISBN (Print): 978-1-80590-184-6
ISBN (Online): 978-1-80590-129-7
Download Cover

Abstract

The exponential growth of user-generated content on social media platforms (e.g., Twitter, Weibo, Facebook) has created massive datasets rich in public sentiment. While sentiment analysis proves vital for understanding social trends, brand perception, and political developments, traditional methods struggle to handle the informal nature, noise, and context-dependent characteristics of social media language. This necessitates advanced computational technologies to extract meaningful insights. This paper summarizes the application of Python in social media text sentiment analysis, covering various methods supported by its NLP library (NLTK, TextBlob), machine learning/deep learning framework (TensorFlow, PyTorch), and discusses cross-platform comparative analysis and specific domain adaptation. The results indicate that Python-based models achieve high levels of accuracy. For example, the RoBERTa-BiLSTM-MHA model achieved an accuracy of 93.44%, and these models outperform conventional tools by 6–12% in terms of F1 scores. Key findings reveal cultural and platform-based disparities in sentiment expression. Specifically, Chinese social media platforms like Weibo emphasize economic sentiment, while Western platforms such as Twitter focus more on technical and ethical implications. The integration of sentiment dictionaries and multimodal data, including emojis, further enhances the robustness of these sentiment analysis models. Overall, this review underscores Python’s versatility in enabling scalable and real-time sentiment analysis, which in turn drives innovations in NLP research and practical applications.

Keywords:

Python NLP, Social Media Sentiment Analysis, Deep Learning Models, Cross-Cultural Sentiment Disparities

View PDF
Chen,Z. (2025). Python in Sentiment Analysis: A Review with a Focus on Social Media Text. Applied and Computational Engineering,191,46-51.

References

[1]. Zhang, E. K., Zhang, H. Z., Yao, J. C., & Wang, S. R. (2024). The dynamic evolution and dissemination structure of AIGC topics: A comparative analysis based on Weibo and Twitter. Journal of Xi'an Jiaotong University (Social Sciences), 44(3).

[2]. Batra, H., Punn, N. S., Sonbhadra, S. K., & Agarwal, S. (2021, August). Bert-based sentiment analysis: A software engineering perspective. In International Conference on Database and Expert Systems Applications (pp. 138-148). Cham: Springer International Publishing.

[3]. Pontes, E. L., & Benjannet, M. (2021, December). Contextual sentence analysis for the sentiment prediction on financial data. In 2021 IEEE International Conference on Big Data (Big Data) (pp. 4570-4577). IEEE.

[4]. Wang, L. L. (2019). Research and application of Chinese text sentiment classification based on deep learning (Doctoral dissertation, Xuzhou: China University of Mining and Technology).

[5]. Xue, T. (2021). A Python-based attention model for social sentiment analysis. Intelligent Computer and Applications.

[6]. Chaudhari, M. (2021). Sentimental emotion analysis using Python and machine learning. International Journal of Trend in Scientific Research and Development (IJTSRD), 5(4). Available online: www.ijtsrd.com. e-ISSN: 2456-6470.

[7]. Li, D. Y., Wang, Y. G., & Zhai, Q. Q. (2024). A deep learning-based method for sentiment analysis of online comments. Modeling and Simulation, 13, 5372.

[8]. Xie, R. Z., & Li, Y. (2020). A text sentiment classification model based on BERT and dual-channel attention. Journal of Data Acquisition & Processing, 35(4).

[9]. Joseph, T. (2024). Natural language processing (NLP) for sentiment analysis in social media. International Journal of Computing and Engineering, 6(2), 35-48.

[10]. Darshan, R., & Girish, A. (2023). Twitter sentiment analysis in Python. Journal of Emerging Technologies and Innovative Research (JETIR), 10(4).

Cite this article

Chen,Z. (2025). Python in Sentiment Analysis: A Review with a Focus on Social Media Text. Applied and Computational Engineering,191,46-51.

Data availability

The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.

About volume

Volume title: Proceedings of CONF-MLA 2025 Symposium: Intelligent Systems and Automation: AI Models, IoT, and Robotic Algorithms

ISBN: 978-1-80590-184-6(Print) / 978-1-80590-129-7(Online)
Editor: Hisham AbouGrad
Conference date: 17 November 2025
Series: Applied and Computational Engineering
Volume number: Vol.191
ISSN: 2755-2721(Print) / 2755-273X(Online)