BOT is one of Buzz word now days. Everyone is taking about BOT Services. I thought to explore it and came here with my understanding and 10 easy steps to create your first chat Bot using Azure Bot Services.
So, let’s start by understanding What is CHAT BOT? Just think Chat BOT/BOT an intelligent program which interacts with human or users. or we can say it is a simulator which simulates conversation with human users.
As mentioned that it is an intelligent program which use Machine learning to understand the pattern and respond accordingly. In Nutshell, we can say an Artificial Intelligent program which trend using Machine learning to mimic human chat.
Microsoft, Facebook, and other companies came up their own chat Bot framework.
Here in this example, we are talking about Microsoft Azure Bot Service which is super easy. You can create chat Bot and deploy & inject with different sources like Skype, your own site, slack, Facebook etc. Although, in this post, we are going to create chat bot only. Integration with other sources like Facebook, Slack is not part of this post. We will see in upcoming posts.
There is only one major prerequisite for creating your chatbot which is Azure portal account.
Now, let’s create your first Chat bot using Azure Bot Service.
Step 1:- You will get Bot Service option which is currently in preview mode through the following option
App Services —> Intelligence + analytics —-> Bot Service (Preview)
Once you click the Bot Service you will get following option where you have to define the basic information like App Name & Location where you want the server.
Step 2:- Once you created it you will get the following screen where you need to create AppId which is a prerequisite to authenticate your bot with bot framework.
when you click “Create Microsoft App ID and password” button you will get the following screen. Where you need to create password and paste in the below screen once you have done with copy /paste of password, you have to click “Finish and go back to Bot Framework” button
Step 3:- You will below screen where your need to select your code languages like C# or Node.Js. As I like C# so I have selected C# from the below screen.
Just, below this language option, you have some other options as well as shown in below screen which is basically a template of your bot. You can select any template which make sense or fulfill your objective. In this example I have selected Language understanding template.
Step 4:- Now, when you continue with above option. The next interesting objective is to teach your Bot through LUIS where LUIS stands for Language Understanding Intelligence service. Here, LUIS helps to teach BOT. You can directly login to https://www.luis.ai and work for AppID which we created earlier in the steps.
Step 5 : Once you logged in LUIS you will get the following screen which a dashboard from where you can manage your Chatbot application’s model.
The next step is to teach your Model.
Step 7 : If you are not aware of LUIS currently just understand it is a teacher which teach your bot for the intents. Suppose you said “Hello” then your intention is greeting and so in this way we can teach our model. I will share a separate post for LUIS soon.
Step 8:- You can train your Model by option “Train “ in left bottom. Once your training is done and you think it is working fine then you can deploy or publish it. You can test it query parameter as shown below in the screen.
Step 9: Once you are done with LUIS you came back to your Azure Bot service application here you can manage the C# code and modify it further for the different intent which you set in LUIS. for example, In above screen, you will find three intents which are none, Location & Greetings. Similar way you can create multiple intents to make your chatbot robust. Here if you see the code in Azure itself and you don’t need to worry for different settings for publishing and make the code up and running.
Step 10:- As we added different Intents in our chat model so we need to update our C# code as well. To add any intent you need to modify “BasicLuisDialog.csx” as highlighted in yellow below.
if you see above image you will find we have added the our two intents which are Greetings, Locations and wrote our custom logic.
We can test right away by entering the different statement in chat in right chat panel.
Once you satisfied with your work just publish it. I hope this might be enough content for hands on your first Azure Chat Bot Service. I know you might face some challenges in LUIS but trust me it is super easy just try it your end and in any case, I am going to write another post for LUIS.
Please, share your inputs what you think about this post and Azure Bot Service.