Real-Time Sentiment Analysis of Reddit Comments Using “RoBERTa”: A Natural Language Processing Pipeline Leveraging Amazon Kinesis and “SageMaker”

Authors

  • Hiba J. Aleqabie 1Artificial Intelligence Engineering Department, College of Information Technology Engineering, Al-Zahraa University for Women. Karbala, Iraq. 2Computer Science Department, College of Computer Science and Information Technology, University of Kerbala, Kerbala, Iraq.

DOI:

https://doi.org/10.22401/anjs.29.3.2990

Keywords:

Amazon , AWS Kinesis , Real-time Sentiment Analysis, SageMaker , RoBERTa , Reddit comments

Abstract

With the explosion of social media platforms, a great volume of user-generated content is available, creating a need for effective ways to analyze public opinion. While this process has and continues to provide marketers and researchers with valuable insights that can be utilized, the technology of yesterday pales in comparison to the staggering amount of data now available. This study attempts to identify and overcome the above challenges by using deep learning techniques for real-time sentiment analysis of Reddit comments, facilitated by AWS Kinesis and SageMaker. Using the RoBERTa transformer model, we built a resilient NLP pipeline to stream, process, and analyze user comments. The dataset is prepared for 100,000 Reddit comments via AWS Kinesis Data Streams in the preprocessing step and sentiment classification. Module RoBERTa gave strong results for the task and reached an accuracy of 92% with 90% precision and 89% recall. The model has an f1 score of 89.5% and an ROC-AUC score of 0.95, which says — it is a good model for sentiment classification (i.e., to predict positive sentiments). Thus, our approach in taking only 4 hours to train and utilizing state-of-the-art transformer-based architectures can be applied in cloud-based infrastructures for interaction with the public sentiment and discourse at an inference runtime of just 30 milliseconds per comment.

References

[1] Medhat, W. l.; Hassan, A.; Korashy, H.; “Sentiment Analysis Algorithms and Applications: A Survey”. Ain Shams Eng. J., 5(4): 1093–1113, 2014.

[2] Khan, S. S.; Alharbi, Y.; “Sentiment analysis of movie review classifications using deep learning approaches,” Int. J. Adv. Appl. Sci., 11(8): 146–157, 2024.

[3] Pham, K.; Kathala, K.C.R.; Palakurthi, S., Reddit Sentiment Analysis on the Impact of AI Using VADER, TextBlob, and BERT. Procedia Comp. Sci., 258(4): 886–892, 2025.

[4] Gill, S.S.; Wu, H.; Patros, P.; Ottaviani, C., Arora, P., Casamayor Pujol, V., Haunschild, D., et al., "Modern computing: Vision and challenges". Telemat. Informatics Reports, 13: 100116, 2024.

[5] Lele, V., Kumari, S., White, G., "Streamlining Production: Using Big-Data’s CRM & Supply Chain To Improve Efficiency In High-Speed Environments". Int. J. Curr. Sci., 13(2): 2250–1770, 2023.

[6] Guerra, P.C., Meira Jr., W., Cardie, C., “Sentiment analysis on evolving social streams: How self-report imbalances can help”. In: Proceedings of the 7th ACM International Conference on Web Search and Data Mining, New York, NY, USA, 24–28 February 2014, Baeza-Yates, R., Bennett, P., Diaz, F., Cambazoglu, B.B., Castillo, C. ACM: New York, NY, USA, 2014, pp. 443–452.

[7] Taherdoost, H., "An Overview of Trends in Information Systems: Emerging Technologies that Transform the Information Technology Industry". Cloud Comput. Data Sci., 4(1): 1–16, 2022.

[8] Sharma, S., Bvuma, S., Thakkalapelli, D., “Comparative Analysis of Data Storage Solutions for Responsive Big Data Applications”. Int. Peer Rev./Ref. Multidisc. J (EIPRMJ), 12 (2): 244–250, 2023.

[9] Khan, M., Alqahtani, A., Alharbi, N., Real-Time Sentiment Analysis on social media Streams Using Deep Learning Models. IEEE Access, 11(1): 74215–74228, 2023.

[10] Meshram, S., Balani, N., Jha, P., "Sentiment Analysis of Statement". IOSR J Eng, 9 (5): 46-49, 2019.

[11] On, J., Park, H.A., Song, T.M., “Sentiment analysis of social media on childhood vaccination based on ontology”. J. Med. Internet Res., 21(6): e13012, 2019.

[12] Armbrust, M., Fox, A., Griffith, R., Joseph, A.D., Katz, R.H., Konwinski, A., Lee, G., Patterson, D.A., Rabkin, A., Stoica, I., Zaharia, M., “A View of Cloud Computing”. Commun. ACM, 53(4): 50–58, 2010.

[13] Biswas, S., Wardat, M., Rajan, H., “The Art and Practice of Data Science Pipelines: A Comprehensive Study of Data Science Pipelines in Theory, In-The-Small, and In-The-Large.” Proceedings of the 44th International Conference on Software Engineering (ICSE 2022, Pittsburgh, PA, USA, May 21–29, 2022, ACM, New York, NY, USA, pp. 1-13, 2022.

[14] Kolluri, S. “Automating Data Pipelines with AI for Scalable, Real-Time Process Optimization in the Cloud.”Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., 10(6): 2070–2070, 2024.,

[15] Klein, A.Z., Magge, A., O’Connor, K., Flores Amaro, J.I., Weissenbacher, D., Gonzalez Hernandez, G., "Toward Using Twitter for Tracking COVID-19: A Natural Language Processing Pipeline and Exploratory Data Set". J Med Internet Res., 23(1): e25314, 2021.

[16] Orosz, G., Szabó, G., Berkecz, P., Szántó, Z., Farkas, R., “Advancing Hungarian Text Processing with HuSpaCy: Efficient and Accurate NLP Pipelines”. In: Text, Speech and Dialogue: 26th International Conference on Text, Speech and Dialogue, TSD 2023, Pilsen, Czech Republic, September 4–6, 2023, Ekštein, K., Pártl, F., Konopík, M., Eds., Springer: Cham, Switzerland, pp. 58-69, 2023.

[17] Stylos, N., Zwiegelaar, J., Buhalis, D., "Big data empowered agility for dynamic, volatile, and time-sensitive service industries: the case of tourism sector". Int. J. Contemp. Hosp. Manag., 33(3): 1015–1036, 2021.

[18] Tao, D., Yang, P., Feng, H., "Utilization of text mining as a big data analysis tool for food science and nutrition". Compr. Rev. Food Sci. Food Saf., 19(2): 875–894, 2020.

[19] Asudani, D.S., Nagwani, N.K., Singh, P., "Impact of Word Embedding Models on Text Analytics in Deep Learning Environment: A Review". Artif. Intell. Rev., 56(9): 10345–10425, 2023.

[20] Asudani, D.S.; Nagwani, N.K.; Singh, P.; "Impact of Word Embedding Models on Text Analytics in Deep Learning Environment: A Review". Artif. Intell. Rev., 56(9): 10345–10425, 2023.

[21] Deng, J., Liu, Y., "Research on Sentiment Analysis of Online Public Opinion Based on RoBERTa–BiLSTM–Attention Model". Appl. Sci., 15(4): 2148, 2025.

[22] Kulvanitchaiyanunt, A.A., "A Theoretical and Practical Exploration of Generative AI in AWS Architectures Enhancing Cloud-Based Data Processing and Intelligent Service Deployment". Int. J. Sci. Comput. Sci. Inf. Technol. Res., 6(1): 13–23, 2025.

[23] Taherdoost, H., “An Overview of Trends in Information Systems: Emerging Technologies that Transform the Information Technology Industry”. Cloud Comput. Data Sci., 4(1): 1–16, 2022.

[24] Ali, H., Tanveer, U., Saeed, A., Alkahtani, H.K., Alzahrani, K.J., Akbayan, B., “Cloud-based machine learning for scalable classification of software requirements: Insights from the PROMISE dataset”. Syst. Soft Comput, 7: 200405, 2025.

[25] Karimi-Mamaghan, M., Mohammadi, M., Meyer, P., Karimi-Mamaghan, A.M., Talbi, E.-G., "Machine learning at the service of meta-heuristics for solving combinatorial optimization problems: A state-of-the-art". Eur. J. Oper. Res., 296(2): 393–422, 2022.

[26] Pacios, D., “Amazon Web Service–Google Cross-Cloud Platform for Real-Time Image Processing and Machine Learning using AWS Lambda and SageMaker”. Information, 16 (5): 381, 2025.

[27] Mishra, A., Machine Learning in the AWS Cloud: Add Intelligence to Applications with Amazon SageMaker and Amazon Rekognition, 1st ed., John Wiley & Sons: Hoboken, NJ, USA, 2019.

[28] Germann, U., Liepins, R., Gosko, D., Barzdins, G., "Integrating Multiple NLP Technologies into an Open-source Platform for Multilingual Media Monitoring." Proceedings of Workshop for NLP Open Source Software (NLP-OSS), 2018.Melbourne, Australia, July 2018; Germann, U., Koehn, P., Zeman, D., Eds, Association for Computational Linguistics: Melbourne, Australia, 2018, pp. 47–51.2018.

[29] Kreuzberger, D., Kühl, N., Hirschl, S., “Machine Learning Operations (MLOps): Overview, Definition, and Architecture”. IEEE Access, 11: 31866–31879, 2023.

[30] Daniel, F., Papadopoulos, G.A., Thiran, P.,“Smarter Mobile Apps through Integrated Natural Language Processing Services.” In: Mobile Web Information Systems, MobiWIS 2013, Paphos, Cyprus, 26–28 August 2013. Daniel, F., Papadopoulos, G. A., Thiran, P., Eds. Springer Berlin Heidelberg: Berlin, Heidelberg, 2013.

[31] Saloot, M.A., Pham, D.N., “Real-time Text Stream Processing: A Dynamic and Distributed NLP Pipeline”. In: Proceedings of the 2021 International Symposium on Electrical, Electronics and Information Engineering, New York, NY, USA, 2021, ACM International Conference Proceedings Series, pp. 575–584.

[32] Li, S., Xie, Z., Chiu, D.K.W., Ho, K.K.W., "Sentiment Analysis and Topic Modeling Regarding Online Classes on the Reddit Platform: Educators versus Learners". Appl. Sci., 13(4): 2250, 2023.

[33] Silva, D. de O., da Silva, R.M.A., Lima, P.V. de S., Batista, J.C.P., Xavier Junior, S.F.A., "Reddit Comment Analysis: Sentiment Prediction and Topic Modeling using VADER and BERTopic". Socioecon. Anal., 2(1): 130–136, 2024.

[34] Yan, T., Liu, F. “COVID-19 sentiment analysis using college subreddit data”. PLoS One, 17(11): e0275862, 2022.

[35] Hasan, Z., Singh, A., Yadav, R.K., "Comparison of Sentiment Analysis using VADER and RoBERTa". Int. J. Innov. Res. Comput. Commun. Eng., 12 (Special Issue): 103–109, 2024.

Downloads

Published

2026-09-15

Issue

Section

Computer Science

How to Cite

(1)
J. Aleqabie, H. . Real-Time Sentiment Analysis of Reddit Comments Using “RoBERTa”: A Natural Language Processing Pipeline Leveraging Amazon Kinesis and “SageMaker.” Al-Nahrain J. Sci. 2026, 29 (3), 219-225. https://doi.org/10.22401/anjs.29.3.2990.