AWS Blog

Amazon Lex – Build Conversational Voice & Text Interfaces

by Jeff Barr | on | in Amazon Lex, AWS re:Invent | | Comments

While computers that talk are great, computers that listen and respond are even better! If you have used an Amazon Echo, you know how simple, useful, and powerful the Alexa-powered interaction model can be.

Today we are making the same deep learning technologies (ASR – Automatic Speech Recognition NLU – Natural Language Understanding) that power Amazon Alexa available to you for use in your own conversational applications. You can use Amazon Lex to build chatbots and other types of web & mobile applications that support engaging, lifelike interactions. Your bots can provide information, power your application, streamline work activities, or provide a control mechanism for robots, drones, and toys.

Amazon Lex is designed to let you get going quickly. You start out by designing your conversation in the Lex Console, providing Lex with some sample phrases that are used to build a natural language model. Then you publish your Amazon Lex bot and let it process text or voice conversations with your users. Amazon Lex is a fully-managed service so you don’t need to spend time setting up, managing, or scaling any infrastructure.

Your chatbot can connect with Facebook Messenger today; Slack and Twilio integration is in the works as well. On the AWS side, it works with  AWS Lambda, AWS Mobile Hub, and Amazon CloudWatch. Your code can make use of Amazon DynamoDB, Amazon Cognito, and other services.

Amazon Lex lets you use AWS Lambda functions to implement the business logic for your bot, including connections to your enterprise applications and data. In conjunction with the newly announced SaaS integration for AWS Mobile Hub, you can build enterprise productivity bots that provide conversational interfaces to  the accounts, contacts, leads, and other enterprise data stored in the SaaS applications that you are already using.

Putting it all together, you now have access to all of the moving parts needed to build fully integrated solutions that start at the mobile app and go all the way to the fulfillment logic.

Amazon Lex Concepts
Let’s take a quick look at the principal Amazon Lex concepts:

Bot – A bot contains all of the components of a conversation.

Intent – An intent represents a goal that the bot’s user wants to achieve (buying a plane ticket, scheduling an appointment, or getting a weather forecast, and so forth).

Utterance – An utterance is a spoken or typed phrase that invokes an intent. “I want to book a hotel” or “I want to order flowers” are two simple utterances.

Slots – Each slot is a piece of data that the user must supply in order to fulfill the intent. Slots are typed; a travel bot could have slots for cities, states or airports.

Prompt – A prompt is a question that asks the user to supply some data (for a slot) that is needed to fulfill an intent.

Fulfillment – Fulfillment is the business logic that carries our the user’s intent. Lex supports the use of Lambda functions for fulfillment.

Bots, intents, and slots are versioned so that you can draw clear lines between development, testing, staging, and production, in a multi-developer environment. You can create multiple aliases for each of your bots and maps them to specific versions of the components.

Building a Bot
You can define your Lex bot and set up all of these components from the Lex Console. You can start with one of the samples or you can create a custom bot:

You define your utterances and their slots on the next page:

And customize your bot using the settings:

You can test your bot interactively and refine it until it works as desired:

Then you can generate a callback URL for use with Facebook (and others on the way):

I’ll share more details as soon as the re:Invent rush is over and I have time to really dig in.

Pricing and Availability
Amazon Lex is available in preview form in the US East (Northern Virginia) Region and you can start building conversational applications today!

After you sign up, you can make 10,000 text requests and 5,000 speech requests each month at no charge for the first year. After that you will pay $4.00 for each 1,000 speech requests and $0.75 for every 1,000 text requests.

Jeff;

Update! We have a webinar about Lex coming up on January 17th. You can sign up for it here.