DEV Community

Cover image for Sentiment Analysis using AWS Comprehend & Lambda
Anmol Pal for AWS Community Builders

Posted on • Edited on

2

Sentiment Analysis using AWS Comprehend & Lambda

Design a serverless sentiment analysis system leveraging AWS services.

Requirement

Gather the input text (that could be a comment or a feedback on a survey, etc) and feed it into a compute service that figures out the sentiment from the text & saves it into a database.

Glossary

SQS: It is a managed message queuing service that lets enables us to decouple and scale serverless applications by sending, storing, and receiving messages.

Lambda: It is a serverless compute service that allows us to run code without managing servers and worrying about scaling.

Comprehend: It is an NLP service that helps us extract key phrases, sentiment, PII, syntax, entities, identify language, and more.

RDS: It is a managed relational DB service that simplifies setting up, operating & scaling relational databases on cloud (AWS).

Design Solution
Image description

Implementation Plan

  • An SQS queue that stores messages and triggers Lambda function.

  • The Lambda function processes the message body and invokes Comprehend to infer the sentiment from the text.

  • Finally the Lambda function stores the text and inferred sentiment into a table in RDS.

Here's the link to the code: https://github.com/anmol111pal/Sentiment-Analyzer


Follow me on my socials

Linkedin: https://www.linkedin.com/in/anmol-pal/

Github: https://github.com/anmol111pal

Twitter/X: https://x.com/anmol111pal

Top comments (0)

👋 Kindness is contagious

Embark on this engaging article, highly regarded by the DEV Community. Whether you're a newcomer or a seasoned pro, your contributions help us grow together.

A heartfelt "thank you" can make someone’s day—drop your kudos below!

On DEV, sharing insights ignites innovation and strengthens our bonds. If this post resonated with you, a quick note of appreciation goes a long way.

Get Started