Analyzing and optimizing Amazon Lex conversations using Dashbot

0
20


This post is co-written by Arte Merritt, co-founder and CEO of Dashbot. In their own words, “Dashbot is an analytics platform for chatbots and voice skills that enables enterprises to increase engagement, satisfaction, and conversions through actionable insights and tools.”

After you have deployed a bot, it is critical to analyze bot interactions, learn from this analysis, and use these learnings to improve the end-user experience. Conversational interfaces are easier to analyze than websites and mobile applications. You can infer user behavior directly from conversations instead of guessing what your users want by stitching together page views and choosing events. Your users are telling what they want in their own words and communicating their needs, aspirations, expectations, and frustrations. It’s up to you to listen, learn, and optimize your application from this valuable data.

We are excited to share that you can now easily integrate your Amazon Lex interface with Dashbot—an analytics and optimization platform built from the ground up to analyze and understand conversational applications. Dashbot provides the reports that you would expect from an analytics platform, such as user counts, retention metrics, and funnel tracking. Additionally, Dashbot provides several solutions built specifically for conversational applications, such as searchable transcripts, conversation paths, and phrase clusters.  In this post, we describe how to analyze interactions with an Amazon Lex bot using Dashbot capabilities.

Solution Architecture

You will use an AWS Lambda function to stream conversation log data from Amazon CloudWatch Logs. You will set up an event to trigger a Lambda function from the log group. The Lambda function will post JSON data to your Dashbot account. With these resources in place, you can then create your dashboard in Dashbot.

Analyzing and optimizing Amazon Lex conversations using Dashbot 1

This solution allows you to use your Amazon Lex conversation logs data to capture bot interactions and analyze them using Dashbot service capabilities. The image below shows the top messages for an intent:

Analyzing and optimizing Amazon Lex conversations using Dashbot 2

Creating an account on Dashbot

To set up a Dashbot account, complete the following steps:

  1. Navigate to dashbot.io.
  2. Choose Sign Up. Note: You need to provide your email address, company name, and a password.
  3. Choose Add ChatBot.
  4. For Bot name, enter a name for your bot. In this post, we are using the “AutoLoanBot” example from a previous blog post.
  5. For Platform, choose Lex.
  6. You can optionally choose a Category and Production Status.
  7. Choose Register.

The following screenshot illustrates the account setup with Dashbot.

Analyzing and optimizing Amazon Lex conversations using Dashbot 3

After you register the chatbot, an API key is created. Record this API key to use in a future step.

Enabling conversation logs for Amazon Lex

To send your bot interactions to Dashbot, enable conversation logs text for your Amazon Lex bot. You can use the AutoLoanBot example created in the previous blog post as we are here, or you can use one of your own bots.

  1. First, create a new log group called car-loan-bot-text-logs in Amazon CloudWatch Logs.
  2. Next, create an IAM role called LexCarLoanBotRole to allow Amazon Lex to create log streams and post log events in the car-loan-bot-text-logs log group.
  3. On the Amazon Lex console, choose the AutoLoanBot.
  4. Choose Settings.
  5. Choose Aliases, and make sure you have an alias for your bot. We will create an Alias name test that refers to the Bot version Latest.
  6. If you have not yet published your bot alias, you need to do that now.  Choose Publish, choose the alias (for example, test) in the Choose an alias dropdown, and then choose Publish.
  7. Now Choose Conversation logs in the side menu.
  8. Choose the Settings gear icon that corresponds to your bot alias.
  9. Under Log type, choose Text logs.
  10. For Log group name, select car-loan-bot-text-logs from the dropdown list.
  11. For IAM role, select LexCarLoanBotRole from the dropdown list.
  12. Choose Save.

Analyzing and optimizing Amazon Lex conversations using Dashbot 4

Integrating your Amazon Lex conversation logs with Dashbot

Now that you’re logging your conversations to CloudWatch Logs, configure a subscription to send these messages to Dashbot. Complete the following steps.

  1. Navigate to AWS Lambda service on the Console.
  2. Choose Create function and leave Author from scratch selected.
  3. Enter a Function name, such as lex-dashbot-integration.
  4. Choose the latest supported version of Node.js in the Runtime language.
  5. Choose Create a new role with basic Lambda permissions.
  6. Choose Create function.
  7. In Function code, for Code entry type select “Upload a file from Amazon S3” and enter this URL:
    https://aws-ml-blog.s3.amazonaws.com/artifacts/lex-dashbot-integration/8231d7e369435c68383681d23df4011a

  8. Change the handler name to src/index.handler.
  9. In Environment variables, chooses Edit, Add environment variable, and add a variable with Key  DASHBOT_API_KEY and for the Value use the Dashbot API Key you obtained above, and choose Save.
  10. Choose Add trigger and select CloudWatch Logs for Trigger configuration.
  11. Select the car-loan-bot-text-logs Log group from the drop-down list.
  12. Enter a Filter name, such as dashbot-filter and choose Add.
  13. Choose Save to save your Lambda function.

Testing your integration

When the setup is complete, you can test your integration by sending messages to your Amazon Lex bot. If you are using the AutoLoanBot example, you can download a test script to generate log data (conversation logs do not log interactions through the AWS Management Console). To download the test script, choose test-bot.zip.

After you send messages to your application, you can see them in the Live Transcripts section of Dashbot. For example, the following screenshot shows a transcript that includes the user’s utterances, the intent to which they were mapped, and the bot’s responses.

Analyzing and optimizing Amazon Lex conversations using Dashbot 5

Using Dashbot over the lifecycle of your bot

After you have sent data to Dashbot for a few days, you can review the reports. This post shows retention reports, conversation paths, goal conversations reports, and phrase clusters. You can also view metric counts, funnels, and audience segmentation.

Retention reports

A retention report helps you understand how often your customers return to the application. The following screenshot shows the report Existing User Retention.

Analyzing and optimizing Amazon Lex conversations using Dashbot 6

Conversation paths

Conversation paths let you see the most common paths your users take through your application. You can see where they successfully follow the expected path, and where they exit the flow. The following screenshot shows a conversation path for the AutoLoanBot example.

Analyzing and optimizing Amazon Lex conversations using Dashbot 7

Goal conversations

Goal conversation tracking helps you understand how many users achieve their goal, such as completing a purchase or escalating a problem. The following screenshot shows an escalation report.

Analyzing and optimizing Amazon Lex conversations using Dashbot 8

Phrase clusters

You can view your messages grouped by semantic meaning. The following screenshot shows how you can use the list of messages with the NotHandled intent to improve the training data for the ThankYou intent.

Analyzing and optimizing Amazon Lex conversations using Dashbot 9

Summary

Dashbot provides a comprehensive set of reports you can use to analyze the performance of your Amazon Lex bots. You can quickly deploy an AWS Lambda function to securely send your Amazon Lex conversation logs to your Dashbot account in near real-time, and use Dashbot to optimize your conversational application needs. For more information about how to best analyze and optimize your bot, visit the Dashbot website or contact Dashbot directly.


About the authors

Analyzing and optimizing Amazon Lex conversations using Dashbot 10Arte Merritt is the CEO and co-founder of Dashbot – a chatbot analytics platform. Previously, he founded the mobile analytics platform, Motally, which he led to a successful exit via sale to Nokia. He has more than 20 years experience in the analytics space, working with companies like Yahoo Mobile and a wide variety of startups. Arte is an MIT alum.

 

 

 

Analyzing and optimizing Amazon Lex conversations using Dashbot 11As a Product Manager on the Amazon Lex team, Harshal Pimpalkhute spends his time trying to get machines to engage (nicely) with humans.

 

 

 

Analyzing and optimizing Amazon Lex conversations using Dashbot 12Brian Yost is a Senior Consultant with AWS Professional Services. In his spare time, he enjoys mountain biking, home brewing, and tinkering with technology.

 

 

 



Read More

LEAVE A REPLY

Please enter your comment!
Please enter your name here