ConverCon — Build Your Own Chatbot 🤖(Part 1 of 2)
Prerequisites for this tutorial can be found here.
Throughout this tutorial I am going to take you through what LUIS is and get you started on a simple LUIS app. Then in part 2 you will be shown how to connect this app into your code. By the end of both tutorials you will have a Chatbot virtual assistant that could be used for ConverCon. We have created a shell project that we are going to build upon throughout this tutorial. The repo for it can be found here.
After you have cloned this repo we need to log into luis.ai (important to note that you can’t log in with a work or school Microsoft account).

LUIS is a Language Understanding Intelligent Service. It is a machine learning based service to build natural language into apps, bots and IOT devices.
Importing a project:
Once you have logged in, you can import the shell luis app from the repository:
- If you navigate to the MyApps tab, you should see a button that says “Import New App”
- Once you click this button, browse for the luis.json file that you downloaded.
- This will then import a new app called ConverCon and you will see there is a list of intents and entities.

Definitions:
During this tutorial I am going to be using terms like utterances, intents and entities, below are the definitions of what these are, and I’ll walk you through some examples of these already within the project.
Utterance — input from the user in the form of a spoken or written message
Intent — what the user wants to do?
Entity — what object is the user referring to?
If you look at the shell project from the repo and click on the intents tab on the left-hand side, we will see that there already is a few intents listed here. e.g. About, Greeting and Sponsors.

One of the intents is “About” which provides the user with the ability to find out more about the event. As we mentioned before, utterances are input from the user — what the user would actually ask if they wanted to know more about the event. If we click into this intent, we will see some example user input added as utterances e.g. “What is ConverCon?”

So, what can the shell project do already?
As this project has just been imported, you need to train the model that we have so far, that we can test it to see what all it can do:
- Click the “Train” button of the top right-hand corner of the screen.

2. Then hit “Test” so we can see what the project can do so far.
3. In the test panel, type in a question about the event, try and ask a question that wasn’t one of your utterances and under this message you should see a small button that says inspect. If you click this, you should see that luis has recognised this as the “About” intent.

Time to create your own intent
We are going to create a Schedule intent; the purpose of this intent is to recognise when a user is asking questions about the schedule.
Start by clicking ‘Create New Intent’ and name your intent Schedule. You will then be redirected to this intent’s page.

The text box at the top of this page will be where you need to enter utterances. Now try and add some questions that you think the user might ask about the events schedule. E.g. What is on next? What time is lunch? When does the conference end?

Once you’ve entered at least 5 utterances for the schedule intent we need to train our model again, so go ahead and hit the train button at the top right corner of the screen.
Create ‘BuyTicket’ intent
Let’s create another new intent called ‘BuyTicket’, in the same way we created the previous intent. Once created, start adding utterances that you think the user would ask when ordering tickets e.g.“I’d like to buy 5 tickets” and “can I get some tickets”. Add at least 5!
So Luis will interpret the utterance as an intent that could be about an entity and will return this information so that your software can perform an action that is bound to the intent.
We are going to add an entity to this utterance, to allow us to find out how many tickets the user has asked for.
If we highlight one of the numbers in one utterance, it should come up with square brackets around it e.g. “Can I have [5] tickets? “If we click on this it will bring up a menu, select “Browse Prebuilt Entities”

Luis has a number of prebuilt entities, this will bring up a new box listing them all. Find ‘number’ in the list and select this. The best thing about using this is that it can recognise numbers and digits, so it will pick up that both ‘4’ and ‘Four’ are numbers.
Train your app again and see how all the numbers in the utterances for this intent have been highlighted.

If you train you app again now and then test the intents, you can inspect them to make sure the right intents are being called and that the entities are being recognised.
So if we test “Can I have 4 tickets for the event?” then inspect, the top scoring intent should be “BookTicket” and the entity number should be 4.
Publishing your app!
When you’re happy with your app, click the ‘Publish’ button at the top, which will bring you to this screen.

Click the ‘Publish’ button and wait for the app to be published before scrolling to the bottom of the page where you’ll find the endpoint for your app.

Copy this URL and then head on over to part 2 of this blog to find out more information on connecting this bot to your code.
