Skip to content
Open access

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

Sep 2026 · Al-Nahrain Journal of Science · 0 citations

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.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.