Open Forms with Amazon Lex V2

Create an open form type to use with the Form or Text Form node and Amazon Lex V2.

The open form type connects to a natural language processing (NLP) engine and matches JSON name-value pairs of interest.

Use the open form type to transcribe language responses in real time. Capture a caller's inputs in a natural way and in multiple languages.

Prerequisite

  1. Integrate Amazon Lex with Studio. Complete these instructions once.

  2. Create an Amazon Lex V2 bot for each open form type.

Name

Give the open form type a name.

Description

Enter a description for the open form type.

NLP Engine

Select Amazon Lex V2.

Bot Name ID

Specify the Amazon Lex Bot ID.

Note the bot ID for later use in Studio.

Bot Alias ID

Specify the Amazon Lex Bot Alias ID.

Note the bot alias ID for later use in Studio.

Role ARN

Specify the Role ARN.

You use the role ARN to configure the open form type in Studio.

Region

Specify the Amazon Lex Bot region.

Note the AWS region for later use in Studio.

Test Language

Select the language the bot supports.

Note the language for later use in Studio.

Test Query Text

Type a brief typical response you would expect to receive.

Example:

These are typical responses to the Amazon Lex V2 BookRoom bot.

  • Book a room

  • Chicago

  • Tomorrow

In the returned JSON, Amazon Lex V2 responses are inside OriginalValue and InterpretedValue elements. OriginalValue contains what is sent and InterpretedValue contains how what is sent is interpreted by the bot. For example, as a response to the query, "What city will you be staying in?", the Chicago response might be interpreted as Chicago,USA in the bot. As a response to the query, "What day do you want to check in?", if the original value is tomorrow, the interpreted value is tomorrow's date formatted according to the bot configuration.

The Preview Test XML session state is retained for one hour to give you time to try different scenarios and check the responses.

The maximum query size is 2,000 characters. If the query is too long, the open form configuration will not save. Studio warns you when the query is too long.

Response

Click Preview Response to see the JSON name-value pairs.

Assign Values to Variables

Match JSON name-value pairs of interest.

  1. Click a JSON name-value pair from the preview response.

    The path to the selected name-value pair displays in the JSON Path field.

    The value displays in the black strip under the path.

    Note:

    Voice channels (through the Form and Text Form nodes) can only access name-value pairs inside the queryResult object. Digital channels (through the Text Form node) can access name-value pairs inside and outside of the queryResult object.

    To edit the JSON path, select Editable JSON. For more information, see Editing the JSON Path.

  2. Give a name to the JSON name-value pair in the Assign path to Return value name field.

    This name represents the JSON name-value pair in the form node.

  3. Click Add Return Value.

    The JSON path and name are added to the table of return values.

  4. Repeat. Select another JSON name-value pair.

Table of Return Values

The form node has access to items in the table of return values. In the form node, return values from matched pairs are assigned to variables.

Click Test to show the value assigned to a JSON path. The value shows in the black strip under the JSON Path field.

Advanced ASR Settings

In the Form node, these settings are initially applied and can be further tuned.

Do not tune unless you have a clear understanding of how these settings affect speech recognition. Generally speaking, the default settings are the best. To return a setting to its default value, remove the value from the field and click outside the field.

Timeout Settings

Description

No Input Timeout

Wait time, in milliseconds, from when the prompt finishes to when the system directs the call to the No Input Event Handler as it has been unable to detect the caller’s speech.

Speech Complete Timeout

Speech Incomplete Timeout

Use these settings for responses with an interlude to ensure the system listens until the caller's speech is finished.

Speech Complete Timeout measures wait time, in milliseconds, from when the caller stops talking to when the system initiates an end-of-speech event.

Speech Incomplete Timeout measures wait time, in milliseconds, from when incoherent background noise begins and continues uninterrupted to when the system initiates an end-of-speech event.

Speech Start Timeout

Wait time, in milliseconds, from when the prompt starts to play to when the system begins to listen for caller input. This is similar to the scenario where barge in is enabled.

Barge In Sensitivity

Raising the sensitivity requires the caller to speak louder above background noise. Applicable when Barge In is enabled. The scale is logarithmic. See Lumenvox Sensitivity Settings.