SentimentPulse Technical Overview

SentimentPulse is an AWS-based portfolio project that demonstrates both batch and real-time sentiment analysis using Amazon ECS on Fargate, AWS Lambda, Amazon API Gateway, Amazon S3, and Amazon Comprehend. This page focuses on the current architecture behind the demo and the design decisions I made around cost control, safe defaults, and public-demo simplicity.

Problems This System Solves

Many organizations collect large volumes of unstructured text such as product reviews, customer comments, surveys, and interactions with support personnel, for example. The data collected is obviously very valuable, but it does not scale well for manual reviews.

SentimentPulse demonstrates how AWS can be used to analyze this type of feedback in a structured, repeatable way. Instead of reading comments one by one, teams can classify sentiment, spot trends, and summarize overall mood more efficiently.

Quick demo video

I will be recording a short 3–4 minute walkthrough explaining the user flow and the key design choices:  Watch on YouTube  (coming soon)

High-level Architecture

At a high level, SentimentPulse has two related paths:

  • A batch analysis path on ECS Fargate that reads sample reviews from S3, processes a bounded set of records, calls Amazon Comprehend, and writes summarized results back to S3.
  • A real-time API path where the web page sends a short piece of text to API Gateway, which triggers a Lambda function that calls Comprehend’s DetectSentiment API and returns a single result to the browser.

Both paths use the same managed AI service, but for different use cases. The batch side shows how I would process a review dataset in a controlled containerized workflow, while the real-time side powers the interactive browser demo.

AWS Services Used

  • Amazon ECS / AWS Fargate – Runs the containerized batch sentiment workload.
  • Amazon S3 – Stores seed input files and batch output summaries.
  • Amazon Comprehend – Provides sentiment analysis (positive, negative, neutral, mixed).
  • AWS Lambda – Handles the real-time API requests from the web page.
  • Amazon API Gateway – Exposes a simple HTTPS endpoint for the front-end.
  • Terraform – Manages the infrastructure as code through Terraform Cloud.
  • AWS Budgets – Monitors Comprehend spend with dedicated budget alerts.

Together, these services show how I build a small but realistic sentiment-analysis workflow using standard AWS building blocks instead of one-off scripts.

Batch Pipeline (ECS / Fargate)

The batch path is designed to look like a lightweight analytics workload rather than a toy script. I use a sample review dataset stored in S3 as the seed input. In a real environment, those records could come from customer comments, product reviews, support tickets, or survey exports.

Terraform defines:

  • An ECS task definition that runs a Python-based container image stored in ECR.
  • An IAM task role with permission scoped to the S3 inputs/outputs and the Comprehend APIs required by the task.
  • CloudWatch logging so each run records progress, row counts, and estimated billed units.

Inside the container, the Python app:

  1. Reads seed input files from an S3 prefix.
  2. Loads and processes a bounded set of records per run.
  3. Calls Amazon Comprehend for sentiment analysis.
  4. Writes summarized output back to S3.
  5. Logs batch activity to CloudWatch Logs for troubleshooting and cost visibility.

Batch execution is intentionally controlled. It is not left running by default, because repeated sentiment-analysis calls against a metered AI service can create unnecessary cost.

Real-Time API Path

Users can type a short piece of text directly into the SentimentPulse demo page. The front end sends it to an API Gateway + Lambda endpoint, which calls Amazon Comprehend’s real-time DetectSentiment API and returns the result as both an overall label and the underlying score breakdown.

The flow is:

  1. The browser collects the user’s text input.
  2. JavaScript sends the text to an Amazon API Gateway endpoint using a POST request.
  3. API Gateway triggers an AWS Lambda function written in Python.
  4. The Lambda function calls Amazon Comprehend DetectSentiment.
  5. Lambda returns the sentiment label and confidence scores for the front-end display.

This real-time path keeps the visitor experience simple and responsive while still showing a real AWS integration behind the scenes.

Data and Buckets

The project uses S3 prefixes to separate concerns:

  • Seed data – sample review inputs used by the ECS batch job.
  • Outputs / summaries – sentiment-analysis results written by the batch workflow.

The real-time demo path does not store visitor text in S3. It sends the text to Lambda, calls Comprehend, and returns the result immediately so the demo stays lightweight.

Cost and Safety Guardrails

Because Amazon Comprehend is a metered service, I added controls to keep this project safe as a public-facing portfolio demo:

  • Input length limits – the front end and Lambda both enforce size limits before calling Comprehend.
  • MAX_RECORDS cap – the ECS container processes only a small bounded number of records per run.
  • Pinned image digest – the ECS task uses a specific ECR image digest instead of a floating tag.
  • Scheduler disabled by default – automatic batch execution is treated as an optional feature, not the default state.
  • AWS Budget alerts – Comprehend spend is monitored with dedicated cost alerts.

These controls came out of real troubleshooting and cost analysis. I wanted the project to remain useful as a demo without quietly reprocessing data in the background.

Infrastructure as Code

All AWS resources for SentimentPulse are managed with Terraform using a Terraform Cloud workspace tied to my Git repository. Changes to the ECS task, IAM roles, S3 layout, and Lambda/API Gateway integration are made in code rather than through ad hoc console edits.

That gives me repeatability, version history, and a cleaner way to evolve the architecture over time.

Why This Project Matters

SentimentPulse is not meant to be a production SaaS product. It is a portfolio project that shows:

  1. I can design and deploy a containerized batch workload on ECS Fargate.
  2. I can integrate a managed AI service like Amazon Comprehend into both batch and real-time workflows.
  3. I use Infrastructure as Code with Terraform and Terraform Cloud instead of one-off console builds.
  4. I think about cost, safety, and observability when exposing managed services in a public demo.

The SentimentPulse demo page keeps things simple for visitors. This technical overview is here for anyone who wants to see how the AWS side actually works.