Amazon Lex

Learn via video courses
Topics Covered

Overview

Amazon Lex is an AWS service for integrating speech and text-based conversational interfaces into applications. The same deep learning engine that powers Amazon Alexa is now available to every developer with Amazon Lex, allowing you to integrate powerful natural language chatbots into your new and current apps.

What is Amazon Lex?

Amazon Lex is an AWS service for developing conversational interfaces for speech and text applications. Amazon Lex is a fully managed AI service that uses powerful natural language models to design, construct, test, and deploy conversational interfaces in applications.

Amazon Lex makes it simple for any developer to create conversational bots. With Amazon Lex, no deep learning knowledge is necessary, simply configure the basic conversation flow on the Amazon Lex dashboard to build a bot. Amazon Lex conducts the conversation and changes the responses on the fly. The console is used to design, test, and publish your text or speech chatbot. After that, the conversational interfaces were incorporated into bots on mobile devices, web apps, and chat platforms.

Amazon Lex provides integration with AWS Lambda, and you can integrate it with many other services on the AWS platform, including Amazon Connect, Amazon Comprehend, and Amazon Kendra. Integration with Lambda provides bots access to pre-built serverless enterprise connectors(which provide the connector parameters such as parameter_id , etc. that are stored in AWS Serverless Application Repository) to link to data in SaaS applications such as Salesforce.

Conditional branching is used to control the course of conversations with bots. Instead of implementing custom code, you can add simple conditions directly to your Amazon Lex bot, and manage the conversation path dynamically based on user input and business knowledge. By incorporating conditional branching in your bot, you reduce dependency on custom code and expedite the design and delivery of conversational interfaces.

Amazon Lex Core Concepts and Terminology

  • Bot :
    A bot is a piece of computer software that turns natural language into speech or text, determines the user's intent, and then sends a message based on the business rules and data of the company.

  • Language :
    A conversation with an Amazon Lex bot can take place in one or more languages. Because each language is independent of the others, you may enable Amazon Lex to speak with a user in their native language.

  • Intent :
    An intent expresses a desired action by the user. You build a bot to help with one or more related intents. You could, for example, build an intent that orders pizza and beverages. You must give the following information for each intent :

    • Intent name :
      A name that describes the intent.
    • Utterances :
      How a user could express purpose. A user may say, "Can I get a cold drink?" or "I'd want to order a cold drink".
    • How to execute the intent :
      How you wish to satisfy the intent once the user has provided the required information. To accomplish the goal, we propose that you write a Lambda function.
  • Slot :
    An intent can have zero or more slots, also known as parameters. Slots are added as part of the purpose setup. Amazon Lex V2 requests the user for specified slot values during execution. Before Amazon Lex V2 can fulfill the purpose, the user must submit values for all needed slots. The Order Cold Drink intent, for example, requires slots for type, quantity, and number of cold drinks. You provide the slot type and one or more prompts that Amazon Lex delivers to the client to extract values from the user for each slot. A user can respond with a slot value that includes extra words, such as "big cold drink please" or "let's continue with very few". Amazon Lex still recognizes slot value.

  • Type of slot :
    Each slot has a type. You may either construct your slot type or utilize one of the built-in slot kinds. For the ColdDrink purpose, for example, you could design and use the following slot types :

    • Size :
      There are three enumeration values for size : small, medium, and large.
    • Type :
      Contains the enumeration values Pepsi and Coke.

    Amazon Lex also includes pre-installed slot kinds. Take, for example, AMAZON. The number is a built-in slot type for recording the number of ColdDrinks ordered.

  • Version :
    A version is a numbered snapshot of your work that you may publish for usage at various stages of your process, including development, beta deployment, and production. After creating a version, you can utilize a bot that existed when the version was created.

  • Alias :
    You can use an alias to update the version that your client apps are using. For example, you may refer an alias to your bot's version 1. When you're finished, you publish version 2 and alter the alias to link to the new version. Because your apps utilize an alias rather than a specific version, all of your clients receive the new feature without the need for an update.

How Does Amazon Lex Work?

Using robust natural language models to design, construct, test, and deploy conversational user interfaces in software, Amazon Lex, an AWS service, is used to integrate speech and text-based conversational interfaces into applications.

how-does-amazon-lex-work

The normal actions you take while working with Amazon Lex are as follows :

  • Create a bot and add one or more intents you want to support. Configure the bot to recognize the user's objective (intent), converses with the user to gather information, and fulfill the user's desire.
  • Try out the bot. You may try out the Amazon Lex console's test window client.
  • Create an alias and publish a version.
  • Install the bot. The bot is deployed on mobile apps or messaging systems such as Facebook Messenger.

Features of Amazon Lex

Amazon Lex offers the following advantages :

  • Simplicity :
    Amazon Lex walks you through the steps of utilizing the console to build your bot in minutes. You provide Amazon Lex with a few example lines, creating a full natural language model with which the bot can communicate via speech and text to ask questions, get replies, and do complex tasks.

  • Deep learning technology has been modernized :
    Amazon Lex includes ASR and NLU technologies used to build a Speech Language Understanding (SLU) system. Amazon Lex uses SLU to accept natural language speech and text input, interpret the purpose behind the input, and fulfill the user intent by activating the right business function.

  • Seamless Scalability :
    You can create, test, and deploy your bots using Amazon Lex from the console. You may publish your speech or text bots using Amazon Lex for usage on mobile devices, online apps, and chat services (for example, Facebook Messenger). The auto-scale Amazon Lex is convenient. To power your bot experience, you don't have to bother about maintaining infrastructure and supplying hardware.

  • Integrated use of the AWS platform :
    Amazon Lex works seamlessly with other AWS services like Amazon CloudWatch and AWS Lambda. For security, monitoring, user authentication, business logic, storage, and mobile app development, you may benefit from the strength of the AWS platform.

  • Cost-effectiveness :
    There are no minimum fees (or) up-front expenditures with Amazon Lex. Only the text or speech requests that are made result in a charge to you. The service is a cost-effective solution to create conversational interfaces because of the pay-as-you-go pricing and minimal cost per request. You may simply test out Amazon Lex without making an initial commitment because of its free tier.

Use Cases of Amazon Lex

Financial Services

Amazon Lex used to modify how it delivers customer care to match the changing expectations of its customers in financial services.

  • Prebuilt solutions for your use cases are available with Amazon Lex for Financial Services, ensuring a positive customer experience without sacrificing operational efficiency.
  • Prebuilt chatbots automate customer help interactions such as credit card payments and home loan applications.
  • For financial industry use cases, Amazon Connect contact flows are combined with pre-configured bots with intents, sample utterances, and slot kinds.
  • Credit cards and bank accounts are only a handful of financial organizations' services.

Insurance

AWS's adaptive infrastructure may help insurance companies enhance client interactions and risk profiles. When insurers utilize Amazon Lex to improve their core infrastructure and deliver personalized insurance solutions, they can swiftly build new digital customer experiences for their consumers.

  • Amazon Lex for Insurance prebuilt solutions enable you to create experiences at scale and boost digital engagement. Pre-programmed chatbots can automate customer interactions such as claims processing, policy administration, premium payment, and insurance quotations.
  • Bots designed for specific purposes contain conversation flows, training data, and dialogue prompts used in both voice and chat.
  • If you can offer client solutions faster while still using your existing resources, your teams may be able to work on more tough challenges and develop deeper connections.
  • Claims processing, home, car insurance, and life insurance policies are a few examples of policy administration and claims.

Retail

Amazon Lex is all about allowing businesses to experiment with new ideas and enhance the efficiency of their operations by providing a dynamic conversational experience.

  • Amazon Lex for Retail offers ready-to-use solutions to maintain a consistent brand experience across different touchpoints and revolutionize consumer contact.
  • Prebuilt chatbots can provide automated interactions such as checking order status, redeeming loyalty points, and identifying a retail location.
  • Ready-to-use bot setup and sample business logic linkages are included in prebuilt bots for retail use. These technologies can be used in a contact center, on social media platforms, or in a mobile application to provide a rich experience to customers at all phases of their relationship.
  • Customer account administration, order processing, delivery, loyalty programs, and retail store cards are a few examples.

Telecom

Amazon Lex can help telecommunications companies by optimizing service delivery and offering their clients access to cutting-edge communication and media technology.

Amazon Lex for Telecom's prebuilt solutions enhances customer experiences while lowering operational expenses. This includes paying bills, arguing offers, and monitoring installations.

Prebuilt bots provide end-to-end conversation flows for telecom use case situations, from gathering more data to validating user inputs and applying business logic. Account management, mobile, internet, television, and business solutions are just a few of the numerous alternatives.

  • Voice Assistants and Chatbots in Call Centers :
    Callers at a contact center may use the Amazon Lex chatbot to ask for an account balance, change a password, or schedule an appointment without speaking with an agent. These chatbots use automatic voice recognition and natural language comprehension to determine a caller's purpose, keep context, and govern the discussion smoothly.
  • Question and Answer Bots :
    Requests are relatively simple with Amazon Lex's building of chatbots for the daily user, such as retrieving sports scores, current news updates, or weather reports. Lex bots are used on chat platforms, mobile devices, and IoT devices and allow extensive message formatting.
  • Bots for Application :
    We can quickly incorporate a voice or text chat interface into bots on smartphone devices that may assist clients with a variety of daily operations like as checking their bank account, ordering meals, booking tickets, or calling a cab. It effortlessly links to Amazon Cognito, allowing you to govern user management, authentication, and synchronization across all devices.
  • Chatbots for Enterprise Productivity :
    Amazon Lex is used to creating effective workplace chatbots that establish common work practices and increase enterprise efficiency. For example, employees in HubSpot's marketing performance may monitor sales statistics from Salesforce and customer support status from Zendesk directly from their chatbots in minutes.

Amazon Lex Pricing

  • Amazon Lex is a service that allows you to integrate speech and text-based conversational interfaces into any application. You just pay for what you use with Amazon Lex. There is no minimum charge or upfront commitment.
  • Amazon Lex bots are intended for request-response interactions or continuous streaming conversations. Each user input (voice or text) is treated as a single API call with the request and response interaction.
  • All user inputs from numerous turns are handled in a single streaming API call in a streaming discussion. Amazon Lex pricing is based on these two interaction types.
  • The bot continually listens and may be programmed to reply proactively with streaming chat. For example, you may design the bot to continue a discussion when the user needs more time to react by delivering periodic messages.
  • Amazon Lex is available for a free trial. For the first year after you start using Amazon Lex, you can process up to 10,000 text requests and 5,000 voice requests or speech intervals each month for free. You may also hire a chatbot creator for two hours of training time each month.
  • With Amazon Lex, you pay the most effectively for what you use. It is charged to you based on the number of voice or text requests processed by your bot, at $0.00075 per text request and $0.004 per voice request.
  • You can use Amazon Lex without spending extra cost. From the date you get to begin with it, you can proceed up to 10,000 text requests and 5000 speech requests in step with a month free for the primary year.

How to Develop a Chat Bot Using Amazon Lex?

A chatbot is computer software that converts natural language into speech or text, ascertains the user's purpose, and then sends a message based on the organization's business rules and data.

how-to-develop-a-chat-bot-using-amazon-lex

  • To begin, sign in to your account and search Amazon Lex under "Find Services" in the AWS administration portal. sign-in-to-your-account-and-search-amazon-lex

  • Click on get started. You will see a few samples on the screen, such as a custom bot, book a trip, order flowers, schedule an appointment, etc. To build from scratch, click on "Custom bot". Provide the name, choose voice, session timeout, select no for CCOPA, and finally click on create.

    how-to-develop-a-chat-bot-using-amazon-lex-2

    how-to-develop-a-chat-bot-using-amazon-lex-3

  • Chatbots are for actions to achieve specific tasks. The tasks we want to achieve are known as intent, and the keywords we type in or speak are called utterances. On this page, click on create intent and provide the meaningful name and add. how-to-develop-a-chat-bot-using-amazon-lex-4 how-to-develop-a-chat-bot-using-amazon-lex-5

  • To understand utterances, take an example of adding some common utterances to an intent. AWS Lex is smart enough to recognize closely matching phrases. how-to-develop-a-chat-bot-using-amazon-lex-6

    how-to-develop-a-chat-bot-using-amazon-lex-7

  • After adding utterances, add responses to greeting intents as there are two ways to respond, i.e., simple messages or AWS Lambda function. We will use simple messages under the response section. Then click on save intent below and then click on Build. how-to-develop-a-chat-bot-using-amazon-lex-8 You can easily test the simple chatbot in the right-hand side window, as shown below. how-to-develop-a-chat-bot-using-amazon-lex-9

Advantages of Amazon Lex

  • SDK support :
    You can build iOS, Android, Java, JavaScript, Python, .Net, Ruby, PHP, Go, and C++ bots that span mobile, web, desktop, and IoT platforms.

  • Natural Language Processing and Text support :
    You can design engaging user experiences with natural-sounding, conversational interactions, and new product categories by utilizing Amazon Lex, which offers the deep capability and flexibility of natural language understanding (NLU) and automatic speech recognition (ASR).

  • Utterance monitoring :
    Amazon Lex controls the conversation's discourse and dynamically modifies the participants' answers. Using the console, you may create, test, and publish your text or speech chatbot. After that, the conversational interfaces were incorporated into bots on mobile devices, websites, and chat platforms.

  • AWS lambda integration :
    You can write AWS Lambda functions that your Amazon Lex bot can use as code hooks. In your intent setting, you may provide Lambda functions for initialization and validation, fulfillment, or a combination of the two. As a code hook for your bot, we advise using a Lambda function. Your bot returns the information about the intent to the client application for fulfillment without a Lambda function.

  • SaaS Connectors :
    Amazon Lex has prebuilt integration with AWS Lambda. You can easily integrate with many other AWS platform services, such as Amazon Cognito, AWS Mobile Hub, Amazon CloudWatch, and Amazon DynamoDB. Integration with Lambda gives bots access to prebuilt serverless enterprise connectors to link to data in SaaS applications like Salesforce, HubSpot, or Marketo.

  • Cost-effectiveness :
    There are no minimum fees or up-front expenditures with Amazon Lex. Only the text or speech requests that are made result in a charge to you. The service is a cost-effective solution to create conversational interfaces because of the pay-as-you-go pricing and minimal cost per request. You may simply test out Amazon Lex with no out-of-pocket costs because of the free tier offered by the service.

Conclusion

  • Amazon Lex is a fully managed Artificial Intelligence service that uses powerful natural language models to design, construct, test, and deploy conversational interfaces in applications.

  • Amazon Lex works seamlessly with other AWS services like Amazon CloudWatch and AWS Lambda for security, monitoring, user authentication, business logic, storage, and mobile app development.

  • There are no minimum fees (or) up-front expenditures with Amazon Lex. Only the text or speech requests that are made result in a charge to you.

  • You can create, test, and deploy your bots using Amazon Lex from the console. You may publish your speech or text bots using Amazon Lex for usage on mobile devices, online apps, and chat services.