Skip to content

aws.lexv2_models.list_aggregated_utterances

Example SQL Queries

SELECT * FROM
aws.lexv2_models.list_aggregated_utterances
WHERE
"bot_id" = 'VALUE'
AND "locale_id" = 'VALUE'
AND "aggregation_duration" = 'VALUE';

Description

Provides a list of utterances that users have sent to the bot.

Utterances are aggregated by the text of the utterance. For example, all instances where customers used the phrase "I want to order pizza" are aggregated into the same line in the response.

You can see both detected utterances and missed utterances. A detected utterance is where the bot properly recognized the utterance and activated the associated intent. A missed utterance was not recognized by the bot and didn't activate an intent.

Utterances can be aggregated for a bot alias or for a bot version, but not both at the same time.

Utterances statistics are not generated under the following conditions:

  • The childDirected field was set to true when the bot was created.

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

  • You opted out of participating in improving Amazon Lex.

Table Definition

Column NameColumn Data Type
aggregation_duration Required Input Column

The time period used to aggregate the utterance data.

STRUCT(
"relative_aggregation_duration" STRUCT(
"time_dimension" VARCHAR,
"time_value" BIGINT
)
)
Show child fields
aggregation_duration.relative_aggregation_duration

The desired time window for aggregating utterances.

Show child fields
aggregation_duration.relative_aggregation_duration.time_dimension

The type of time period that the timeValue field represents.

aggregation_duration.relative_aggregation_duration.time_value

The period of the time window to gather statistics for. The valid value depends on the setting of the timeDimension field.

  • Hours - 1/3/6/12/24

  • Days - 3

  • Weeks - 1/2

bot_id Required Input Column

The identifier of the bot that contains the utterances.

VARCHAR
locale_id Required Input Column

The identifier of the language and locale that the utterances are in.

VARCHAR
bot_alias_id Input Column

The identifier of the bot alias that contains the utterances. If you specified the bot version, the bot alias ID isn't returned.

VARCHAR
bot_version Input Column

The identifier of the bot version that contains the utterances. If you specified the bot alias, the bot version isn't returned.

VARCHAR
filters Input Column

Provides the specification of a filter used to limit the utterances in the response to only those that match the filter specification. You can only specify one filter and one string to filter on.

STRUCT(
"name" VARCHAR,
"values" VARCHAR[],
"operator" VARCHAR
)[]
Show child fields
filters[]
Show child fields
filters[].name

The name of the field to filter the utterance list.

filters[].operator

The operator to use for the filter. Specify EQ when the ListAggregatedUtterances operation should return only utterances that equal the specified value. Specify CO when the ListAggregatedUtterances operation should return utterances that contain the specified value.

filters[].values[]
max_results Input Column

The maximum number of utterances to return in each page of results. If there are fewer results than the maximum page size, only the actual number of results are returned. If you don't specify the maxResults parameter, 1,000 results are returned.

BIGINT
next_token Input Column

A token that indicates whether there are more results to return in a response to the ListAggregatedUtterances operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListAggregatedUtterances operation request to get the next page of results.

VARCHAR
sort_by Input Column

Specifies sorting parameters for the list of utterances. You can sort by the hit count, the missed count, or the number of distinct sessions the utterance appeared in.

STRUCT(
"attribute" VARCHAR,
"order" VARCHAR
)
Show child fields
sort_by.attribute

The utterance attribute to sort by.

sort_by.order

Specifies whether to sort the aggregated utterances in ascending or descending order.

_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

aggregated_utterances_summaries

Summaries of the aggregated utterance data. Each response contains information about the number of times that the utterance was seen during the time period, whether it was detected or missed, and when it was seen during the time period.

STRUCT(
"utterance" VARCHAR,
"hit_count" BIGINT,
"missed_count" BIGINT,
"utterance_first_recorded_in_aggregation_duration" TIMESTAMP_S,
"utterance_last_recorded_in_aggregation_duration" TIMESTAMP_S,
"contains_data_from_deleted_resources" BOOLEAN
)[]
Show child fields
aggregated_utterances_summaries[]
Show child fields
aggregated_utterances_summaries[].contains_data_from_deleted_resources

Aggregated utterance data may contain utterances from versions of your bot that have since been deleted. When the aggregated contains this kind of data, this field is set to true.

aggregated_utterances_summaries[].hit_count

The number of times that the utterance was detected by Amazon Lex during the time period. When an utterance is detected, it activates an intent or a slot.

aggregated_utterances_summaries[].missed_count

The number of times that the utterance was missed by Amazon Lex An utterance is missed when it doesn't activate an intent or slot.

aggregated_utterances_summaries[].utterance

The text of the utterance. If the utterance was used with the RecognizeUtterance operation, the text is the transcription of the audio utterance.

aggregated_utterances_summaries[].utterance_first_recorded_in_aggregation_duration

The date and time that the utterance was first recorded in the time window for aggregation. An utterance may have been sent to Amazon Lex before that time, but only utterances within the time window are counted.

aggregated_utterances_summaries[].utterance_last_recorded_in_aggregation_duration

The last date and time that an utterance was recorded in the time window for aggregation. An utterance may be sent to Amazon Lex after that time, but only utterances within the time window are counted.

aggregation_last_refreshed_date_time

The last date and time that the aggregated data was collected. The time period depends on the length of the aggregation window.

  • Hours - for 1 hour time window, every half hour; otherwise every hour.

  • Days - every 6 hours

  • Weeks - for a one week time window, every 12 hours; otherwise, every day

TIMESTAMP_S
aggregation_window_end_time

The date and time that the aggregation window ends. Only data collected between the start time and the end time are returned in the results.

TIMESTAMP_S
aggregation_window_start_time

The date and time that the aggregation window begins. Only data collected after this time is returned in the results.

TIMESTAMP_S