DEV Community

Cover image for Manage Your Brand Reputation - AWS Comprehend
Subhankar De
Subhankar De

Posted on • Updated on

Manage Your Brand Reputation - AWS Comprehend

Motivation

In order to genuinely understand customers and increase retention, businesses need to focus a big part of their resources and manpower on customer feedback. The way someone approaches feedback can make or break their business.

The best way we can handle this is through digitization rather waiting for someone to reach the customer and get the feedback. After a customer leaves a feedback ‒ whether it’s to complain or appreciation on Twitter, email or voice there’s always an underlying emotion. With sentiment analysis, you can capture this subjective information to understand your customers better. Address the negative sentiment on priority and leverage the positive feedback for betterment of the business.

The below solution is a scaled down version of a sentiment analysis where a customer service associate exports customer feedback from Twitter, email or text from a voice call to a CSV file. As soon as this file is uploaded to a S3 bucket, sentiment analysis is done on each input and persisted into a DynamoDB table for further action.

Technology

  • AWS Lambda
  • AWS Step Function
  • AWS Comprehend
  • DynamoDB
  • Serverless Framework

Steps

  • The user uploads a CSV file with the feedback to S3
  • Currently supports English(EN) & Spanish(ES) in which the customer had given their feedback
  • S3 triggers a Lambda to read the file
  • Step Function does batch processing of the feedback by language using AWS Comprehend
  • This application inspects a batch of documents and returns an inference of the prevailing sentiment, POSITIVE, NEUTRAL, MIXED, or NEGATIVE, in each one
  • The processed files are copied to another S3 bucket
  • The number of documents in the request has a limit of 25
  • Each document must contain fewer that 5,000 bytes of UTF-8 encoded characters

Sample CSV file

datetime,account_number,language_code,text

  • 2/12/01,333,en,you are awesome
  • 2/13/01,375,es,Eres asombroso

image

Link to Github!

Future enhancement

  • Move the DynamoDB Put request from computeSentiment Lambda function to Step Functions
  • Generate customer sentiment from the call recording with the IVR
  • Use AWS Transcribe to convert it into text and then use the above flow

Top comments (0)