Feedback Sentiment Analyzer (FSA) is an example application that showcases AWS services and SDKs. Built with ❤️ for you to explore, download, and deploy.
Specifically, this application solves a fictitious use case of a hotel in New York City that receives guest feedback on comment cards in a variety of languages.
These comment cards are uploaded through a web client, transformed using a suite of machine learning services, and rendered through the same web client. The end result contains the original image, an English translation of the text, and an audio element.
This application has been implemented with the following AWS SDKs.
To deploy one of these implementations, follow the Deployment instructions.
This application uses a suite of AWS machine learning services to do the following:
- Extract text using Amazon Textract
- Detect sentiment using Amazon Comprehend
- Translate to English using Amazon Translate
- Synthesize to human-like speech using Amazon Polly
Additionally, the application showcases the following AWS services:
- Amazon Simple Storage Service (Amazon S3) - Stores images of comment cards
- Amazon EventBridge - Relays events from Amazon S3
- AWS Lambda - Executes business logic
- AWS Step Functions - Orchestrates multiple Lambda functions
- Amazon DynamoDB - Stores details about each comment
- Amazon API Gateway - Routes requests from frontend to backend
- Amazon CloudFront - Distributes this application globally
- Amazon Cognito - Authenticates users
This application is deployed using the AWS Cloud Development Kit (AWS CDK).
-
Get AWS credentials.
-
Set the following environment variables:
FSA_NAME
- Any text less than 10 charactersFSA_EMAIL
- A valid email address that you ownFSA_LANG
- Any of the implemented languages
For example:
Bash
export FSA_NAME=ana export [email protected] export FSA_LANG=ruby
Windows cmd
set FSA_NAME=ana set [email protected] set FSA_LANG=ruby
Windows Powershell
$Env:FSA_NAME = ana $Env:FSA_EMAIL = [email protected] $Env:FSA_LANG = ruby
-
Run the following commands:
cd cdk npm install cdk deploy
After deploying, observe the
Output
in your terminal session. Copy the CloudFront distribution URL, which haswebsiteurl
in the name. Paste this URL into a browser to launch the application.
- Choose
Sign in
. - Enter the the email from
FSA_EMAIL
into theUsername
field. - Enter the temporary password that was sent to you into the
Password
field.
- Reset your password as prompted.
- Signing in directs you to a landing page that says
No data found
.
- Choose
Upload
. - Choose
Select a file
.
Note: Feel free to choose a sample comment instead of writing your own. 4. Select a PNG or JPEG image that contains a positive comment about the hotel. Negative comments are saved, but not returned to the frontend.
- Choose
Upload
.
- Wait. The image upload takes a minute or two to process. CloudFront will also cache API responses for five minutes. To speed things up, create a CloudFront invalidation.
- Choose the
Refresh
button.
- You should see a card with the original image, translated text, and a play button.
- Choose the play button to listen to the translated audio.