In this article, we are going to learn about how to build a working chatbot using IBM Watson Assistant. Watson Assistant is a service hosted on the IBM cloud for building chatbots which allows you to build a chatbot without any explicit programming.
Before we start building a chatbot, Let’s understand what is a chatbot and its use case.
A chatbot is an artificial intelligence (AI) software that can simulate human conversation. Chatbot services are programmed to respond to textual, visual, or auditory inputs from users and leverage mediums such as SMS, website chat window, and social messaging services to receive and reply to messages
A chatbot can be used in various services such as FAQ answering, 24*7 customer care support, booking a ticket, taking a pizza order, etc.
We will build a chatbot for a restaurant that can handle the following task :
- Make a booking — Our chatbot can book a table for the end-user.
- Hours of Opening — Our chatbot can provide information on the working hours of the restaurant.
You can add as many features as you want, but for the sake of simplicity and better understanding, we will focus on the above two features only.
Now we have set our intentions on what kind of tasks our chatbot can do, Let’s start building it.
You need to have an IBM Cloud account to use the IBM Watson Assistant service. Sign in to your IBM Cloud account. In case you don’t have one, you can sign up for free here.
Once you have signed in to your IBM Cloud Account, the below screen will appear on the dashboard.
Type “ Watson Assistant” in the search bar and create a service of Watson Assistant.
Once you have created the service of Watson Assistant, click on it and the following screen will appear.
Now click on “Launch Watson Assistant” to launch the service.
After completing the first step, you will get the following image.
In this step, we will add the Dialog skill to our assistant. Dialog skills will help our assistant to perform the mentioned task.
To add a dialog skill to the assistant, click on the “ My first assistant”. You will get the following image.
Here you can see, there is an actions skill linked to the assistant. In some cases, there is an action skill linked to the assistant and in others, there is a dialog skill linked to the assistant.
If there is a dialog skill linked to the assistant then we don’t need to change anything but in our case, there is an action skill linked to the assistant & we want to link the dialog skill. To do so, first, we remove the action skill from the assistant.
To remove an existing action skill, click on the three dots in the upper right corner of My first skill and click on the remove skill. After successfully removing the action skill you will get the following image.
Now to add a dialog skill, click on “Add an action or dialog skill” and Create a new dialog skill with the name “ Restaurant Skill” and click on the Create skill.
After completing this, a new dialog skill is added to our assistant. This completes step 2 of building the chatbot.
In this step, we will create an Intent and add it to the skill. But before that, we need to understand what is an intent?
According to Watson Assistant
An intent is a collection of user statements that have the same meaning. By creating intents, you train your assistant to understand the variety of ways users express a goal.
An intent is simply a collection of user statements that have the same meaning. These statements can be the statement from which users want to express a goal, In our case, something like Make a booking for the table.
What are the different ways a user can say to make a booking for a table in the restaurant?
Make a booking for a table.
Reserve a table for me.
Make a reservation for a table in the restaurant.
Book a table.
I want to book a table for dinner.
All these examples show the intention of the user to book a table. By looking at these examples, we can easily say that the user wants to book a table. The same goes for the Intent in the chatbot.
Intent helps the chatbot to identify the goals that users want to accomplish. These goals can be to make a booking, getting information about operating hours, etc.
In our chatbot, We want to accomplish two main goals: making a booking and getting information about hours of operation. So we will create two intents, one for each.
First, We create an intent to understand the user’s intention to make a booking for a table.
To create an intent, first, click on the Restaurant skill. You will get the following image.
Now click on the Create Intent. After that, type the name of the intent “ make_booking” and then click on the create intent. You will get the following image.
Now we need to train the intent by giving at least 5 different examples in which a user can say to a chatbot to make a booking for the table. The examples can be the following as we have seen earlier.
Make a booking for a table.
Reserve a table for me.
Make a reservation for a table in the restaurant.
Book a table.
I want to book a table for dinner.
To add examples, just type the statement and then click on add example. Once you successfully added all the examples, you will get the following image.
Similarly, Create another intent for the hours of operation with the following examples.
What are your hours of operation?
Are you open on weekend?
Are you open on Sundays?
What are your working hours?
What is the timing of your restaurant?
Till now, we have created an instance of Watson assistant service, added a dialog skill to the assistant, and created two intents. Let’s move to the next step.
In this step, we will create an Entity and add it to the skill. But before that, let’s understand what an Entity is and how it can be used to build a chatbot?
According to Watson Assistant…
Entities represent information in the user input that is relevant to the user’s purpose.
If intents represent verbs (the action a user wants to do), entities represent nouns (the object of, or the context for, that action). For example, when the intent is to get a weather forecast, the relevant location and date entities are required before the application can return an accurate forecast.
In our example, the user wants to book a table in the restaurant. But to book a table, the chatbot will need to know at what time and date the user want to book a table. Here date and time are the entities that are required to make a booking of the table.
So we will add two entities, namely, date and time to the dialog skill. Luckily, we don’t need to create these two entities. In Watson Assistant, these two entities are predefined in System Entities. We just need to enable these two entities to use.
To enable these two entities, click on the “Entities” in the “Restuarant skill”. After clicking, You will get the following image.
In the Entities section, you will see two options namely My Entities and System Entities. Just click on the System Entities and enable the sys-date and sys-time entities to use it in the chatbot.
Now you have enabled the sys-date and sys-time entities. Now you can use them in building our chatbot.
Now we will build the dialog to give the responses to user input. But before that, let’s understand what a Dialog is?
According to Watson Assistant…
A Dialog defines the flow of your conversation in the form of a logic tree. It matches intents (what users say) to responses (what your chatbot says back). Each node of the tree has a condition that triggers it, based on user input.
To build a dialog, click on the “dialog” in the skill menu and you will get the following image.
Here you can see two dialog nodes that are created automatically.
- Welcome: This contains a greeting that is displayed to your users when they first engage with the assistant.
- Anything else: Contains phrases that are used to reply to users when their input is not recognized.
Now click on the Welcome node and replace the text with the following written text in the Assistant Responds section.
Hello! I am the virtual assistant of the restaurant. How can I help you?
Whenever the user engages with the chatbot, first they will get the above-written message. Now we will need two more dialog nodes, one to give information about hours of operation and one to make a booking.
We start with hours of operation. To add a new node, click on the three-dot in the upper right corner of the Welcome node and click on the Add node below. After clicking it you will get the following image.
Now fill in the following detail in the newly created node.
- Enter node name(optional): Operating Hours
- Enter condition: start typing #hours_of_operation and then click on #hours_of_operation.
- Enter response text: The timing of the restaurant is from 10 AM to 6 PM on weekdays and from 10 AM to 8 PM on weekends.
Now click on the cross icon next to Customize button.
Now whenever a user asks about the working hours of the restaurant, the Operating Hours node will be triggered and the user gets the following response:
The timing of the restaurant is from 10 AM to 6 PM on weekdays and from 10 AM to 8 PM on weekends.
Now you can try the chatbot that we have built now. Just click on Try it in the upper right corner and type the following sentence.
What are the hours of operation?
You will get the following response.
Till now, we have added the dialog node to give the information about the hours of operation. Now we will add our last dialog node to make a booking for the table in the restaurant.
To add a new dialog node, just click on the three-dots in the Operating Hours node and click on the Add node above.
You will get the following image.
Now fill in the following details in the newly created dialog node.
- Enter node name(optional): Make Booking
- Enter condition:start typing #make_booking and then click on #make_booking.
We have entered the #make_booking intent as a condition to recognize so whenever a user asks about booking a table, the chatbot will recognize the intent #make_booking and this node will be triggered.
To book a table in the restaurant, the chatbot needs to ask the user two things.
- What day would you like to come in? ( date of the booking)
- What time do you want for the reservation? ( time of the booking)
The typical workflow of booking a table will look like this.
To create this workflow, we will use the Slots. Slots provide a structured format through which you can ask for and save multiple pieces of information from a user within a single node. They are most useful when you have a specific task in mind and need key pieces of information from the user before you can perform it.
To use the slots, click on Customize button in the upper right corner of Make Booking node, set the Slots switch to On, and then click Apply.
In Then check for Section, Add the following slots :
- check for — @sys-date, save as — $date, If not present, ask — What day would you like to come in?
- check for — @sys-time, save as — $time, If not present, ask — What time do you want for the reservation?
After adding slots, you will get the following image.
Now, In the Assistant responds section, enter the following text.
Thank you for booking on $date. We will be waiting for you at $time.
The chatbot is complete now. You can try it using the Try it option in the upper right corner.
Hope you find this article useful. If you have any doubt, feel free to ask in the comment section. You can connect with me on LinkedIn.
How do you make a perfect chatbot? ›
- Decide on the purpose of your chatbot.
- Create concrete use cases for your bot.
- Choose the channels of interaction.
- Define your customers.
- Give your bot a personality.
- Create a happy flow of conversation.
- Test, measure, and improve.
An adaptable AI chatbot that gets it right the first time
IBM Watson Assistant is built on deep learning, machine learning, and natural language processing (NLP) models to understand questions, find or search for the best answers, and complete the user's intended action through conversational AI.
The system was written in various languages, including Java, C++, and Prolog, and runs on the SUSE Linux Enterprise Server 11 operating system using the Apache Hadoop framework to provide distributed computing.Which tool can be used to create Chatbots IBM? ›
You can get started building an engaging chatbot with Watson Assistant, no-code is needed.How can I create a chatbot from scratch? ›
- Step 1: Give your chatbot a purpose. ...
- Step 2: Decide where you want it to appear. ...
- Step 3: Choose the chatbot platform. ...
- Step 4: Design the chatbot conversation in a chatbot editor. ...
- Step 5: Test your chatbot. ...
- Step 6: Train your chatbots. ...
- Step 7: Collect feedback from users.
Because building a chatbot with code is immensely difficult for people with no development background and limited exposure to coding languages, it's good to research sample chatbot code from expert developers as a jumping-off point for those determined to learn how to build their own bot without help.Why do most chatbots fail? ›
Setting unrealistic expectations is often the reason why chatbots fail. Most chatbots are based on a set of rules that dictate the answer to give to a specific question by drawing the necessary resources from a database.What are the 7 steps to create a chatbot strategy? ›
- Audience. The first key to a successful strategy is to profile your ideal customers. ...
- Goal. To define the purpose or goal for your chatbot strategy, begin with the end in mind. ...
- Performance. ...
- Key Intents. ...
- Storytelling. ...
- Platform Strengths: ...
- Naïve Bayes Algorithm.
- Support vector Machine.
- Natural language processing (NLP)
- Recurrent neural networks (RNN)
- Long short-term memory (LSTM)
- Markov models for text generation.
- Grammar and Parsing Algorithms.
Chatbots can also handle 80% of routine tasks and customer questions. Unlike people, chatbots are not constrained by working hours, time zones, public holidays, or illness.
Is IBM Watson worth it? ›
IBM Watson Analytics is an exceptional business intelligence (BI) app that offers a strong analytics engine along with an excellent natural language querying tool. This is one of the best BI platforms you'll find and easily takes our Editors' Choice honor.Is IBM Watson assistant good? ›
IBM Watson Assistant is best AI Chatbot support you can ask for your Service team. IBM Watson is one of the pioneers to forey into AI Chatbots which forms a key component in Service driven industries.Is IBM Watson API free? ›
Create an account on IBM Cloud to try Watson services for free with no time restrictions: Sign up for free.Is IBM Watson still relevant? ›
It was a potentially useful new diagnostic tool. But it turned out to be not useful or flexible enough to be a winning product. At the end of last year, IBM discontinued Watson for Genomics, which grew out of the joint research with the University of North Carolina.What are three applications of IBM Watson? ›
Watson helps organizations predict future outcomes, automate complex processes, and optimize employees' time.What is the best API to create a chatbot in? ›
- Twilio Studio. Twilio Studio lets you build a friendly, conversational chatbot that can respond to incoming messages, chat with customers, and process orders. ...
- 2. Facebook Messenger API. ...
- Slack bot API. ...
- Bot Libre. ...
- Google Chat API. ...
- ChatBot API. ...
- Crisp Chat. ...
|Chatbot API||Rating||Best for|
|Wati||4.6/5 ⭐️ (150+ reviews)||WhatsApp chatbot API|
|Ada||4.6/5 ⭐️ (140+ reviews)||Access permissions for user types|
|ManyChat||4.6/5 ⭐️ (110+ reviews)||Facebook Messenger chatbot API|
|ChatBot||4.5/5 ⭐️ (15+ reviews)||Variety of integrations|
Chatbots use two main types of AI: natural language processing and machine learning. Natural language processing enables bots to interpret customer requests, including slang, typos, and abbreviations, and machine learning allows them to improve over time.What is the easiest chatbot builder to use? ›
1. Tidio. Tidio is arguably the best chatbot builder for small and medium-sized businesses that need a live chat with integrated chatbots. Whether it's your first chatbot or you just need some new ones, Tidio provides an easy and quick chatbot editor for your business.How long does it take to build a chatbot? ›
Implementing a chatbot takes 4 to 12 weeks, depending on the bot's scope, the time required to build your knowledge base and its technical complexity.
What skills do I need to build a chatbot? ›
- Knowledge of chatbot frameworks. ...
- Knowledge of multiple programming languages. ...
- Knowledge of the latest technologies. ...
- Ability to integrate chatbots on various platforms. ...
- Communication skills.
You don't have to be aware of any coding skills. Immediately after big players like Facebook Messenger or Skype opened their platform for programmers many tools emerged. With this article I want to give you an introduction to mockup and overview of different tools to build your first chatbot.Does chatbot require coding? ›
Companies can take back control to quickly and easily build chatbots for customer service, no code needed.How is a chatbot programmed? ›
Chatbots use machine learning (which gives computer systems the ability to learn from data) and natural language processing (the branch of computer science that gives computers the ability to understand text and spoken words). They are written in on the back-end that runs on a server.What is the difference between script bot and chatbot? ›
11 Give 2 points of difference between a script-bot and a smart-bot Ans: Script-bot Smart-bot Script bots are easy to make Smart-bots are flexible and powerful Script bots work around a script with instructions of program stored inside them Smart bots work on bigger databases and other resources directly Mostly are Fre ...How do you prototype a chatbot? ›
- Step 1: Discovery. In the discovery phase, we needed to develop a solid understanding of who the bot's core users are, as well as what their goals are. ...
- Step 2: Conversation and Personality Design. Conversation design (text omitted) ...
- Step 3: Building A Functional Prototype. ...
- Step 4: Visual Design. ...
- Step 5: User Testing.
Deploy your assistant in production
- Open the HTML source for a web page on your website where you want the chat window to be displayed. ...
- Refresh the web page. ...
- Click the icon to open the chat window and talk to your assistant.
- Step 1: Sign up for Kommunicate. ...
- Step 2: Get your IBM Watson Chatbot Credentials. ...
- Step 3: Finish your bot setup. ...
- Step 4: Add the Kommunicate chat widget and IBM Watson Chatbot to your website.
Watson Assistant lets you build conversational interfaces into any application, device, or channel. Add a natural language interface to your application to automate interactions with your end users. Common applications include virtual agents and chat bots that can integrate and communicate on any channel or device.How do you implement the chat bot functionality? ›
- Decide what type of chatbot is best for your business. ...
- Determine your chatbot KPIs. ...
- Understand chatbot user needs. ...
- Give your chatbot a personality. ...
- Create your chatbot conversation flow. ...
- Design your bot. ...
- Preview and test. ...
- Target your chatbots.
How does Watson assistant connect to database? ›
You need to add the Credentials to the Application, Open the watson-assistant-credentials. json file in the repo and add the following: Watson Assistant apikey , url and the assistant-id . Open the ibm-db2-credentials. json file and paste the Db2 Credentials and save the file.Which API is used to send input from the application to Watson assistant? ›
The Assistant v2 API provides runtime methods your client application can use to send user input to an assistant and receive a response.Where do I deploy chatbot? ›
When creating a chatbot, you design the logic of a chatbot. To then bring it to life so your users can interact with it, you must deploy it on one of the media, which include Web pages, Facebook Messenger, WhatsApp and Twilio phone numbers.How do I connect to chatbot API? ›
- Step 1: Get an API key for the OpenAI API.
- Step 2: Download OpenApi Library.
- Step 3: Create Python code to connect with Chat GPT.
Implementing a chatbot takes 4 to 12 weeks, depending on the bot's scope, the time required to build your knowledge base and its technical complexity. Read about the different project deployment phases, from launch to acceptance.Is IBM Watson Assistant good? ›
IBM Watson Assistant is best AI Chatbot support you can ask for your Service team. IBM Watson is one of the pioneers to forey into AI Chatbots which forms a key component in Service driven industries.What Can Watson assistant integrate with? ›
Watson Assistant integrates to your existing CRM and customer care systems, helping you improve issue routing by connecting customers to the right agents the first time. You can integrate with Salesforce, Genesys, Zendesk, and more.Is it easy to create a chatbot? ›
Because building a chatbot with code is immensely difficult for people with no development background and limited exposure to coding languages, it's good to research sample chatbot code from expert developers as a jumping-off point for those determined to learn how to build their own bot without help.Which language is used to create chatbots? ›
Java. You can choose Java for its high-level features that are needed to build an Artificial Intelligence chatbot. Coding is also seamless because of its refined interface. Java's portability is what makes it ideal for chatbot development.