AWS Builder Center
Track public sentiment about your brand with a serverless pipeline on AWS

Track public sentiment about your brand with a serverless pipeline on AWS

Score brand mentions with Amazon Comprehend in your AWS account, and alert your team when negative sentiment rises above each brand's baseline.

Authors: Sai Vaishnavi Rao Kandula, Dipen Patel

On a Friday evening, the fictional AnyCompany ships an app update with a sign-in bug. Within an hour, customers post complaints, leave one-star reviews, and open support tickets. The team learns about it on Monday from a weekly report.

Why watch sentiment shift

Volume also rises for good reasons, like a launch or a sale. Instead, compare each brand's negative share with its own baseline. A rise above it flags a change, even when volume looks ordinary.

Architecture overview

Figure-1: Reference architecture







How the pipeline works

Step 1- Amazon EventBridge Scheduler invokes an AWS Lambda function that pulls mentions only from official APIs, licensed providers, and channels you own. No scraping.
Step 2-Amazon Simple Queue Service (Amazon SQS) buffers mentions, with a dead-letter queue for failed ones.
Step 3- Amazon Comprehend detects sentiment and key phrases in each mention.
Step 4-Results go to Amazon DynamoDB, with an encrypted archive copy in Amazon Simple Storage Service (Amazon S3).
Step 5- Amazon CloudFront serves the dashboard from a private S3 bucket. Users sign in with Amazon Cognito, and Amazon API Gateway accepts only signed-in requests.
Step 6-A scheduled evaluator and Amazon CloudWatch alarms alert your team through Amazon Simple Notification Service (Amazon SNS).

Alerts

Suggested starting values, relative to each brand's baseline:

  1. NEGATIVE SURGE: negative share above the 90th percentile, with at least 20 mentions in the window.
  1. WATCH: negative share above the 75th percentile for two runs in a row, or a new phrase enters the top negative themes.
  1. DATA CHECK: a pipeline health alarm fires, or a brand's mentions are all neutral or have zero negatives.

Deploy it in your account

Review this design for security and compliance. Build it with the AWS Cloud Development Kit (AWS CDK) in a  Region where Comprehend is available , and store source credentials in AWS Secrets Manager. Most charges grow with usage, so set an  AWS Budgets  alert. When done, delete the stack and the data resources it retains.
You're responsible for complying with each source's terms and with privacy laws such as GDPR and CCPA.

Conclusion

These thresholds are starting points, not production measurements. Tune them per brand and product.
#amazon-comprehend #aws-lambda #amazon-sqs #amazon-dynamodb #aws-cdk
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article