Dynamic Conversational Chatbot using Amazon Web Services

DOI : 10.17577/IJERTCONV9IS03063

Download Full-Text PDF Cite this Publication

Text Only Version

Dynamic Conversational Chatbot using Amazon Web Services

1st Prof. Suvarna Aranjo Information Technology Xavier Institute Of Engineering Mumbai, India

3rd Aadesh Gindodiya Information Technology Xavier Institute Of Engineering Mumbai, India

2nd Harshvardhan Chunawala Information Technology Xavier Institute Of Engineering Mumbai, India

4th Naimesh Bhatt Information Technology Xavier Institute Of Engineering Mumbai, India

AbstractThe proposed system is a service-based chatbot. The chatbots infrastructure is based on Amazon Web Services (AWS). It makes use of AWS components such as Amazon Lex, Amazon DynamoDB, Amazon Cloudwatch, Amazon S3, Amazon Cognito, and Amazon IAM. To extend the functionality of the chatbots, a third-party service Twilio is been used. It provides the customers to order ice cream and book hotel rooms, rental cars for travel through SMS too. As its a cloud-based infrastructure, it can easily deploy our chatbot and integrate it with any other platform or even separately on websites through API. We have stressed on our chatbots security. It is able to mitigate attacks as it has a cloud-based infrastructure.

KeywordsAWS, NLP, Chatbot, AI, Amazon, Cloud, Amazon Web Services, Bot, Dynamic, Infrastructure.

  1. INTRODUCTION

    The term chatbot was derived from the chat robots. In 1994 the term chatterbot was coined. The first chatbot in the history of Computer science was developed by Joseph Weizenbaum at Massachusetts Institute of Technology (MIT), known as ELIZA[1]. In 1995 a more advanced version was designed by Richard Wallace called ALICE [2].

    Chatbot's primary function is to understand human language. Converting natural language is the goal. Today in chatbots, the utterance is pre-defined. When the user interacts with the chatbot, the set of words that the user uses to converse are being matched by the collection of words and sentences present inside the stack of utterances. The performance of the chatbot mainly depends on how vast the stack of utterances is and the conversion of the natural language. Chatbots are very popular, considering the availability, deployment, and application in various sectors and institutes of society. In 2018 Facebook announced 300,000 active chatbots on Facebook Messenger [3] ranging from general-purpose chatbots such as Microsoft Zo to customer service representatives and shopping advisors such as UPS and Sephora. Chatbots needs to be more engaging.

    "Natural Language and Natural Selection," researchers Steven Pinker and Paul Bloom theorize that a series of calls or gestures evolved over time into combinations, giving us complex communication, or language [4]. The situation around humans became complicated; they needed to convey the

    information. From making gestures to grunt sounds which lead to words. This explains the reasons which lead to the formation of human language.

    The challenge faced by developers in building a chatbot is making the system learn the human language. Today there are roughly 7,102 spoken languages. Understanding each language from its origin, its advancement till now, the civilization which developed it, its geographical location is significant in terms of developing a language that chatbot can make conversations.

  2. NATURAL LANGUAGE PROCESSING Natural Language Processing, its a type of artificial

    intelligence technology that aims to interpret, recognize, and

    understand user requests. It analyses an enormous amount of natural language data. In 1950, Alan Turing wrote a paper describing a test for a thinking machine. He stated that if a machine could be part of a conversation through the use of a teleprinter, and it imitated a human so completely there were no noticeable differences, then the machine could be considered capable of thinking [5]. In 1952, the Hodgkin-Huxley model described how the brain uses neurons in forming an electrical network. These researches inspired the idea of Artificial Intelligence (AI), Natural Language Processing (NLP). NLP breaks down the language into shorter, more basic pieces, called tokens (words, periods, etc.), and attempts to understand the relationships of the tokens. This process often uses higher- level NLP features, such as follows.

    1. Content Categorization: A linguistic document that includes content alerts, duplication detection, search, and indexing.

    2. Topic Discovery and Modeling: Captures the themes and meanings of text collections, and applies advanced analytics to the text.

    3. Contextual Extraction: Automatically pulls structured data from text-based sources.

    4. Sentiment Analysis: Identifies the general mood or subjective opinions. Useful for opinion mining.

    5. Text-to-Speech and Speech-to-Text Conversion: Transforms voice commands into text, and vice versa.

    6. Document Summarization: Automatically creates a synopsis, condensing large amounts of text.

    7. Machine Translation: Automatically translates the text or speech of one language into another.

  3. LITERATURE REVIEW

    An overview of artificial intelligence-based chatbots and an example chatbot application, Naz Albayrak, Aydeniz Özdemir, Engin Zeydan.- In [6] this paper, we present the general working principle and the basic concepts of artificial intelligence-based chatbots and related concepts as well as their applications in various sectors such as telecommunication, banking, health, customer call centres, and e-commerce. Additionally, the results of an example Chabot for donation service developed for telecommunication service provider are presented using the proposed architecture.

    Intelligent Chatbot for Easy Web-Analytics Insights, Ramya Ravi In [7] this paper, I am comparing two widely used analytics tools based on their ease of use. In the light of the same, I am proposing an Artificial Intelligence Machine Learning (AIML) driven chatbot that is fueled with analytics' raw data, that will enable bot-users to get business insights by just typing in the query.

    Determining the accuracy of Chatbot by applying Algorithm Design and Defined process, Suprita Das, Ela Kumar -Our [8] emphasis is based on accuracy to determine the chatbot system. However, the technology which enables people to banter with the machine in their language by means of a machine interface is picking up prominence in an assortment of questions mainly for user benefit. Although these components are impelling the present enthusiasm for chatbots, be that as it may, the current hype around this phenomenon may not turn out to be economical after some time without a more grounded business method of reasoning and better beneficial results.

  4. AMAZON WEB SERVICES

    Amazon Web Service (AWS) is a cloud-based platform. AWS is a subsidiary company of Amazon that provides services from data analytics, cloud computing, and management, etc. AWS provides an inbuilt infrastructure. Its services include business application, robotics, content delivery, customer engagement, end-user computing, storage, machine learning, developer tools, database, game tech, media services, etc.

  5. PROPOSED SYSTEM

    The demand for chatbots is widely increasing because of its problem-solving skills, less time consumption, and cost-saving factor. The primary issue with any chatbot is they are system- specific. Chatbots are designed according to industry needs, e.g., e-commerce for returning a purchased product. But this same chatbot system can be used for selling ice cream, yoghurts, renting cars, and booking hotel rooms. We aim to deveop a chatbot that can be made applicable in most of the industry sector.

    There are two dynamic chatbots using cloud technology. The cloud services we are opting for is Amazon web services(AWS). AWSs inbuilt services such as data management, converting text to audio and vice versa, etc. can be utilized. As the services provided by AWS are globally available, this makes our system infrastructure highly available. Our chatbot can be used in the food industry, e-commerce industry, travel industry, etc. We have combined three services

    and integrated them on a single website. Here customers can opt to buy ice cream and rent cars, book hotel rooms.

  6. FOLLOWING ARE AWS SERVICES USED IN OUR CHATBOTS

    Amazon Lex is a service for designing chatty interfaces into the application using voice and typed. It assists the bot to process everyday consumer requests. It also lets us build an app base like a booking system, ordering system, booking tickets, ordering food, or calling a cab.

    Aws lambda is a compute service that makes it easy to build applications that respond quickly to new information. It helps to query business applications, provide information back to callers and make updates as requested and also maintain context and manage the dialogue, dynamically adjusting responses based on the conversation.

    Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale. It is a no sequel database. It provides DynamoDB Streams, which are used to dynamically send product updates made in the DynamoDB table to an Elasticsearch cluster provided by Amazon Elasticsearch service. It is also a database that delivers single-digit millisecond performance.

    Amazon Cloudwatch is a monitoring and observability service built for developers and IT managers. It gives us insights into the Bots metrics that help the user to see the resources being consumed.

    Amazon Simple Storage Service S3 is an object storage service that offers industry-leading scalability, data availability, security, and performance.

    Amazon Cognito is used to attach sign-up, sign-in, and access control to applications quickly and easily. This helps the chatbots to maintain its accessibility

    Amazon IAM is an Identity and Access management through which we are able to use and secure AWS resources in a secure manner. IAM can set user permission and manage access easily.

  7. THIRD-PARTY SERVICE TWILIO

    Its a cloud-based communication platform where its software allows the customers to make the booking through SMS. They can get the complete details of the services and can opt for it accordingly. Both of the chatbot are using Twilio. Customers will be able to order ice cream and yoghurts. They can also book hotel rooms and car rental services as well.

  8. SYSTEM INFRASTRUCTURE DESIGN

    Fig. 1. System Architecture

      1. It needs to set up an account in Amazon Web Services. Enter the account information and verify the phone number.

      2. Create Amazon DynomoDb table with proper indexes and initialize the Lambdas environment.

      3. The Lambda bot deployment function is connected to Cloudwatch.

      4. Cloudwatch provides the metrics of our bot.

      5. DynamoDB product table and Lambda bot deployment are connected to Lambda, which is the back end of the bot.

      6. Lambda bot backend fetches order table from DynamoDB order table.

      7. The lambda bot deployment and lambda backend are connected to Amazon lex.

      8. Amazon Lex acts as a development interface for our bot and lets us customize via intents, utterance, replies and error messages.

      9. AWS S3 is used to make the chatbot available on the web.

      10. Amazon Cognito allows user to manage user identity access control for the chatbot.

  9. SYSTEM INFRASTRUCTURE DESIGN

    We created an Amazon Lex bot and initialized our bot with a name. After that, Intents were created. The utterance inside the intents was customized according to usability. Here the product that we are selling is ice creams and yoghurt. The other bot using the same infrastructure type allows users to rent a car with options such as economy, midsize, and luxury and book hotel rooms ranging from the queen, king and deluxe rooms. We labelled the intents with flavours of different ice creams. These intents are the activities that are triggered as per customers converses with the chatbot. In many instances, the chatbot might not be able to understand. Hence to make the user realize we came up with a response that bot will reply is, Sorry, I didnt understand you.

    Since the bot has a custom made intent, its mentioned ice cream in the following utterances. This same was followed for booking hotel rooms and car rental services.

    I would like to order ice cream.

    I would like to order vanilla ice cream.

    I would like to order 5 cups of strawberry ice cream. Send me 8 cups of vanilla ice cream.

    Then the product type slot was created. The product here is ice cream, yoghurt, rent cars, and book hotel rooms. Ice cream flavours such as chocolate, vanilla, strawberry, mango are included. There is three slot type as follows.

        • Product Type

        • Slot Type

        • Quantity Type.

          The product types in the bot systems contain ice creams, yoghurt, hotel rooms and car rental service. The Slot type contains flavours of ice cream. For the car rental service, we have slot type as economy, midsize and luxury. The slot type for hotel rooms is queen, king and deluxe.

          The quantity type contains the quantity of the product ordered. We have also kept a threshold of at least 5 cups.

          Now to support this process, it needs to create a database that categories our products. This can be done through Amazon DynamoDB. The following are the steps necessary to create DynamoDB.

        • Table Name

        • Primary Key

    A table named myproducts contains the Product, and the primary key is the product ID which is assigned to the products in the table. The details of the product stored in DynamoDb through the following snippet of code.

    {

    Productid: 6, ProductType: ice cream, ProductFlavor: flavor

    }

    The Amazon Lex fetches this data through the backend of lambda and lambda function parses the request to DynaboDB to fetch the details.

    Fig. 2. Ice cream bot conversion

    23:58

    User

    yes

    23:58

    Book MY Trip BOT

    Thanks, I have placed your reservation. Please let me know if you would like to book a car rental, or another hotel.

    User

    book car

    23:59

    Book MY Trip BOT

    Is this car rental for your 4 night stay in New york on 2019-11- 28?

    23:59

    Is this car rental for your 4 night stay in New york on 2019-11- 28?

    23:59

    User

    yes

    23:59

    yes

    23:59

    Book MY Trip BOT

    How old is the driver of this car rental?

    23:59

    How old is the driver of this car rental?

    23:59

    User

    Fig. 3. Ice cream bot conversation

    The following bot uses only lambda functions as its backend and it is not connected to DynamoDB. Our Chatbot self initiates the conversation by asking, What city will you be staying in? Then the customer converses with the bot as follows.

    What city will you be staying in?

    23:58

    What city will you be staying in?

    23:58

    Book MY Trip BOT

    Book MY Trip BOT

    20

    23:59

    20

    23:59

    What type of car would you like to rent? Our most popular options are economy, midsize, and luxury

    23:59

    What type of car would you like to rent? Our most popular options are economy, midsize, and luxury

    3:59

    midsize

    23:59

    midsize

    23:59

    Book MY Trip BOT

    User

    The price of this midsize rental in New york from 2019-11-28 to 2019-12-02 is 956 dollars. Shall I book the reservation?

    23:59

    The price of this midsize rental in New york from 2019-11-28 to 2019-12-02 is 956 dollars. Shall I book the reservation?

    23:59

    User

    yes

    23:59

    yes

    23:59

    New york

    23:58

    New york

    23:58

    User

    What day do you want to check in?

    23:58

    What day do you want to check in?

    23:58

    Book MY Trip BOT

    Book MY Trip BOT

    Thanks, I have placed your reservation.

    23:59

    Book MY Trip BOT

    Book MY Trip BOT

    King

    The price of this 4 night stay in New york from 2019-11-28 is 960 dollars. Shall I book the reservation?

    The price of this 4 night stay in New york from 2019-11-28 is 960 dollars. Shall I book the reservation?

    Book MY Trip BOT

    User

    Tomorrow

    23:58

    Tomorrow

    23:58

    How many nights will you be staying?

    23:58

    How many nights will you be staying?

    23:58

    4

    23:58

    4

    23:58

    User

    What type of room would you like, queen, king or deluxe?

    23:58

    What type of room would you like, queen, king or deluxe?

    23:58

    User

    23:58

    According to the above conversation Book MY Trip BOT can book the hotel room first. Due to its dynamic nature, it gives the user again the option to book another room or car rental service. Then if the customer opts for a car rental service, the bot provides the customer with the option of types of cars available for the service. Considering the customer's engagement factor, the bot also asks the customer the age of the driver. As for the safety purpose, if the age is below 18, the bot reacts as follows. By continuing the conversation, the bot gives the option to select a different age. If the age is above 18 then the bots accept the booking as follows.

    Book MY Trip BOT

    How old is the driver for this rental?

    00:07

    User

    17

    00:07

    Your driver must be at least eighteen to rent a car. Can you provide the age of a different driver?

    00:07

    Your driver must be at least eighteen to rent a car. Can you provide the age of a different driver?

    00:07

    Book MY Trip BOT

    User

    1. Keith D. Foote, A Brief History of Natural Language Processing (NLP), Dataversity, May. 2019. Accessed on: Dec. 11, 2019. [Online]. Available: https://www.dataversity.net/a-brief-history-of-natural- language-processing-nlp/#

    2. N. Albayrak, A. Özdemir and E. Zeydan, "An overview of artificial intelligence based chatbots and an example chatbot application," 2018

      19

      00:07

      Book MY Trip BOT

      What type of car would you like to rent? Our most popular options are economy, midsize, and luxury

      What type of car would you like to rent? Our most popular options are economy, midsize, and luxury

      In our chatbot, we have assigned the prices of our services. Hence it also fetches the data from the database and states the price according to the customer booking.

      car rental

      01:34

      Book MY Trip BOT

      Is this car rental for your 3 night stay in New york on 2019-11- 29?

      01:34

      Is this car rental for your 3 night stay in New york on 2019-11- 29?

      01:34

      User

      yes

      01:34

  10. FEATURES OF THE CHATBOTS

      1. Accurate Replies

      2. Multi-device support

      3. Fast database

      4. Secured deployment

      5. API Support

      6. Data on Cloud

      7. Buy Stuff

      8. Easy integration

      9. Easy to customize

  11. CONCLUSION

The chatbot is using Amazon Web Services. It can book a hotel room, car rental services and buy ice cream and yoghurt. The bot can be used as a backbone to develop other chatbots for the service industries. Using AWS, it is easy for the chatbots to scale and be highly available. AWS helps to cut down the cost by its pay as you go model. In AWS the machine learning is already embedded. It increases our chatbots accuracy.

REFERENCES

  1. M. Salecha, Story of ELIZA, the first chatbot developed in 1966, Analytics India Magazine. Accessed on: Nov. 20, 2019. [Online]. Available: https://www.analyticsindiamag.com/story-eliza-first- chatbot-developed-1966/.

  2. "A brief history of Chatbots", Medium. Accessed on: Nov. 29, 2019 [Online]. Available: https://chatbotslife.com/a-brief-history-of- chatbots-d5a8689cf52f.

  3. Marion Boiteux, Messenger at F8 2018, Medium, May. 2018. Accessed on: Dec. 01, 2019. [Online]. Available: https://blog.messengerdevelopers.com/messenger-at-f8-2018- 44010dc9d2ea.

  4. Charles W. Bryant, How did language evolve?, HowStuffWorks Accessed on Dec. 05, 2019 [online]. Available: https://science.howstuffworks.com/life/evolution/language-evolve.htm

26th Signal Processing and Communications Applications Conference (SIU), Izmir, 2018, pp. 1-4.

  1. R. Ravi, "Intelligent Chatbot for Easy Web-Analytics Insights," 2018 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Bangalore, 2018, pp. 2193-2195.

  2. S. Das and E. Kumar, "Determining Accuracy of Chatbot by applying Algorithm Design and Defined process," 2018 4th International Conference on Computing Communication and Automation (ICCCA), Greater Noida, India, 2018, pp. 1-6.

  3. A. Argal, S. Gupta, A. Modi, P. Pandey, S. Shim and C. Choo, "Intelligent travel chatbot for predictive recommendation in echo platform," 2018 IEEE 8th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, NV, 2018, pp. 176-183.

  4. W. Zhang, H. Wang, K. Ren and J. Song, "Chinese sentence based lexical similarity measure for artificial intelligence chatbot," 2016 8th International Conference on Electronics, Computers and Artificial Intelligence (ECAI), Ploiesti, 2016, pp. 1-4.

  5. H. N. Io and C. B. Lee, "Chatbots and conversational agents: A bibliometric analysis," 2017 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM), Singapore, 2017, pp. 215-219.

  6. B. Kohli, T. Choudhury, S. Sharma and P. Kumar, "A Platform for Human-Chatbot Interaction Using Python," 2018 Second International Conference on Green Computing and Internet of Things (ICGCIoT), Bangalore, India, 2018, pp. 439-444.

  7. N. Rosruen and T. Samanchuen, "Chatbot Utilization for Medical Consultant System," 2018 3rd Technology Innovation Management and Engineering Science International Conference (TIMES-iCON), Bangkok, Thailand, 2018, pp. 1-5.

  8. Kvale K., Sell O.A., Hodnebrog S., Følstad A. (2020) Improving Conversations: Lessons Learnt from Manual Analysis of Chatbot Dialogues. In: Følstad A. et al. (eds) Chatbot Research and Design. CONVERSATIONS 2019. Lecture Notes in Computer Science, vol 11970. Springer, Cham

  9. Ischen C., Araujo T., Voorveld H., van Noort G., Smit E. (2020) Privacy Concerns in Chatbot Interactions. In: Følstad A. et al. (eds) Chatbot Research and Design. CONVERSATIONS 2019. Lecture Notes in Computer Science, vol 11970. Springer, Cham

  10. Hoon G.K., Yong L.J., Yang G.K. (2020) Interfacing Chatbot with Data Retrieval and Analytics Queries for Decision Making. In: P. P. Abdul Majeed A., Mat-Jizat J., Hassan M., Taha Z., Choi H., Kim J. (eds) RITA 2018. Lecture Notes in Mechanical Engineering. Springer, Singapore

  11. Latioui Z.E., Bougueroua L., Moretto A. (2020) Social Media Chatbot System – Beekeeping Case Study. In: Madureira A., Abraham A., Gandhi N., Varela M. (eds) Hybrid Intelligent Systems. HIS 2018. Advances in Intelligent Systems and Computing, vol 923. Springer, Cham

  12. Liebrecht C., van Hooijdonk C. (2020) Creating Humanlike Chatbots: What Chatbot Developers Could Learn from Webcare Employees in Adopting a Conversational Human Voice. In: Følstad A. et al. (eds) Chatbot Research and Design. CONVERSATIONS 2019. Lecture Notes in Computer Science, vol 11970. Springer, Cham

  13. Hobert S., Berens F. (2020) Small Talk Conversations and the Long- Term Use of Chatbots in Educational Settings Experiences from a Field Study. In: Følstad A. et al. (eds) Chatbot Research and Design. CONVERSATIONS 2019. Lecture Notes in Computer Science, vol 11970. Springer, Cham

  14. Buhalis D., Cheng E.S.Y. (2020) Exploring the Use of Chatbots in Hotels: Technology Providers Perspective. In: Neidhardt J., Wörndl W. (eds) Information and Communication Technologies in Tourism 2020.

    Springer, Cham

  15. Baena-Perez R., Ruiz-Rube I., Dodero J.M., Bolivar M.A. (2020) A Framework to Create Conversational Agents for the Development of Video Games by End-Users. In: Dorronsoro B., Ruiz P., de la Torre J., Urda D., Talbi EG. (eds) Optimization and Learning. OLA 2020. Communications in Computer and Information Science, vol 1173. Springer, Cham

Leave a Reply