Special thanks to Mega Satish for her meaningful contributions, support, and wisdom that helped shape this work.

Because of breakthroughs in machine learning and deep learning, which are causing a change in every industry area and managing various types of activities better than people. The majority of monotonous jobs that were formerly performed by humans are now replaced by AI. Every firm is aiming to replace the least skilled labour with AI robots that can do comparable tasks more efficiently, especially when it comes to chatbots. A chatbot is computer software that mimics human interaction by using voice instructions, text dialogues, or both. Chatbots are being employed to address consumer concerns or problems in food delivery app businesses such as Zomato and Swiggy, but are chatbots truly useful in that business model? This business model’s target customers are those who don’t have time to go outside to obtain food, prefer convenience at home, or are unwilling to endure discomfort, thus their concerns should be resolved in the most convenient way possible. To fulfil the user’s request, a chatbot is employed. It is critical for the chatbot to plan how to carry out the task that the user has asked. New tools are available now to create and deploy chatbots; Amazon Lex by AWS is one of them. This project focuses on creating a Pizza Ordering Chatbot using Amazon Lex to help the user order pizza.


Introduction

Chatbot

A chatbot is a computer program that conducts a conversation in natural language via text or speech, understands the intent of the user and sends a response based on business rules and data of the organization.

A Timeline of Evolution of Bots

A Timeline of Evolution of Bots

One of the first chatbots was ELIZA. It was also an early test case for the Turing Test, which determines if a machine can demonstrate cognition that is comparable to, or indistinguishable from, that of a person. The computer used “pattern matching” and replacement methods to provide prepared replies, giving early users the impression that they were speaking with someone who understood their input. The scripts in the software limited the program’s capabilities. Joseph Weizenbaum, a researcher at MIT’s Artificial Intelligence Laboratory, created an early natural language processing algorithm in the mid-1960s. It was allegedly made to show how shallow human-computer connections were at the time. Humans, on the other hand, found it highly entertaining when it was put on computers. In today’s world, chatbots have many applications such as online shopping, ticket booking, news reports, food ordering, etc.

Advent of Conversational Interactions

Advent of Conversational Interactions

Advent of Conversational Interactions

Amazon Lex

Amazon Lex is a robust discussion tool that enables developers to incorporate interactive experiences into new and existing applications by integrating voice and text interfaces. Alexa is powered by this behind-the-scenes service. Amazon Lex is a service that allows you to create these conversational user interfaces.

Amazon Lex Overview

Amazon Lex Overview

Amazon Web Services

AWS (Amazon Web Services) is a sophisticated, developing cloud computing platform offered by Amazon that comprises infrastructure as a service (IaaS), platform as a service (PaaS), and integrated software as a service (SaaS) solutions. AWS services can offer organisation tools such as compute power, database storage and content delivery services.

AWS was founded in 2006 as an extension of the internal operations established by Amazon.com to manage its online sales activities. AWS was among the first firms to provide a pay-as-you-go cloud computing model, which grows to give users with computation, storage, or networking as required. AWS provides a wide range of tools and solutions for businesses and software engineers that may be utilised in cloud services in up to 200 countries and territories. AWS services are available to government agencies, educational institutions, charities, and commercial organisations.

How does AWS Work?

  • AWS is separated into different services; each can be configured in different ways based on the user’s needs. For an AWS service, users are allowed to access configuration choices as well as specific server mappings.
  • More than 100 services comprise the Amazon Web Services portfolio, including those for compute, databases, infrastructure management, application development and security. These services, by category, include:
    • Compute
    • Storage databases
    • Data management
    • Migration
    • Hybrid cloud
    • Networking
    • Development tools
    • Management
    • Monitoring
    • Security
    • Governance
    • Big data management
    • Analytics
    • Artificial intelligence (AI)
    • Mobile development
    • Messages and notification

Problem Statement

An artificial intelligence chatbot is a system that enables natural language communications between humans and robots. We discovered from the literature that chatbots, in general, work like a typical search engine. Although the chatbot only provided one output instead of several outputs/results, the essential process flow remains the same, with the fresh search being performed each time an input is submitted. Nothing is related to the previous output. This project is focused on enabling a chatbot to assist in ordering a pizza that can process the customers’ needs with relation to the previous search output. In the chatbot context, this functionality will enhance the capability of the chatbot’s input processing.


Overview of Amazon Lex

Amazon Lex

Amazon Lex is a service that allows you to integrate speech and text-based conversational agents into any application. Amazon Lex provides advanced deep learning functionalities of Automatic Speech Recognition, and Natural Language Understanding to recognise text intent, enabling customers to build applications with highly engaging user experiences and lifelike conversational interactions.

With Amazon Lex, the same conversational engine that powers Amazon Alexa is now available to any developer, enabling you to build sophisticated, natural language chatbots into your new and existing applications. Amazon Lex empowers any programmer to instantly create talking chatbots. It handles the discourse and dynamically alters the replies. You may use the console to create, evaluate, and launch your text or speech bot. You can then add conversational interfaces to bots on mobile devices, web applications, and chat platforms (for example, Facebook Messenger).

Amazon Lex has pre-built connectivity with AWS Lambda and can be easily integrated with many other AWS technology platforms, such as Amazon Cognito, AWS Mobile Hub, Amazon CloudWatch, and Amazon DynamoDB. Integration with Lambda provides bots access to pre-built serverless enterprise connectors to link to data in SaaS applications, such as Salesforce, HubSpot, or Marketo.

Features of Amazon Lex

Features of Amazon Lex

Features of Amazon Lex

The Need For Amazon Lex

The Need For Amazon Lex

The Need For Amazon Lex

Benefits of Amazon Lex

  • Offers an easy-to-use console & predefined bot.
  • Employs advanced deep learning functionalities.
  • Provides seamless deploying & Scaling.
  • Offers built-in integration with AWS platform.
  • Cost-effective platform to create bots.

Applications of Amazon Lex

  1. Build virtual agents and voice assistants:

    • Enable self-service capabilities with virtual contact centre agents and interactive voice response (IVR). Users may reset their passwords or make appointments without having to talk with a live person.
  2. Automate informational responses:

    • Design conversational solutions that respond to frequently asked questions. Optimize your Connect & Lex conversation flows for tech support, HR benefits, or finance by using Amazon Kendra’s computational linguistics search for FAQs. Amazon Kendra is a highly accurate and intelligent search service that enables your users to search unstructured and structured data using natural language processing and advanced search algorithms.
  3. Improve productivity with application bots:

    • Using smart chatbots, you can automate fundamental user actions in your app. Link to other corporate software effortlessly with AWS Lambda while maintaining precise network access using IAM.

Working of Amazon Lex

Working of Amazon Lex

Working of Amazon Lex

Amazon Lex Use Case

  • To get banking information through an Amazon Lex chatbot.
Workflow of getting banking information through a Chatbot

Workflow of getting banking information through a Chatbot

Preview of Flow of Conversation

Preview of Flow of Conversation

Other Use Cases

  1. Informational Bots:

    • Chatbots for everyday consumer requests.
    • Examples include the Latest news, meteorology, sports stats, and so forth.
  2. Application Bots:

    • Build powerful interfaces to mobile applications.
    • Examples: Book tickets, order food, Manage bank accounts, etc.
  3. Enterprise Productivity Bots:

    • Streamline enterprise work activities and improve efficiencies.
    • Examples: Check sales figures, marketing, inventory condition, and so forth.
  4. Internet of Things (IoT) Bots:

    • Enable conversational interfaces for device interactions.
    • Examples: Wearables, Appliances, etc.

How Amazon Lex Operates?

AWS Lambda Function

AWS Lambda Function

Steps to follow while working with Amazon Lex -

  1. Create a chatbot & configure it with intents, slots & utterances.
  2. Lex Console provides a textual display slide for you to try the bot on.
  3. Publish a version and create an alias.
  4. Deploy the bot on a suitable platform.

Core Concepts & Technologies

  1. Amazon Bot: A computer software that simulates interactive communication.
  2. Intent: An intent expresses a desired action by the user.
  3. Slots: Slots are characteristics that may be required by purpose.
  4. Slot Types: Each slot has a unique kind. It is possible to construct designed or custom slot kinds.
Intent Fulfilment

Intent Fulfilment


Implementation

Steps of Creating a Chatbot

To create an Amazon Lex bot (console):

  1. Sign in to the AWS Management Console and open the Amazon Lex console at https://console.aws.amazon.com/lex/.
  2. Assuming this is your first bot, select Get Started; else, select Create from the Bots page.
  3. Fill up the form on the Create your Lex bot page with the following information, then click Create.
    • Choose the FoodOrdering blueprint.
    • Leave the default bot name (FoodOrdering).
    • For COPPA, choose No.
    • For User utterance storage, choose the appropriate response.
  4. Choose to Create to preserve the settings, the console sends the appropriate queries to Amazon Lex. The bot editing screen is then displayed by the console.
  5. Wait till you get the confirmation that your bot was built successfully.
  6. Test the bot.

Note: You can test the bot by typing text into the test window, or, for compatible browsers, by choosing the microphone button in the test window and speaking.

Step 1

Step 1

Step 2

Step 2

Step 3

Step 3

Step 4

Step 4

Step 5

Step 5

Step 6

Step 6

Step 7

Step 7

Step 8

Step 8

Snapshots of Testing a Bot

  1. Conversation of confirming the order of pizza

Conversation 1 - Part 1

Conversation 1 - Part 1

Conversation 1 - Part 2

Conversation 1 - Part 2

Conversation 1 - Part 3

Conversation 1 - Part 3

Conversation 1 - Part 4

Conversation 1 - Part 4

  1. Conversation of cancelling an order

Conversation 2 - Part 1

Conversation 2 - Part 1

Conversation 2 - Part 2

Conversation 2 - Part 2

Conversation 2 - Part 3

Conversation 2 - Part 3


YouTube Demonstration

Project Demo

Complete Tutorial

Presentation Recording


Conclusion

Through the proposed system, we can draw the conclusion that the PizzaOrdering chatbot will efficiently manage clients and accept their orders in a simple yet cohesive manner. The chatbot conducts the discussion in a nice manner, carefully inquiring about the type of pizza, the pizza dough, and the appetisers. It also requests the delivery time and confirms the order. We can also use Amazon Lex to improve the appearance and utterances of the chatbot and deploy it on a full-scale website using Amazon Cloud Services.


Presentation


Additional Resources

Course & Certification Resources

Access the detailed notes, source code, and complete video tutorials for the AWS Certified Cloud Practitioner (CLF-C01) certification via the links below:

AWS Certified Cloud Practitioner (CLF-C01) Repository
AWS Certified Cloud Practitioner (CLF-C01) Playlist
Mega's Notes (Special thanks to Mega Satish for her helpful notes)
viXra viXra Preprint
Full Paper (IJRASET)
Computer Engineering Resources

AWS YouTube Playlist

Detailed tutorials for specific AWS services:

AMAZON IAM TUTORIAL
AMAZON EC2 INSTANCE TUTORIAL
AMAZON LIGHTSAIL WORDPRESS TUTORIAL
AMAZON S3 TUTORIAL
AMAZON EBS VOLUME TUTORIAL
AMAZON EFS TUTORIAL
AMAZON RDS TUTORIAL
AMAZON VPC AURORADB TUTORIAL
AMAZON LOAD BALANCER TUTORIAL

Citation

Please cite this work as:

Thakur, Amey. "Pizza Ordering Chatbot Using Amazon Lex". AmeyArc (Mar 2022). https://amey-thakur.github.io/posts/2022-03-19-pizza-ordering-chatbot-using-amazon-lex/.

Or use the BibTex citation:

@article{thakur2022amazonlex,
  title   = "Pizza Ordering Chatbot Using Amazon Lex",
  author  = "Thakur, Amey",
  journal = "amey-thakur.github.io",
  year    = "2022",
  month   = "Mar",
  url     = "https://amey-thakur.github.io/posts/2022-03-19-pizza-ordering-chatbot-using-amazon-lex/"
}

References

[1] Jinesh Varia and Sajee Mathew, "Overview of Amazon Web Services", Amazon Web Services, 2014, https://d36cz9buwru1tt.cloudfront.net/AWS_Overview.pdf [Accessed: Mar. 19, 2022].
[2] Radhika Soni and Radhika Thapar, "Acceptance of Chatbots by Millennial Consumers", International Journal of Research in Advance Engineering, Nov. 2018, https://www.researchgate.net/publication/332961953_Acceptance_of_Chat_bots_by_Millennial_Consumers [Accessed: Mar. 19, 2022].
[3] AWS Documentation, Amazon Web Services, https://docs.aws.amazon.com [Accessed: Mar. 19, 2022].
[4] Amazon Lex Documentation, Amazon Web Services, https://docs.aws.amazon.com/lex [Accessed: Mar. 19, 2022].
[5] AWS Lex, Amazon Web Services, https://aws.amazon.com/lex [Accessed: Mar. 19, 2022].
[6] Amey Thakur, "Pizza Ordering Chatbot Demo", YouTube, https://youtu.be/6iLgN_1e4DU [Accessed: Mar. 19, 2022].
[7] Amey Thakur, "The Complete Guide To The Pizza Ordering Chatbot", YouTube, https://youtu.be/FHbXSo95S7A [Accessed: Mar. 19, 2022].
[8] Amey Thakur, "AWS Certified Cloud Practitioner (CLF-C01) Repository", GitHub, https://github.com/Amey-Thakur/AWS-CERTIFIED-CLOUD-PRACTITIONER-CLF-C01 [Accessed: Mar. 19, 2022].