Viewing utterance statistics - Amazon Lex

Viewing utterance statistics

You can use utterance statistics to determine the utterances that your users are sending to your bot. You can see both the utterances that Amazon Lex V2 successfully detects as well as the utterances that it does not. You can use this information to help tune your bot.

For example, if you find that your users are sending an utterance that Amazon Lex V2 is missing, you can add the utterance to an intent. The Draft version of the intent is updated with the new utterance and you can test it before deploying it to your bot.

An utterance is detected when Amazon Lex V2 recognizes the utterance as an attempt to invoke an intent configured for a bot. An utterance is missed when Amazon Lex V2 doesn't recognize the utterance and invokes the AMAZON.FallbackIntent instead.

Utterance statistics are not generated under the following conditions:

  • The Child Online Privacy Protection Act setting was set to Yes when the bot was created with the console, or the childDirected field was set to true when the bot was created withe the CreateBot operation.

  • You are using slot obfuscation with one or more slots.

  • You opted out of participating in improving Amazon Lex.

Using utterance statistics, you can see whether a specific utterance was detected or missed, as well as the last time that the utterance was used in a bot interaction.

Amazon Lex V2 stores utterances continuously while users interact with your bot. You can query the statistics using the console or the ListAggregatedUtterances operation. Utterances are stored for 15 days for use with utterance statistics, and then indefinitely for use in improving the ability of your bot to respond to user input. You can delete utterances using the DeleteUtterances operation or by opting out of data storage. All utterances are deleted if you close your AWS account. Stored utterances are encrypted with a server-managed key.

Utterance statistics are generated for two combinations:

  • Bot, language, version

  • Bot, language, alias

When you delete a bot version, utterance statistics are available for the version for up to 15 days. You can't see statistics for deleted version in the Amazon Lex V2 console. To see the statistics for deleted versions, use the ListAggregatedUtterances operation.

If an alias points to a deleted version, you still get statistics from the deleted version when you get statistics for the alias. If the statistics from the ListAggregatedUtterances operation contains information from a deleted version, the containsDataFromDeletedResources field is set to true.

You can choose the time period that you want to see statistics for. You can choose to see hours, days, or weeks of information.

  • Hours – You can request utterance statistics for 1, 3, 6, 12, or 24 hour time windows. Statistics are refreshed every half hour for 1 hour time windows, and hourly for the other time windows.

  • Days – You can request utterance statistics for 3 days. Statistics are refreshed every 6 hours.

  • Weeks – You can see statistics for one or two weeks. Statistics are refreshed every 12 hours for one week time windows, and once per day for two week time windows.

Utterances are aggregated by the text of the utterance. For example, all instances where the customer used the phrase "I want to order a pizza" are aggregated into the same line in a response. When you use the RecognizeUtterance operation, the text used is the input transcript.

To list aggregated utterances, apply the following policy to a role.

{ "Version": "2012-10-17", "Statement": [ { "Sid": "ListAggregatedUtterancesPolicy", "Effect": "Allow", "Action": "lex:ListAggregatedUtterances", "Resource": "*" } ] }