How easy to create Your first chat bot using Azure Bot Services in 10 steps


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  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.

What your face says let’s find out using Microsoft Emotion service

We always hear your face say everything. Your emotions on your face says everything. Microsoft’s did a great job to identify these expressions,these emotions  with Microsoft Cognitive Service.

Microsoft Cognitive service is an umbrella which has various APIs to help us intelligently.

Emotion API is one of them to determine the the expression or emotion in a image.

With the help of this Emotion service we can easily identify the emotion like happy, sad, fear,surprise etc.  The best part of this API is that it detect all the faces in an image and provides the emotion collection object. Another good thing about this API is it is easy to use you just need to pass the image and rest other thing is handle by API itself.

Now, I am very sure you are curious to know more and want to implement it at your end.  I am trying to share basic steps how you can use this in your project. just wanted to share that I am using MVC C# in my example .

In my example, I tried to upload  an image and passing that image to API and according to API result showing the result. so Let’s begin with step by step

Step1 :- First & for most important step is register for this API and grab your subscription key.  To get this  you have to register on

Once you registered you can get the subscription key from my account. As you notice in the snap below in free trial we have 30,000 transaction per month & 20 per minutes API calling facility.


Once you got the key the next step is implement it in your project.

Step 2:- You can implement this via API URL or Nuget package manager in visual studio.  Just to update you that Microsoft’s Oxford team is working on this so the namespace name is Project oxford.


In my project , I successfully installed nuget package manager


Step 3:- Once the Emotion package installed in your project simply create the object of Service API and call.

Pass the image steam or required parameters as per the documentation. As you can see in below image, I have created a new object of EmotionServiceClient & passing subscription parameter to avail it.

Once my object is Created, I am calling RecognizeAsync method in and passing the uploaded file stream.  This Recognize Asynch  method.

The best part is it return Emotion’s array by determining the number of faces. but in current, code I am just interested in determining the emotion of single face. So, I did code accordingly.


Step 4:-  To capture all the emotion’s score I have created a EmotionScore class as you can see below.


Step 5:- Once Everything setup just run the page and upload image.when you upload the image you will get emotion collection to play. See below snap in which I tried the same.


I tried with several expression (Thanks to my little champ“Aayush” to help me out with his cute expressions).


As mentioned above you can use API URL as well to call it.

I hope you may like this new face expression API. For more information you can visit following sites

Different samples

Please, feel free to share your inputs.

Happy coding !!


The Step by Step Azure Machine Learning is good Idea Part–3

In the previous post , we discussed about different algorithm types which help us in Machine Learning. Now, In this post, we will see how to work with Azure Machine learning studio.

So, let’s start with Step by Step how to use Microsoft Azure Machine learning.

Step1 :- You have to login into Microsoft Azure portal with your credential if you have not created yet then below is the link by which you can create your Azure account.

Step 2:- Click on Portal option of Machine learning as shown below. Here you have to click on “Create AN ML WORKSPACE” when you click on this option you will find the below the screen. You need to add workplace name and select the server location.

Once you done with above steps, you will find the below screen


Step 4:- You can open Azure ML studio by clicking Open Studio icon or you can click directly login into 

Once you successfully logged in you will get the following screen.


In this screen, you will see different options like existing experiments created by you, samples by Microsoft etc.

Step 5:- You can check existing samples as well which are on different data analysis algorithms.


Step 6:-  But, let’s not go with existing sample as we will try to create something from scratch.  For that when you click on new Experiment then you get the following screen.

There is 3 main part of the studio screen. In Left panel, you will find different data sources , filters, transformation,models,Options. You just need to drag-drop on the central panel which will be our working area where as the right side panel will show the properties.


for our test, we can use  already uploaded dataset or upload new dataset on which we want to create the model. In this example, we are using Adult Census income which is already available in dataset repository of Azure Studio.

Although, we can download same data from as well  and upload to Azure Studio back. If we open the link you will find different attributes like  age, sex, marital status, race country  etc.

Before going further, let’s understand  what we are going to do?

So, we are going to  predict the income and determine/predict  whether the income is more than $50,000  or not. The training model  is based on the known inputs like age,education, job type, marital status, race and  number of hours worked per week.

Just drag drop the data source (dataset) on the central panel.


You can visualize the data by right click on the central circle of each control. You can check data anytime in any step.


Step 7:- Now, this dataset  might content some missing data values and for better result or prediction we will clean these data. To achieve this we need to drag-drop the Missing data control and provide dataset inputs. Here from the property panel you can set any value and replace it with the missing data value.

In this example, we will set the value to 0 (as shown in the figure). Now the output of this missing value is a proper dataset on which we can do the analysis.


step 8: Once we have proper dataset then our first goal is to split the data using split control . Here splitting data divide our dataset into 2 part


1) Training data :- With the help of this data we will train the Machine

2) Validation data :- This data is used to check the accuracy of prediction which we will apply.

We can set the ratio of these two parts by the properties.

Step 9:- Here  we need to apply the algorithm. Assuming the prediction result set we are going to use Two-class classification model. If you see in the left panel there are many classifications. For this example Two-class Boosted decision tree.


Step 10: Now, we have data with us on this data, we have to apply the algorithm and teach the model how to evaluate. for this, we will drag drop the “Train Model” control from left panel to our designer panel .


Here we need to configure “Train Model” . For this just provide the output of Split data (Training data output) to the Train model and also output of two class Boosted decision control’s output to train model. Once you set both the control then your screen will look like as below


Step 10:- Now once we have provided the input data to Train Model next thing is to  provide the name of the column which we have to predict. for this click on Train Model. Check the right panel and select the column which you need to predict  by clicking Launch column selector.


Step 11:- So far we are good, we have created the trained model now it’s time to score the model and cross-check the accuracy of the algorithm which we have applied. To evaluate the model we will drag drop a Score Model from the left panel and connect with Train model and the other validation data output of split data. Once you are done with this just press save button and run the model. if everything works well then there would be a right checkbox appear on control.


Step 12:- Once everything with green checkbox check as shown in the figure .


We will check data visualization by right clicking on score model.


You will find 2 additional columns which are Scored Label & Score probabilities. These two columns provide scored value and probability percentage


Although, we can have different methods as well to achieve the same task and we can evaluate the result of these different methods by one more control which is Evaluate Module.  We have to drag-drop this module from left panel to designer and provide the Score model’s  output to the evaluate module.

Although, we have  only one training model with two class method but we can create another train model as well as compare them by providing output of the model to Evaluate module.


It provides a set of curves and metrics which we need to understand and choose the best train model if we are evaluating two train model.


Till now we have created a model. here are not going to save the model as a trained model and publish it we try to expose this model using a web service.


Step 13- Add output of web service dragging and dropping the web service output control and configure as shown below figure.


Step  14:- In the next step, we will publish the web service with the below button of the designer when you click on publish web service you will get the following screen after completion of the step.


Here just click on Test operation and you are good to go with Azure Machine learning experience.

I hope you will try yourself. Please , keep sharing your inputs.



The Step by Step Azure Machine Learning is good Idea Part–2

In the last post, we have discussed Machine learning. Now in this post, we will discuss some more detail about algorithms and trust me this is one of the most important objects which a Machine learning engineer should know.

These objects are nothing but the algorithms. As a data scientist or Machine learning engineer, the first and most important thing are we should know

what is the data ?

What the result is ?

what analysis do you need to apply to get the desired result or prediction?

I know this is pretty much clear but let me explain with an example. Suppose, we have students data with high school ‘s internal assignments and we need to predict if the student can be pass in the final exam or not.

Now let me give you a brief overview of some of the algorithm  types which we may require in Azure Machine Learning. Although, there are much more types ,subtypes available but will not go in deep. So, let’s start

1) Two- Class  Algorithm Type:-

We will apply this algorithm type when the prediction result in either Yes/No or true/false or 1/0. for example, a student can be pass or not.

2) Classification Algorithm Type:-

This is another algorithm type which help us to predict  answer like which Kabaddi team or cricket you will cheer or which political team you will vote.


3) Linear Regression  Algorithm Type:-

This is one of the common prediction methods which everyone applies Smile sometimes. for example, in office, you can predict an engineer’s salary range depending upon last few engineer’s salary, prediction of property selling amount range Like this plot might be from 20 lac- 25 lac depending on last few years property price.



4) Anomaly detection  Algorithm Type:-

By the name, it is clear we need to find anomalies. for example, you have to determine from a group of  white cows and black cow you need to find out odd color cow means black color cow.




I hope the all the above algorithm types is clear. In next post, we actually do the step by step Microsoft Azure Learning so don’t worry about that.

Please, provide your inputs

The Step by Step Azure Machine Learning is good Idea Part–1

Machine learning is not new in the market but nowadays  it is a buzz word everywhere. You might realize that there are lots of things happening in the Machine Learning.

Many big companies like Microsoft, Oracle, IBM,SAP and many other working in this area. They have provided Azure Machine Learning,Oracle Advanced Analytics, IBM SPS, SAP Predictive Analysis tools to work on it.

Before jumping into Azure Machine Learning directly let’s first understand basic of Machine Learning what exactly it is.

So, Machine learning is a way to understand the data pattern , recognize it and predict accordingly for future.  It helps in

1) Data Mining

2) Language Processing

3) Image recognition

and many other Artificial Intelligence  related stuff.

I know above statement is bit bookish so let me explain in Indiandotnet style .

Let’s say you are a teacher in  a school and you have quite experience in teaching. In each year you teach many students you also keep previous years data and some sort of basic detail of students.

When parent’s come to meet and wants to know the progress and whether he/she will pass in graduation or not. You simply do data analysis in your mind  whether that student doing study  or not (obvious), what his/her percentage in the last couple of exams or internal assessments , how he/she performed in previous class etc., then you give your prediction to the parents that their child does good or bad in the final exam or not.

Now, suppose instead of you there is a computer and parents asking the same question to the computer Now, a computer should provide the same answer as you give accurately or might be better.

For this, we need to feed enough data sample in the computer. If he has previous data samples by which he can analysis and predict accurately.

This overall exercise of processing data is part of Machine learning.

So, firstly you have to train the computer with providing the initial data which we can say training data. This is an iterative process.


Although, Machine learning Is more than this. Here, we are showing some more example where machine learning can help

1) Detecting  fraud credit card

2) Determine SPAM emails

3) Provide customer like to switch to competitor

4) Free text when typing etc. many more examples of machine learning.

There is 2 distinction in machine learning


1) Supervised Machine Learning :-

The Supervised learning means the value you want to predict is already exist in training data. Means the data already exist in the computer so data is labeled. The accuracy is high in such case.


2) Unsupervised machine Learning :-

So It is just opposite to Supervised Machine Learning. In this the predictive data not present in training data.

I hope now we have a basic understanding of Machine Learning. In next post, I will share step by step example of Azure machine learning.


Please, provide your inputs.