top of page

Real-Time Social Media Sentiment Analysis Dashboard

NLP · BERT · Python · Laravel · SQL · AWS

1. Project Overview (MSc Dissertation Project) â€‹â€‹â€‹â€‹â€‹

This project delivers a real-time sentiment analysis system designed to monitor and analyse customer feedback from social media platforms. Using a fine-tuned BERT-based NLP model, the solution automatically classifies customer comments into sentiment categories and presents the results through an interactive web dashboard.

The system demonstrates an end-to-end analytics pipeline, from data ingestion and machine learning inference to database storage and real-time visualisation, replicating a production-style analytics environment.

2. Problem Statement â€‹â€‹â€‹â€‹â€‹

Retail organisations generate large volumes of unstructured customer feedback through social media channels. Manual analysis of this data is inefficient and does not scale, limiting an organisation’s ability to:

  • Detect emerging customer sentiment trends

  • Respond quickly to negative feedback

  • Measure the impact of campaigns or operational changes

This project addresses the problem by creating an automated, real-time sentiment analytics platform that transforms raw social media text into actionable insights for business decision-making.

3. Project Objectives â€‹â€‹â€‹â€‹â€‹

  • Build a real-time data pipeline for collecting and processing social media comments

  • Fine-tune a BERT sentiment classification model for retail-related text

  • Store sentiment results in a structured relational database

  • Design an interactive dashboard for hourly, daily, and monthly sentiment analysis

  • Deploy the solution on cloud infrastructure to simulate a real-world environment

4. Data & Machine Learning​​​​​

Dataset

  • Social media comments collected via Facebook API

  • Supplemented with 250,000+ labelled customer reviews (Kaggle – TeePublic dataset) for model training

NLP Model

  • Model: nlptown/bert-base-multilingual-uncased-sentiment

  • Frameworks: TensorFlow, Hugging Face Transformers

  • Approach:

    • Text cleaning and tokenisation

    • Fine-tuning on retail-focused sentiment data

    • Classification into: Negative, Neutral, Positive, Very Positive

5. System Architecture​​​​

End-to-End Workflow

  1. Data Collection

    • Python scripts retrieve Facebook comments

    • Comments stored in SQL with timestamped records

  2. Sentiment Pipeline

    • Hourly batch of comments processed through BERT model

    • Sentiment distributions generated for each hour

  3. Backend Orchestration

    • Laravel controllers trigger Python scripts

    • Hour-based windowing logic applied

    • Sentiment snapshots persisted in database

  4. Visualisation Layer

    • AJAX-powered Laravel dashboard

    • Near real-time updates without page refresh

6. Dashboard Design & Features​​​​​

Sentiment analytics dashboard

Live Sentiment (Last Hour)

  • Donut chart showing the most recent sentiment distribution

  • Enables rapid detection of sentiment spikes

Daily Sentiment Analysis

  • Hourly sentiment trend for selected dates

  • Navigation buttons to move between days

Monthly Sentiment Trends

  • Aggregated daily sentiment trends for selected months

  • Identifies long-term sentiment patterns

Interactive Features

  • Dynamic date and month navigation

  • Hover tooltips and legends

  • Responsive layout supporting mobile view

7. Backend & Data Engineering​​​​​

Laravel Controllers

  • ScraperController

    • Executes Python scripts via scheduled jobs

    • Handles comment ingestion and sentiment pipeline execution

  • GraphController

    • Exposes REST endpoints for:

      • Full sentiment history

      • Hourly breakdown

      • Monthly aggregation

      • Live sentiment snapshot

SQL Database

  • Normalised schema for posts, comments, and sentiment snapshots

  • Supports time-series analysis at hourly, daily, and monthly levels

​​

Deployment

  • Cloud Platform: AWS EC2 (Windows Server)

  • Application Stack:

    • Laravel backend

    • Python NLP pipeline

    • SQL database

  • Designed to mirror a real-world production deployment

8. Key Outcomes & Insights​​​​​

  • Successfully implemented an automated real-time sentiment monitoring system

  • Demonstrated practical integration of machine learning with web applications

  • Enabled time-based sentiment analysis to support business decision-making

  • Showcased production-style architecture combining NLP, backend engineering, and analytics

9. Tools & Technologies Used​​​​​

  • Languages: Python, PHP, SQL

  • ML & NLP: BERT, TensorFlow, Hugging Face

  • Backend: Laravel, REST APIs

  • Frontend: Blade, AJAX, Chart.js

  • Cloud: AWS EC2

10. Links​​

​🔗 GitHub:

       https://github.com/manpb/realtime-sentiment-analytics-dashboard.git

​

11. Academic Context​​

This project was developed as part of an MSc Information Technology Management dissertation at Sheffield Hallam University, combining academic research with an industry-focused technical implementation.

bottom of page