Amazon Lex became an immediate front-runner for the platform to help build the chatbot. The ease of integration and development was appealing. Having the same natural language processing and the same deep learning technologies that power Amazon Alexa was also an exciting factor that helped solidify Lex as the platform of choice. Amazon Lex provides a very similar console for developing Intents, Utterances and Slots and a straight-forward way to test the bot within the console as well. Those already familiar with the console-style configuration of Amazon Alexa skills will feel very comfortable working within the Lex console. Amazon Lex provides integration points within the pipeline for deferring data validation to an Amazon Lambda function. You can even use the same Lambda function to handle Intent Fulfillment.
Defining the Utterances was probably the trickiest part of developing the bot within Lex. The samples and examples all started out with very specific, complete sentences for Utterances. In testing, complete sentences appear to limit the flexibility the user has regarding invoking the bot. Using shorter, keyword-focused Utterances appears to provide more flexibility and even allows for some Utterances to be combined. Utterances could also be defined to collect some of the slot data as well, as shown below.
Slots and Slot Types are how the bot gathers data from the user. The questions and interactions to the user are outlined to fill-in these slots with data related to the defined data type. Amazon has created a few built-in data types that cover common data you'd typically want to collect from a user (AMAZON.DATE and AMAZON.TIME for dates and times, for example). If more flexibility is needed, Amazon allows for defining custom slot types. These slot types can be either Expandable or Restrictive. Expandable will use the defined slot values as training data and fill the slot with the value provided by the user, if the user value is similar to the slot values. This allows for a non-exhaustive list of acceptable keywords to be defined.