Pizza Ordering Chatbot Using Amazon Lex
Amey Thakur
1
, Mega Satish
2
1-2
Department of Computer Engineering, University of Mumbai, Mumbai, Maharashtra, India
1
2
Abstract 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.
KeywordsAmazon Lex, Amazon Web Services (AWS), Chatbot.
I. INTRODUCTION
A. 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.
Figure 1: 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.
1
B. Advent of Conversational Interactions –
Figure 2: Advent of Conversational Interactions
C. 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.
D. 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.
2
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
II. 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.
III. OVERVIEW OF AMAZON LEX
A. 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).
3
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.
B. Features of Amazon Lex
C. The Need For Amazon Lex –
Figure 3: The Need For Amazon Lex
4
D. Benefits of Amazon Lex
- Offers an easy to use console & predefined bots.
- Employs advanced deep learning functionalities.
- Provides seamless deploying & Scaling.
- Offers built-in integration with AWS platform.
- Cost-effective platform to create bots.
E. 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.
F. Working of Amazon Lex
Figure 4: Working of Amazon Lex
5
G. Amazon Lex Use Case
- To get banking information through an Amazon Lex chatbot.
Figure 5: Workflow of getting banking information through a Chatbot
Figure 6: Preview of Flow of Conversation
6
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.
H. How Amazon Lex Operates?
Figure 7: 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.
I. 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.
7
IV. IMPLEMENTATION
A. 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 OrderFlowers blueprint.
- Leave the default bot name (OrderFlowers).
- 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.
8
B. Snapshots of Testing a Bot –
1. Conversation of confirming the order of pizza
9
10
2. Conversation of cancelling an order
11
12
V. 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.
REFERENCES
[1] Varia, Jinesh, and Sajee Mathew. "Overview of amazon web services." Amazon Web Services 105 (2014).
[2] Soni, Radhika & Thapar, Radhika. (2019). Acceptance of Chatbots by Millennial Consumers.
[3] AWS Documentation - https://docs.aws.amazon.com
[4] Amazon Lex Documentation - https://docs.aws.amazon.com/lex
[5] AWS Lex - https://aws.amazon.com/lex
[6] Pizza Ordering Chatbot Demo - https://youtu.be/6iLgN_1e4DU
[7] The Complete Guide To The Pizza Ordering Chatbot - https://youtu.be/FHbXSo95S7A
[8] GitHub Repository - https://github.com/Amey-Thakur/AWS-CERTIFIED-CLOUD-PRACTITIONER-CLF-C01
13