Before you begin
You'll need a service instance to start.
Step - 1– Login to IBM Cloud and go to Catalog
Step - 3– Give a service name to your Conversation Service and click on Create
Step - 4 – Click on Launch tool to launch the dashboard of IBM Conversation Service
Step - 5– Click on Skills to load the list of Skills
Step - 6– Click on Create to create a new Skill
Step - 7–Give a name to your Skill and click on create
You'll land on the Intents tab of your new skill.
Step - 8–Click on Add intent to create a new intent and add user input examples.
Step - 9 – Give a name to the intent and click on Create intent
Step - 10 – Add a user example and click on Add example
Step - 11 – You can add multiple examples to your intent
Step - 12 – If you are done adding examples click on the left arrow(back button)
Step - 13 – Click on Dialog to create a dialog flow
Step - 14 – Click on create to create the Dialog flow
Step - 15 – Welcome and Anything else nodes are the inbuilt nodes which have their own functionality. Welcome node is executed during the start of the conversation, and Anything Else node is executed user question is irrelevant
Step -16 – Click on Add node to add a new custom node.
Note: The new node should be added between the Welcome and Anything_else node
Step - 17 – Give a name to the node and Type #Greetings in the Enter a condition field of this node. Then select the #Greetings option
Step - 18 – Add sample responses and Click X to close the edit view.
Step - 19 – Test the dialog. Click the "Try it" icon to open the "Try it out" pane. The welcome message in the welcome node is displayed.
Step - 20 – Enter a sample input to test your chatbot
Step - 21 – Here is the response by the Bot
We are done building a basic Chatbot. Now in next lab(Lab 1.1), we will proceed to build a chatbot for a restaurant
Building a chatbot for a Restaurant
Planning your intents and entities
To plan the intents for your application, you need to consider what your customers might want to do, and what you want your application to be able to handle. Choosing the correct intent for a user's input is the first step in providing a useful response. The intents you identify for your application will determine the dialog flows you need to create; they also might determine which back-end systems your application needs to integrate with in order to complete customer requests (such as customer databases or payment-processing systems).
Gather as many actual customer questions, commands, or other inputs as possible. Using input from real users gives a better picture of the expected input than having experts create lists of possible utterances. Remember that customers might phrase the same kind of request in many different ways.
After gathering all possible questions asked by a customer we can proceed to build a chatbot
Step – 1: Let’s create an intent for Enquiry. So, go to Intents and click on “Add Intent”.
Step – 2: Give the intent name as Enquiry and click on create intent
Step – 3: Add the different user examples for Enquiry intent
Step – 4: After adding various examples click
Now let’s add entities (Menu, offers, cost) for Enquiry intent
Step – 5: Click on Entities to create new entities
Step– 6: Click on Add entity
Step – 7: Give the name to your entity and click on Create entity
Step – 8: Give the value name as offers and click on Add value. Do the same thing for menu
Step – 9: After adding two values (menu, offers) click back button
Step – 10: Go to dialog
Step – 11: Click on Add node to add the condition for Enquiry
Step – 12: Give the name of the node as “Enquiry” and give the condition as #Enquiry
Step – 13: Click on Customize to give the specific responses
Step – 14: Enable multiple responses and click on Apply
Step – 15: In the internal condition Enter @Enquiry and select the option
Step – 16: Select “: is” from the option’s
Step – 17: Select “offers” from the drop-down. So the first internal condition executes when the user question is about offers.
Step – 18: Give a sample response about offers
Step – 19: Click on Add response to add response for “menu” condition
Step – 20: Give the condition for “menu”
Step – 21: Click on settings to give an image response
Step – 22: Select Image from the options
Step – 23: Enter the “Title” as “Menu”, and give a sample Image URL of the menu in Image source. Sample Url: http://pepetonsgrill.com/wp-content/uploads/2018/02/Pepetons-Grill-Restaurant-Menu-00002.jpg
Step – 24: Click on Save
Step – 25: Click x to close the edit window
Step - 26 – Test the dialog. Click the "Try it" icon to open the "Try it out" pane.
Step – 27: Give the input as “What are the offers available”
Step – 28: Observe the response by the bot
Step – 29: Give the input as “Can I get the menu” and observe the output
Step – 30: Now let’s create Intent for ordering. So go to Intents
Step – 31: Now let’s create Intent for ordering. So go to Intents
Step – 32: Give the name of the intent as Order
Step – 33: Add the sample user examples for #Order intent
Step – 34: Click on left arrow after adding user examples.
Step – 35: Go to Entities to add entities for ordering intent
Let’s create entities for items in the restaurant
Step – 36: Click on Add Entity
Step – 37: Give the name to the entity as “items” and click on Create entity
Step – 38: Give sample food items in the items entity
Step – 39: You can also add synonyms for entities as shown below
Step – 40: After giving the sample food items click on the left arrow
To detect the quantity of the order from the user we have System entity “@sys-number”, we can use this system entity for detecting number’s
Step – 41: Go to System entities and enable “@sys-number” entity
Step – 42: Go to Dialog
Step – 43: Click on Add node
Step – 44: Give the name of the node as “Order” and give the condition as “#Order”
Step – 45: Click on “Customize” to give specific responses
Step – 46: Enable multiple responses and click on Apply
Step – 47: Click on "settings" to add the internal condition
In the internal condition, we have to check whether the user has mentioned about item name and it’s quantity
Step – 48: Enter the first condition as “@items” and click on to add other condition i.e quantity
Step – 49: In the second condition select “@sys-number” i.e for Quantity
Step – 50: Give your confirmation response as shown below (Your order for @items of quantity @sys-number is ordered successfully) and click on save
Step – 51: Click X to close the edit window
Step -52– Test the dialog. Click the "settings" icon to open the "Try it out" pane.
Step – 53: Enter your input and observe the response as shown below
Sometimes the Customer may forget to give the quantity and the item name so we have to prompt the user for the requires information. So, here slots help to prompt the user when required information is lacking in the question.
Step – 54 : Open edit window of order node
Step – 55: Click on Customize to enable slots
Step – 56: Enable slots and click on Apply
Step – 57: In slots, we will check whether the user has mentioned item name or not. So in “Check for” enter the entity name “@items” as shown below. If it mentioned by the user it will be saved in items
Step – 58: If the user didn’t mention about the item, prompt for the information as shown below
Step – 59: Click on Add Slot and do the same thing for quantity
Step – 60: Click on Add response
Step – 61: Click on "settings" to add the internal condition
Step – 62: Choose “@items” entity in condition and click to add other condition
Step – 63: Enter the condition as shown below ($number!=“ ”)
Step – 64: Enter the response as shown below (Your order for @items of quantity $number is ordered successfully) & click on Save
Step – 65: Again click on Add response and click on "settings" to add the other condition
Step – 66: In the edit window enter the conditions and response as shown below and click on save
Step - 67: Test the dialog. Click the "Try it " icon to open the "Try it out" pane.
Step – 68: First give the input as ”can you order” as item name is not mentioned it prompts of the information
Step – 69: Enter the sample item name as shown below and now the bot asks for the quantity as it not mentioned
Step – 70: Click on Manage Context to check the saved context variable and click X to close the tab
Step – 71: Now give the quantity and observe the confirmation response, So the confirmation is given only after user mentions the item name and quantity
Now Let’s explore user defined Context Variables. In the start of conversation lets ask for customer name and save in context variable and once the customer is done with the conversation, let’s delete the context variable
Step – 72: Open edit window of Welcome Node
Step – 73: In the response ask for the Customer name as shown below
Step – 74: Go to Entities, go to System Entities and enable “@sys-person” entity
Step – 75: Go to dialog and click on
Step – 76: Click on add child node to add a child node
Step – 77: Give the name of the node as “Customer Name” and give the condition as “@sys-person”
Step – 78: Click options symbol and click on Open context editor to save the person name in the context variable
Step – 79: Give the variable name as “name” and value as “@sys-person” as shown below.
Step – 80: Give the response in the welcome node as shown below
Step – 81: Test the dialog. Click the "Try it" icon to open the "Try it out"pane.
Step – 82: Click on clear, the bot asks for the customer name
Step – 83: Enter your name and observe the output as shown below and open manage context to see the saved name in context varibles
I am very thank full to you all for giving such a great training and opportunity to explore my ideas in the stream of IoT, started with a 2 week workshop, very well Hands-on session ever had before...
I interned at smart bridge it's on a mission to become the power House of IOT.The work here is innovative and colleagues are very friendly.i would definitely recommend smart bridge to be a part of you..
I have done my project and Iot training at Smart Bridge Technologies based on which I got placed in IBM as a system engineer. I am very thankful that i have found my way to build my career further. Th..
The Project was developed in time, and it was appreciated .Many small details were covered well, and proved to be distinguishing points to the project.The concerned mentor, Sandeep Doodigani, has been..