Create a ChatBot that will answer questions for you on Facebook Messenger | Jana Bergant | Skillshare

Create a ChatBot that will answer questions for you on Facebook Messenger

Jana Bergant

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
13 Lessons (44m)
    • 1. Introduction to the course

      1:30
    • 2. What are ChatBots and how do we build one?

      3:11
    • 3. How ChatBots work behind the scenes?

      3:03
    • 4. Create a Facebook page

      2:34
    • 5. Create a Facebook app

      2:13
    • 6. Setup API.AI

      2:25
    • 7. Connect API.AI and Facebook application

      4:21
    • 8. Have your first conversation with the bot!

      3:23
    • 9. Teach a ChatBot to answer questions

      7:25
    • 10. Test the bot and correct him or her. Make your bot smarter!

      5:05
    • 11. Make your bot super smart!

      2:03
    • 12. Publish your ChatBot

      5:37
    • 13. Concusion

      0:44

About This Class

Hello and welcome!

Do you want to build a bot that can speak? A ChatBot? Yes, a bot that can talk to your friends or customers or fans while you sleep or do something else. You can make one for your customer that keep on asking the same questions. Or if you have a community for your fans and followers that want to know your personal details. Use your imagination, any time you have to reply the same thing over and over again, someone else like a bot can do it for you. 

Now isn't that great! It's like Star wars but closer! Your bot will know how to process language and learn along the way! How cool is that?

88cdbb86

In this course we’ll build a ChatBot that can answer frequently asked questions for customers. Chat bot will communicate to it’s customers via the Facebook Messenger. 

f46883d0

At the end of the course you’ll have a fully functional ChatBot that can answer questions on your behalf. And this bot will be polite, funny. Almost like you!

At the end of the course you’ll know how to make a bot for yourself and for other people. 

af42f55e

My name is Jana Bergant and I’m a developer with over 16 years of experience. I’m an IT instructor teaching people new tech skills.  Over 3400 people are already taking my course.

I help all my students at every step of development. And I'll be here for you!

So join me and let's build a chat bot together!

Transcripts

1. Introduction to the course: hello and welcome to the course. When you learn how to make a change. What are you excited? You're very close to building your first. But so there's a revolution going on right now. And you just stepped on the train. Many Mizan a burgundy and I'm a professional. We've developer with over 16 years of experience. I'm also 90 instructor teaching people new tech skills. So in this course, you won't need any programming skills. All you need is to work with me throughout the course and you have any questions? Let me know if something is not clear, let me know. And if you like the course, please give me a thumbs up. So what we'll do is build a chat board that can answer questions. And this is how the story goes. We've just opened up a store and we're selling Macs and iPhones. And no, I'm not secretly a Mac fan or anything. This is just a story. So let's go back to the story. Our stories in Bloom and people keep asking the same questions they're calling us on the phone. Sending emails and asking questions were the Facebook which so what we'll do is build a chad. Want to answer these questions for us, and we'll have much more time to do the things that that important isn't that great. So at the end of the course would have an intelligent but that can process language and learn along the way. And you know how to be the child but for you and for other people, So let's go, let's do it. 2. What are ChatBots and how do we build one?: Hello and welcome. So what is it about? But I just simply software that automates things that we do. The type of what's getting the most coverage these days are chatbots. This means you can talk to about in your favorite chat up. They can help you find information or get something done in a seamless automated way simply by typing takes based commands. Just imagine you type in a Facebook messenger high Pizza Hut. Send me a large pepperoni pizza and the pizza shows up at your door 30 minutes later. Wow, how great is that? Businesses have now started building Chad Woods to engage with their customers or employees through messaging. Epps and both are emerging in time when the air platform appears to be in decline. Statistics show that people spend 80% of time in just three EPS, and a thing to consider is also that nine out of the top 10 used efs were made by Google and Facebook, and these giants want people to spend most of the time in their laps, so they're placing big bets on aggregating content and collecting votes to keep the users active and engaged. So if the predictions done right. Chan, What's will open a new channel for businesses to reach a large audience? The technology could permanently change the way humans interact with a digital world instead of opening a search engine, clicking on a weather side and looking up your location a well designed chair but would give you an instant geographically accurate operate from a simple text or click. Imagine if looking up documents for a legal case shattering your team's monthly meetings were providing accurate feedback to a customer. Was that easy? So what do we need to build a child? But in order to create a modern share what you need to build a pretty complicated back? And that was take advantage off concept like that. A mining machine learning and natural language processing. Oh my God. Did I scare you? Huh? Just checking. If you're still with me, don't get scared this kind of back and already exist, so we don't have to reinvent the wheel. But instead of just use one of the existing ones. Some of the most popular bought engines are a paedo tae I without a I emotional tie on sequel check fuel about. If I manage it market is fresh and vibrant, so there are new players coming up. What engines provided with all machine learning and Natural Language processing unit. Actually to do all the heavy lifting for you in this course will use an April. Okay, I, because of its intuitive interface and because it's the most popular among developers and companies, AP today, I has a lot of very useful features and give you an often to build your own chair, but completely without programming. So these are chat boards and chad with engines. Let's see in the next video how Chad Woods work behind the scenes. See you soon. 3. How ChatBots work behind the scenes?: hi and welcome in this winner will talk about the chair with architecture. We'll see how childbirth works behind the scenes and how use a chair with engine. A typical childhood architecture consists of about engine, your own beckoned Web application and a chat platform so a user would enter a message where the church platform, for example, on Facebook Messenger and this message will go through your own republication where you would validate it If everything is OK, the message would be sent to the boat engine, such as a paedo Day I. What engine would use techniques like natural language processing and machine learning toe Former response. That is the message to the user. This would be sent back to a server where he would validate it and do the app logic. And then you would send it back to the user via chat platform. The benefit of using your own Serra is that you could also communicate with other if services are there AP eyes or with your own database to store data from the user input or provide additional condom for the user, such as least off your products near images and so on. Plenty of options. This kind of architectural requires you that you program your own back, and that would be a middleman between the engine and the church platform. But as we said in this course, you will learn how to build a chat, but without programming, so you won't need to build your own back. And in this case there hit actually look like this. So this time user types a message on chat platform and the message is sent straight to Chad with engine, then the boat engine valid. It's a request and determines what the answer should be and sends it back to the chat platform. This way it's easier and faster to build yourself a child. But but on the other hand, this kind of boat is also limited. This is something you have to keep in mind, and yet we can still build some pretty amazing Chad Woods. So whether you need before you start, what you need is a Facebook developers account and an AP Today I account. Don't worry, they're both free. We need a Facebook developers, a council that we can create a Facebook application that will help us to connect Ap today I to Facebook, an AP today. I is a child with engine that provides to developers and companies advanced tools for Chad Watts and other conversational interfaces. So, in other words, it gives the knowledge to our board so they can speak. I'll show you in the later video how to do this, Okay, and this is it. So before you go to the next video, go ahead and registered as a Facebook developer and set up an account at ap dot ai. You can click on the link in the resources. Let's go. See you soon. 4. Create a Facebook page: Hello and welcome back. Are you ready? Are you register as a Facebook developer and having a P. I don't AI account. Okay. Great. Every messenger boat needs its own Facebook page, which is basically it's profile without the page. It can't use the messenger. So this is a muscle. We need to create a Facebook page. So go to the link provided in the resources and create a Facebook page. Okay, so here is the create Facebook page link and what we need to do. First he select a page type, for example, entertainment you can to something else if you want. And now choose a category. I'll choose fictional character. And don't worry, you can change category later if you want. Now in the name. All right. Smart Pape. And you must do something different. One important note here. Don't use non English characters in your page name. If use characters that are not in the English alphabet, your boat won't work. The problem is that Facebook puts the characters into your own and now click on the get started button. Now let's go through the wizard to set up a page. Write something about the page I say a smart boat. The tests you quotes from smart people and save info. Now let's add a profile picture. I have a sample picture here. It's a free image I found on the Internet, so I'll upload it. Wait a minute. SE photo. And I added two favorite. So I have a quick link unless escape this part for now. Okay, here we go. We have the page ready. What you can do before we move on is toe Add a cover photo that is here and and a description here at a website. If you have one and contact info, you can play around and make this page as comparing for your visitors as you can. And then we can move on and make next steps in creating about See you in the next. We'd all 5. Create a Facebook app: Hello and welcome back. You have the Facebook page for the boat ready, and you are now ready to move on. So let's create a Facebook application while creating a Facebook page is nothing new for some of you. But most of you have not yet created a Facebook application yet. So what is a Facebook application? It's basically a tool that helps you connect some third party service or your observer to Facebook. It's mostly used by programmers. For example, if you're building a Web or mobile app and want to have Facebook Logan in it, you have to create a Facebook application in order to communicate with Facebook servers. We will not program anything, but it will still use 1/3 party tool that is a boat engine called FBI, not a I. So we have to create a Facebook application in order to connect AP that AI to our Facebook page. Let's do it important. You have to have a Facebook developer account enabled. If you don't have it yet, go to the link in the resources and enable it. Then go to the Facebook developer page. Click on the my abs that's in the top right and select. Add a new application. Select basic set up. It is here, in the bottom of the page. The text here type in the name of your boat. In my case, Smart Vape, add your contact email. I'll type in mind and you type in yours. Okay. And select a category in my case are select entertainment and I'll click on create app I d . So here is a security check up. It's like capture. I have to select wristwatches. So here, here and here and so meet. And now we have to wait a minute. Okay? Now we have created a Facebook application. Grij up. We'll get back to it later. Leave this page open and follow me in the next widow. 6. Setup API.AI: Hello and welcome back. Now you have a Facebook page in a Facebook application and we can move on to the next step . That is appetite A. I set up to do this. You need an account at the happy dot Ai. If you don't have one created now, Link is in the resources, and in the meantime, let me tell you what ap dot ai is happy. Today. I provide developers and companies with advanced tools they need to build conversational user interfaces for absent hardware devices. It enables our boats to recognize what we say and provide accurate response. It has a built in speech recognition so you can speak to it. And just for the record, chrome browser already support speech recognition. The next thing in the US it processes the language. It recognizes the user, intent the meaning off the text and have to manage the responses. And it's free for up to 6000 Christ per month. That's great. Okay, I have a Facebook after up open, you can leave it open. Toe will need it. So let's set up about engine. Do the following click on the Create new agent. Add a name to the agent smiled rape in my case language, English and that the false time zone said Act your time zone. Mine is centrally repeating time now click safe. So what have we done? Agent corresponds to application. It's basically the same thing. We will train and test an agent and integrated with the Facebook up. And how do we do that and click on the integration stuff Enable Facebook messenger like this. And now we have to wait. And here we have the core bacterial for the Facebook application. This is the Ural Facebook application Will call each time somebody speaks to about Whoa. And now we have both a b dot ai agent and Facebook Up created. The next step is to connect them. We'll do this in the next video. Follow me. 7. Connect API.AI and Facebook application: Hello and welcome back. So now we have the Facebook up created and we've created the agent in the appetite. Ai. Let's connect them together so they will know how to communicate. Leave your appetite, AI top open and go back to Facebook. After on your Facebook upsides, do the following click on the add product in the left side bar and find messenger and click get started confirmed to get started. Message under page Select your Facebook page that you've created at the beginning. Off the course. Some pop up window will appear to approve the connection. We won't have meat for the review yet, so continue as Yanna click. OK, as you can now see, a page access token was created. This is one of the things you're happy that AI agent needs go back toe appetite. AI top and Paste is talking into the page. Access token field. Don't click Anything else just based it here. For now. What we'll do now is at a very fight open. This is a thing you have to make up on your own. It's basically a long, unique password. A good talking can be a random words. Together I'll write something like a long string for smart babe three. Don't use this token. Make up your own both RP that Ai and Facebook have to have the same verify token. This is the important part. This is a token they will use to very further requests. Now go back to Facebook top and click on the set of my book. A new window will open in this video. We have the same two fields as you have in the happy dot ai settings. First, we'll copy the verify token we have in the clipboard. So Corp it here and was described in the web hook toe all events. So check them like this and go back toe every dot Ai. And here we have the your end that Facebook will call. This is the important part. This is where the communication will take place for his work will call this Europe and get a response from a p dot ai So we need to copy to Facebook. So coffee here, go back to Facebook. Okay, Paste it here, and we can now go back toe everyday I and start the boat. Clean the start button. Wait a minute and we'll bought was started. So the cold, black Ural is now active. We can go back to Facebook and finished a wave hook. Go back. And clearly the verify and safe Facebook will now call the callback Ural and see if the euro responses. Okay, ive the verify tokens match. And, yes, it works. We have one more step left. Scroll down. We need to select a page to subscribe a web hook to the page events. So all too smart, whip and you select your page. Okay, Like this. And we actually don't need to be subscribed. Toe all events. We don't need massive deliveries and post backs. All we need is messages. We only want Facebook to call the colder Hural. When somebody posts a new message to messenger, then Facebook should call the ap dot ai. And yes, the connection between a paedo agent and the Facebook up is now, mate. Oh, you did it. Now we can train our new agent. Follow me to the next video 8. Have your first conversation with the bot!: Hello and welcome back. We've now connected Facebook app an ap dot ai grades up We can now trained at ap dot ai Agent. Let's set up a first conversation that our boat will have. We had a Facebook messenger, so go back toe ap today I tap and click on Intense That's in the left side bar and create a new intent in the user says at Tell me something smart. Tell me something smut. We cannot change the name to Smart Bash. Think now we had an action on actual corresponds to the step your application will take when a specific intent has been triggered by a user input. So on intent. Triggers in action actions can have parameters for extracting information from the user input for this day. Ma. We won't search for any additional info but will add this later. This is really, really cool, you'll see. And it's not even that heart. So let's do it. I write action too smart Dash. Think you can write the same or something else, but don't you spaces and now we'll add a speech response. Okay, this is a smart thing. This is a smart thing. So this is the response from the But this is for the bottle right back. And now you can click safe. That's a button in the top. Now we are ready to speak to the vote. Let's do this in the right side. But you can try out your boat, right? Tell me a smart I think and see what happens. And here it is. Speech response. Okay, this is a smart thing. Whoa! And we can see that even if the question is not exactly the same ap dot Ai recognizes it and sees that it's the same intent way to go ap dot ai And what we can also see is the Jason that will be sent to Facebook. We can see the results query in the speech being sent. The perimeters and the context are empty. We learn how to use them later. So you've just had your first chat with your boat? Well, this was just a test conversation on a paedo. Today, I we want to have a real conversation on Facebook Messenger. So go to your Facebook page. It's a page, not application. Click on message and write a message to a robot again. Tell me something smart and it works. Great. See you in the next video 9. Teach a ChatBot to answer questions: Hello and welcome back. So what do you want to do now? In this video, we're going to learn how to train the boat to answer questions instead of us. So this is the story with open a shop that's us ever computers and phones. And now our phone keeps on ringing in our May Lee spent with user questions day after day, answering the same questions over and over again. What we'll do is train our newly grated bought toe, answer the questions for us. Wow, When did the Great will have much more time to do the things that are important? And we can do this with what we know so far. So with intense, okay, create an intent. Just click the plus sign. And it starts with the first question. So what we're here frequently is Can I use APS from the Mac App store on more than one computer? Use EBS from the MEC app store on more than one computer. So we'll entities s user says, and we need to name the intent. I'll call it FARC. Dash up, dash more dash devices and I'll call the action Far fish at dash devices. And now we can add a response. All right, ABS from the Mac APP store may be used on any mags that you own or control for your personal use. Abs from the MEC EP store may be used on any Mex that your own or control for your personal use. OK, but what about the similar questions? Users also ask things like on one devices. Can I use the app? I don't load it. What we can do is at all similar questions, and they will trigger the same action. So let's add a question on what devices can I use the EP? I don't load it. And also, can I use a nap on all of my devices? Use UNEP on all off my devices? As you can see, I'm adding questions that have the same meaning. The more questions with the same meaning you add, the more likely it will be that every today I will recognize the user has the same intent. Okay, safety intent. So let's ride out here on the right side. You can type a question. Let's type, can I have ever on all of my devices? Can I have ever on all my devices And yes, the bots recognizes the question, even if it's not a perfect match. What we can also do is at different responses so that the body is more human, like we don't always answer in the same way so we can write. You can use the app from Mac store on any device. You have no problem the EP from Mac store on any mag devices, you have no problem. And in the same manner that we can add, all frequently asked questions. So let's add another one saved intent first here and then click on the plus sign. We lead on intense name, and it will be Father Dash delivery dash time. Now as the question When will my make could be delivered? My mech gay delivered and I have a few more questions. When is a delivery time? When is the delivery time and when will you deliver the headphones? I order When will you deliver the headphones? I ordered the more questions with the same intent us the better. Able a day I can figure out it's the same intense Okay, action can be far. There's delivery in the response. The expected time of deliveries three work days after the payment received. I expect it's time off delivery is three workdays after the payment received and another response, we give it our best and deliver the goods in three work days or sooner. Give it our best and deliver the goods in three work days or sooner now, saved intent and try to put out right the question. When will I phone get delivered and when can I expect my new Mick? When can I expect my new make? And it works perfectly. Now pause the video and at your frequently asked questions, the questions your boat will answer. I will also add a few, and here I am. I added a few questions, So let's move on and make our boat even smarter. See you in the next video. 10. Test the bot and correct him or her. Make your bot smarter!: Hello and welcome back in this video will test our new child but and make it a bit smarter . So how do we test about? Well, simple. We doctor it and we give it as much questions as possible, and even better will ask colleagues and friends to give us many as possible questions someone else might think of a question we never considered possible or would ask a question in a way we never imagined. So how do we do this? Well, we can simply at our friends and colleagues to be testes for Facebook app, and this will enable them to speak to the but right now Facebook purchase public. But if your friends type of message, they'll get no answer. Let's try these. I have another account here. My friend was so nice to give me her passport. So this is my smart babe Page clear the message and all type. Tell me something smart and what? No answer. As we said. So let's go to developers account in our EP. Click the Rose and Click Add tasters like this and find your friend My dear name, user name or Facebook. I d so okay, I and my friend like this. Now it should work. So again I'll go back to my friend's Facebook and right again tell me something smart and we'll go board now speaks to me so I'll write a few questions. Like Do I need a serial number for the EP and OK, looks fine. Can I use a gift card to buy from Mac App store and looks fine? And now, how long must I wait for a make and what? Yes. You can really note EPS from Mac App store. This looks like a nod. Answer. This is very weird. So what happened to our boat? Did you get crazy or what? And the answer is no. Ball did not get crazy. He just did not recognize the question. Well, this is not okay. We must teach our about to recognize this question as a delivery question. This is what we can do in the training step. So click on the training tap. Currently, training is still in beta version but nevertheless is still a very powerful tool. It helps to help your agent that is brought to improve. So how does it work? The training tool is designed to review can recision with your agent and use them to improve the classifications currency. The more off the relevant and diverse examples you add to the intense, the better calcification results you'll get from your agent. So basically we can view order, but got it wrong and show him or her how to do better. So click on history. What we can see here is all the history of chats that happened with our boat. Well, in our demo case, that was just me talking to the baht. So let's go back to training and we can pick the last conversation, the one I just had with the but so it looks like the boat took an answer from the FARC rhythm load intent. So let's fix this up. What we can do is manually select the right intent. That is fact delivery time like this, and we can see the green check mark. Now. This means that the boat was trained. It means that the input will be added to the signed intent and now it can improve the training. Now let's go to doing then and find the farm delivery time intent and open it. What we can see is the descendants. How long must I wait for A Mac was added to the user says Great. Now the bottle be even more accurate. Simple A So this is how we trained about what you can do Well, training is fixing the wrong or unmatched intense like we did. And you can add examples to the intense like with it. I will include a link to the commendation in the resource. Be sure to check it out. So this is it. In this video, you've learned how to test a bought, how to add testers and how to train your shed. But see you in the next video. 11. Make your bot super smart!: hi and welcome back the last thing to learn, but a very exciting feature. His domains Domains are pre made knowledge packages on ap dot i. For example, instead of creating your own intent and entities for weather info, you can use a well domain, which is already made and fully functional. So click on domains in the left side bar and you can see a list of knowledge packages that you can air to your boat and make it much more useful. A. Bill Adair has lots of free made packages. Just look at all of this knowledge. This is a very powerful tool, but we weren't. Don't go crazy and make a boat that we know how to do a 1,000,000 things. Your goal is to make a boat that will be really smart at helping you or your customers achieved the desired result. In our case, that is answered frequently as questions and have job interviews. So for the demon purposes turned on these domains small talk and wisdom. Now let's try it out in messenger. So go to messenger and opened a conversation with your butt. No, right. You are so sweet. Oh, isn't this nice And now let's ask the But who was Albert Einstein? And yes, this is true. Albert Einstein was a theoretical physicist. So our body is really smart now. But again, don't go crazy. Just built I bought that will make someone's life better and help him or her achieve goes faster. See you in the next video. 12. Publish your ChatBot: Hello and welcome. So we've finished about congratulations. I'm sticking with me. So far, This is the last step we need to make our boat available for everybody. Your Facebook page is publicly available, but the only person that is bottle currently corresponds to is you because you are the admin. In order to make this bottle respond to everyone, you have to get your Facebook approved. This might take up to several weeks, but it usually takes just a few days. So what do we need to do? Go to Facebook developer and click on the AARP review in the left side bar and now check make Europe public. It should be us. Now, Here at the pages messaging, click the edit notes. This will open up a pop up with several things to do. First, you need to check. The AB has not sent advertisements or promotional messages. Well, if you violate this rule, your app will be removed. So no advertisements also take the next one. For If you include a link to messenger toe a website, it should be clearly visible. Now select your boat page smart shape in my case. And now we need to describe what our boat does so frequently asked questions. Boot answers frequently asked questions. The next one is bought, gives current job waken sees, and the last one Boot performs a job interview. What you need to do now is creating Scream Guest. You need to record all the functionality that boat has. I used Fantasia to do it. Screen cast is also a good stool to do it, and there are also free options like Jink came studio or screen cast A Matic. I included links in the resources. So pause the video and create a screen cast and come back again. Okay, I have my screen test ready, so I'll upload it. It's my take a while, so let's wait and okay. Facebook will notify us when it's ready. So before we can send to submission, we need to add a few more things. You need to add an app icon, and it should be. 1024 picks US times. 1024 picks is you need to set it up. What you also need is a privacy policy link. If you have a website, you can just add a page. If you don't have one. Now is the perfect time to create a landing pitch. And if you don't know what kind of takes unit in a privacy policy, have a little link with a sample. It's here. You need to change the company name and the company email and you'll be all set unless you need to every platform. So click settings. No Ed and I couldn't on end my smart paper. Let's wait a while, then a search for my privacy policy ul. It's on my page, Chad, but ninja that come are copied and paste it here. And lest will every platform and weaken to strip sites like this. And now we can add a link to our page. So, Chad, what's ninja dot com? Okay, now we can save changes. And now let's go back to a preview and we'll go. The bottom submitted for review is now active. We can submit our but let's do it. And now all we can do is wait for Facebook. Why we wait. We can plan a strategy on how to promote our but grij up and I'm back. It's only been a few days, and I've received developer alert from Facebook team now I can goto a preview tape. And yes, our boat is approved and is now public. Whoa! So this is it. You made it. Your both is a life. See you in the next video. 13. Concusion: Hello and welcome. So this is it. You've learned how to use the AP. Today, I and you cannot build an intelligent but the Chad would Ecosystem is still very new and evolving their new technologies emerging every day. So I'm working really hard on making this course as fresh as possible for you. And I also keep you posted on the latest in the bottom in, if you like the course, I would appreciate if you would give me a positive review and recommend the course to our friends and colleagues. And if there's something I can help you with, just contact me and let me know. So have a great day and see you soon.