Getting Started with Chatbots
eBook - ePub

Getting Started with Chatbots

Learn and create your own chatbot with deep understanding of Artificial Intelligence and Machine Learning

Akhil Mittal

Compartir libro
  1. English
  2. ePUB (apto para móviles)
  3. Disponible en iOS y Android
eBook - ePub

Getting Started with Chatbots

Learn and create your own chatbot with deep understanding of Artificial Intelligence and Machine Learning

Akhil Mittal

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

A complete guide to build a better Chatbots Key Features

  • Concept of artificial intelligence (AI) and machine learning
  • How AI is involved in creating chatbots
  • What are chatbots
  • Chatbot development
  • Live chatting
  • Create chatbot with technologies such as Amazon Lex, Google Dialogflow, AWS Lambda, Microsoft Bot Framework, and Azure
  • Deploy and talk to your bot


Description
This book makes you familiar with the concept of the chatbot. It explains what chatbot is, how does a chatbot work, and what exactly is the need for a chatbot in today's era? It focuses on creating a bot using Amazon's Lex service and getting the bot deployed on Facebook messenger for live chatting. This book
will train you on how to create a chatbot using Google's Dialogflow and test the bot in Dialogflow console. It also demonstrates how to create a custom chatbot using Microsoft's bot framework and enable the webhooks in Dialogflow and return the response from the custom bot to Dialogflow intents as a fulfilment response. What You Will Learn

  • Learn the concept of chatbot
  • Learn how chatbots and AI work hand in hand
  • Learn the concept of machine learning in chatbots
  • Get familiar with chatbot services such as Amazon's Lex and Google's Dialogflow
  • Learn how to write an AWS Lambda function
  • Learn what webhooks are
  • Learn about Microsoft's Bot Framework
  • Write your own custom chatbot
  • Deploy the chatbot on Facebook Messenger, Google Assistant, and Slack
  • Live chatting with your own chatbot


Who This Book Is For

  • The developers, architects, and software/technology enthusiasts who are keen to learn the cutting-edge technologies and want to get a hands-on experience on AI by creating their own custom chatbots.
  • Organizations, small companies, service-based/product-based setups which want to learn how to create a basic chatbot on their website and on social media to get more leads and reach to the end user for their business.
  • Students, if they are seeking something where they can create and integrate the real-time chatbots in their projects.
  • Table of Contents
    Section 1: The Concept
  • What are Chatbots?
  • How Chatbot Works
  • What is the Need for a Chatbot?
  • Conversational Flow?
  • Section 2: Creating a Chatbot Using Amazon Lex
  • Amazon Lex and AWS Account
  • Create Bot Using Amazon Lex
  • AWS Lambda Function
  • Slots
  • Error Handling
  • Deploy the Bot on Facebook Messenger
  • Live Chatbot on Facebook
  • Section 3: Creating a Chatbot Using Dialogflow API and Microsoft's Bot Framework
  • Technical Requirements
  • Dialogflow Account
  • Creating a Bot in Dialogflow
  • Dialogflow Console
  • Integrating the Bot with Slack
  • Chatbot Using Microsoft Bot Framework
  • Publishing the Bot from Visual Studio to Azure
  • Register the Bot
  • Dialogflow.v2 SDK
  • Webhooks in Dialogflow
  • Testing the Bot
  • Deploy the Chatbot in Facebook Messenger
  • Live Chatbot on Facebook
  • Deploy the Chatbot in Slack
  • Future of Chatbots

  • About the Author
    Akhil Mittal is two times Microsoft MVP (Most Valuable Professional) firstly awarded in 2016 continued in 2017 in Visual Studio and Technologies category, C# Corner MVP since 2013, Code Project MVP since 2014, a blogger, author and likes to write/read technical articles, blogs and books. He works as a Sr. Consultant with Magic Edtech (https://www.magicedtech.com/) which is recognized as a global leader in delivering end to end learning solutions. He has an experience of around 12 years in developing, designing, architecting enterprises level applications primarily in Microsoft Technologies. He has a diverse experience in working on cutting edge technologies that include Microsoft Stack, AI, Machine Learning and Cloud computing. Akhil is an MCP (Microsoft Certified Professional) in Web Applications and Dot Net Framework. linkedin: linkedin.com/in/akhilmittal

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Getting Started with Chatbots un PDF/ePUB en línea?
Sí, puedes acceder a Getting Started with Chatbots de Akhil Mittal en formato PDF o ePUB, así como a otros libros populares de Computer Science y Computer Engineering. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2019
ISBN
9789388511896

SECTION 1

The Concept

A chatbot is not rocket science, but a software primarily defined by artificial intelligence (AI) means that can work as a simulator to the conversation with an end user in normal language. A chatbot can talk to the user in any defined language; it is programmed by taking possible user intents into account i.e. what all queries or conversation a user can possibly have while communicating. A chatbot can be in the form of a messaging application like Facebook messenger, Slack, Google Assistant, it could be any mobile application, a plugin in any website or as simple as an Interactive Voice Response System (IVRS) of a telephone.
A chatbot interacts with a human giving an impression as if the communication is happening between two individuals; on the contrary, it is the conversation between a human and a machine. Chatbot leverages Natural Processed Language (NPL) to communicate with an end user. It responds to the queries or questions asked by an end user on behalf of the business it is used for.
This section focuses on understanding the basic concept of chatbot before getting started with the development. It is very important to understand, what chatbots are, how chatbots work, what do we mean by conversational flow, what is the terminology used while developing a chatbot.

CHEPTER 1

What are Chatbots?

A chatbot as defined, is more of an AI software leveraging machine learning capabilities to work. The only job of a chatbot is to get the input from the user and return the processed response as per the input. The input could be in any form for e.g. it could be a text from an end user, a live chat or a voice input. The chatbot accordingly manages to respond as per the desired/user opted response format. One of the best examples of a smart chatbot is Amazon’s Alexa or Google’s Assistant software. Chatbot responds in a very simple and natural way however the process working behind that respond could be quite complex in nature.
It’s basically just a computer program which uses machine learning techniques, voice recognition, and NLP to conduct an intelligent conversation with you, as a human. A chatbot should be able to convincingly simulate human behavior and responses and should be able to pass what is called the Turing test, developed by the scientist Alan Turing back in 1950. If you’re unable to distinguish between human responses and that of a chatbot, the chatbot has passed the Turing test. Let’s say you have a customer who’s browsing your website, it’s an e-commerce site and he has lots of options that he can choose from, and he can’t really find what he’s looking for. That’s when you can have a chat window pop up and ask him questions and guide him through the buying process. Even 5 years ago, you might have had to have a human powering that chat and answering questions, that can get expensive, but today that chat is usually powered by a bot, which the developer has built anticipating the questions that your customer might have. Another use case could be a customer who hasn’t received her order from her favorite e-commerce site. She wants to track down where exactly the order is stuck and when it’s going to be delivered. Maybe even 5 years ago she might have called up customer service, again, powered by a human and very expensive from the point of view of your company. Today an intelligent chatbot can help her navigate the process of figuring out where her order is. These are just a few use cases; there are many ways in which a chatbot can improve the customer experience and engagement for your business.
The bot creation could be categorized into three forms basically. The first is informational bots. Informational bots provide information back to our users. This may be a way that we can reduce support calls. Maybe our HR department creates a bot that allows people to ask basic HR kind of questions; when the next holiday is, what day is payday, when is the company picnic, and rather than having emails going back and forth, rather than having calls to the HR department we can answer these questions through a simple bot and pulling information out of a backend database. The second could be application bots. In application bots, we can put a front end onto some of our applications. You may already be seeing it, and you’re going to see it more with banking applications, with calendars, so these voice or text interactions could be another user interface on top of our applications. And the third one is productivity bots. Productivity bots sit on top of an application. Usually these are things we may build on to existing applications, so we may build a bot on top of a CRM or on top of other backend Enterprise applications that would allow our executives or our sales people, or really anybody in the company, to ask questions about the state of the business, and get answers through voice or text and not necessarily having to understand the applications and the user interfaces for those applications. Being able to ask very human-like questions, and receive responses, and answers to those business questions. So once the bot is built, where do we put it? Well, there are three main delivery methods that AWS has laid out for these bots. The first is through chat services. We can deploy these bots on Facebook Messenger, we can deploy them into Slack, and we can look at other chat services where there’s an interaction back and forth that way. Mobile devices will be key on a lot of these chat bots, both in voice and texting back and forth. Many of the applications, we will find, will be delivered to mobile devices, and web applications is another place where you’ll see them showing up and being utilized quite a bit, and I’m sure you’re already interacting with many of them. You probably know about some of them. Some of them hide well, and you may think you’re talking to a representative or somebody who’s helping you actually on the backend when you’re really talking to a bot.

What Makes Chatbot?

It seems that voice and chatbots really are everywhere these days, from Amazon Alexa and Apple Siri to Domino’s Dom and Google’s Allo, plus countless others. We’re seeing an explosion of conversational interfaces plugging into artificial intelligent back-end systems that are helping to enable all kinds of interesting things. There’re customer service bots, pizza ordering skills, financial consulting agents, the list goes on and on. So how do you take advantage of all these new voices and chat tools out in the world today? Do you create an Alexa Skill? Or do you create a Google Home Action? How about a Facebook Messenger chatbot or a Slack bot? How about all of them?
Machine learning algorithms along with the ability to run training and prediction on huge clusters of machines, has made possible things which would have seemed magical even 10 years ago. Especially bots, which can conduct intelligent conversations, and which can pass the Turing test. There are many complex and cutting-edge technologies, which make these bots possible like voice recognition, natural language processing, and other machine learning algorithms. But the fact is, as a developer, for you to build this bot, you don’t need to understand the nitty gritty of all of these. There are a wide variety of platforms available which abstract all these away from you and allow you to build and configure a bot very easily. Popular examples are Chat fuel, the Microsoft Bot Framework, message. ai.
Chatbots overall can be divided into two broad categories. The first of these is the rule-based chatbots, these are very primitive and basic. They only know about the rules that have been preprogrammed into the system. Let’s say the user mentions phones, maybe you want to just send the user to the mobile phones page. Such chatbots will use a simple programmatic means to parse what the user is trying to say. The other category is the artificial intelligence, or AI based, chatbots. These are intelligent, and they learn from previous conversations that users have had with the chatbot using machine learning techniques. These techniques include voice recognition if it’s a voicebot rather than a chatbot, and natural language processing to understand what the user is trying to convey. They also learn from data, which means the more you use this bot, the more you interact with it, the more intelligent it gets. This categorization is important to know as you study chatbots because the newer platforms which have sprung up are all AI-based platforms.
Bots are made of agents, which translate user requests to actionable data. This actionable data corresponds to intents, which are configured by developers, which indicate what the objective of the user might be when he or she makes a specific request. The first step in building a chatbot is to create an agent. The agent is a module, which incorporates NLP to understand what exactly it is that the user meant when he or she typed in the query. The agent transforms these user requests to actionable data and maps them to an intent, which defines the objective of the user. The agent is where you configure all the building blocks of your chatbots. Agents manage the conversation flow. They use intents, entities, contexts, and everything that we learned in this module to build an intelligent assistant for you. Bots are also made of entities, which help extract information from user speech with the help of prompts. The information retrieved is then sent on for the fulfillment. The request that the user makes will have specific portions with service information, which is passed on to the backend to fulfill the user’s request. User expressions are annotated to specify parameters which customize their queries.

CHEPTER 2

How Chatbot Works

A chatbot deeply analyses user’s input based on predefined rules or if we use the right terminology, pre-defined intents. Intents are the expected responses defined in the chatbot programming behind the scenes considering what input a user can provide. For example, while interacting with a chatbot, an end user can start the conversation by saying Hi, Hello, Hi There, etc, and so the chatbot should have intents to process this kind of inputs and respond in a similar fashion as if any human will respond for example with the responses like Hi, How can I help you?, Hello, Please let me know what do you inquire for? etc. Chatbot extracts the suitable entities from the user intents and responds back.
As a user, let’s say you’re browsing an e-commerce app on your mobile phone and you suddenly want to ask a question. A chatbot might pop up to answer your queries. You’d go ahead and type the question in a very natural way, which is the mobile phone that has the best battery life? You’ve configured a chatbot for this, so this question would be directed to Dialogflow, which would have an agent or a bot on standby to answer these queries. An agent is nothing but a programmatic model, which knows how to parse and understand exactly what the user is looking for. The agent is responsible for figuring out what the user’s intent or objective is when he or she typed in that query. Once the user’s intent has been determined, the agent might choose to ask the user additional questions to get all the information that it needs to fulfill the user’s query. The information elicited from the user is sent along in the form of parameters to some code that is hosted on some backend somewhere. This is the code that you as a developer have written to fulfill user requests. The code executes and hopefully figures out what exactly the user is looking for, a response is generated by this code, and then sent back to the agent, which then transfers this back through the Dialogflow integration, back to the chat application where the user then finally gets it as a chat response.
Identifying user’s intent is the first and most important job of a chatbot because if a chatbot does not understand what user is asking for or what user is saying, then it would not be possible for a chatbot to respond. Once a chatbot clearly understands the user’s intent the second job of a chatbot is to respond with the most meaningful response that matches or is very close to the user’s request. The response could be a pre-defined text, a piece of information that the user is seeking, processing of a request from the user thereby communicating with the business logic.
Let’s walk through a scenario to better understand how a chatbot could respond, suppose a user comes with a request to website’s (xyz.com) chatbot that provides the weather forecasting and user starts the conversation with a chatbot saying Hi, then the chatbot should respond with a welcome and ask for hat user needs. So as per chatbots’ capability to understand the request, and respond accordingly, the conversation could go as follows:
User: Hi
Bot: Hi, Welcome to xyz! How can I help you today?
User: Could you let me know the rain forecast for today.
Bot: Sure, it is likely to rain today between 5:00 pm and 8:00 pm. We suggest you take precautionary measures.
User: Could you also let me know any forecast for storms in the month of March.
Bot: No storm is forecasted in the month of March.
User: Thank you.
Bot: Thanks for talking to me. Can I help you with something else?
User: No, Than...

Índice