How to Create an AI Bot?

Introduction

AI chatbot is an application that is used in messaging applications for support and services. It uses natural language tools to process data and analyse it and return the appropriate message; it may be a voice or text message. It will be available 24/7.

Chatbots are developed for particular functionality of businesses. Chabot?s has pre-defined boundaries that enable them to engage in meaningful conversations with customers. In many cases, conversations free human resources from normal activities. As such, it enables them to work on critical tasks. Aside from the many available chat enhancement technologies, Amazon Alexa is among the most popular. Creating bots using Amazon Lex is a simple process.

This tutorial will guide you through the entire building of a chatbot process using Amazon Lex. We will start by setting some simple answers and then building some more complex ones. Creating bots that are mature and intelligent depends on how we create them.

How to Create a Chatbot using Amazon Lex

What Is Amazon Lex?

Amazon Lex is a service for developing the information interface in any application using voice and text. Amazon Lex provides the extra-deep learning capabilities for automatic speech recognition (ASR), speech-to-text conversion, and Natural language Understanding (NLU) to text, design acknowledgement, so that you can use it to make apps more engaging, native experience, and a realistic language and interaction. Amazon Lex, the same deep learning technology that powers Amazon Alexa, is now available for developers. Creating bots using amazon lex are more user friendly and interactive.

Set Up an AWS Account and Create an Administrator User

Creating bots using Amazon Lex requires an AWS account. It is built and deployed on amazon web services. We can create an account on Amazon Web Services.

Creating Bots

Amazon provides 3 test samples, or we can select a custom bot option to creating bots.

Fill in the information.

Bot Name: TutorialBot

Output voice: Matthew — We can select 5 different output voices or none.

Set Session Timeout: 5 min (select based on your application need)

Select Yes or No for Children?s Online Privacy Protection Act (COPRA).

Click on the Create button, which will redirect you to the editor page.

Lex Terminology

Intent

It explains the goal of the chatbot. For example, book a hotel.

Create intent

To create a new intent by clicking on the “Create intent? button, then click on the ?+ create intent? next to the left-hand side of the page. A menu will pop up, then type the intent name. Next, click on the ?Add? button.

There are two important sections on the intent page

  1. Sample utterances
  2. Response

Sample Utterances

It is a text phrase that is used to respond to the user.

E.g.

I would like to book a flight.

I would like to purchase insideAIML?s data science master program.

I want to go on a trip to New Delhi.

Response

It is a reply to messages.

E.g.

Thank you for your drink.

Welcome to InsideAIML.

Slot

In Amazon Lex, slots are used to store variables. The slot has a name, slot type, and prompt.

Name of variable.

e.g. ?Name?

Slot type

Type of information stored in a variable.

e.g. ?AMAZON.GB_FIRST_NAME?

Prompt

This is a message sent to the user.

e.g.? What is your name??

We can add multiple slots and multiple prompt messages.

Fulfilment

Fulfilment provides a business idea after obtaining all the required slot values, which need to be achieved. In addition, Amazon Lex supports the use of Lambda services for business concept fulfilment and validation.

We now have all the required data collected in the chatbot, which can be simply transferred to lambda functionality, or the parameters can be restored to the client application, which then calls a REST endpoint.

Building and Testing the Bot

To test this setting go to the upper right corner build button. Click on the build button. It creates a test environment for the bot. The new area is allocated for this called Test Bot (Latest).


Test the bot using the ?what is your name?? question.

It is working fine.

 Add more intent for the more intelligent bot.

Please note that if you change any intent configuration, you will need to create it again so that the latest changes will appear in the test window.

Publishing a bot creates its new version. It allows you to create a different type of your bots and control the type used by your app. Amazon Lex makes building a chatbot a simple and easy process.

We can create bots without chatbot code. Chatbot code is not required in Amazon Lex, but we can develop a bot and integrate it with the website using chatbot code.

Advantages of using Amazon Lex

  1. It is easy to use.
  2. Integration with AWS
  3. Cost-saving
  4. Provide all in one platform for chatbot, i.e. creating, testing and deploy the bot on the same platform.

Summary                   

In this blog, we explained how to use Amazon Lex to build a chatbot, explain lex terminology, create a simple chatbot and test it. Also point out the advantages of Amazon Lex.