Chatbot /

13 Min read

Build Advanced AI Bots Using IBM Watson on WotNot

May 19, 2021

Hardik Makadia

Co-founder & CEO, WotNot

Table of Contents

The rise in the use of Natural Language Processing in chatbots evidently proves that AI chatbots are at the forefront of delivering authentic conversational experiences to users. IBM Watson is probably the best of the lot in the NLP engine bunch, leading the charge in bringing tools such as machine learning and automated reasoning in customer communication. 

IBM’s Watson is a sophisticated, multilingual NLP engine in the market that responds to customer questions in a human-like manner. Yes. Humanlike. If you think about it, ‘humanlike’ and ‘artificial intelligence’ are different sides to the same coin. And that’s what chatbots strive to achieve- a human-like intelligence when utilising NLP engines like IBM Watson to converse and provide real-time responses.

Why IBM Watson? 

Your IBM Watson chatbot can seamlessly integrate into your current IBM tech system. IBM Watson also leverages language detection to respond to the user in their language. Imagine your customer asks something to your bot in a language it does not identify, and it ends up giving an irrelevant response. It is going to make your bot look stupid and do irreversible damage to the user experience. 

Language detection differentiates IBM Watson from other NLP engines. When your users type their query, the engine immediately recognises the language and responds in the same language, elevating the customer experience to new heights. Watson is also known for its accurate intent responses with an industry high of 73.8%, rapid analysis of data and other user input, and its ability to distinguish different types of information from its vast database. It proves that its intelligence, just like its expected, is dynamically learning and improving with time and providing solutions to business problems across various verticals.

Experience IBM Watson using WotNot

Now that you know what IBM Watson is and its benefits in conversational marketing, you need to have a platform where you can develop and deploy the AI bot you build on Watson Assistant. You can now bring the IBM Watson experience using WotNot! WotNot provides you with a frontend graphical user interface to build a no-code IBM Watson Chatbot with Integration. I know what you’re thinking. No code and AI? Is that possible? Yes. It is, and you can build one without going crazy. You don’t have to write algorithms or codes to deploy an AI chatbot. You just simply need to connect your Watson Assistant with WotNot using an API key. 

How to build a bot with IBM Watson on WotNot

Although chatbots are advancing with the latest technology, they still retain their primary benefit of being easy to develop and deploy software. Creating an IBM Watson Chatbot on WotNot will involve multiple steps, but the process is easy to follow once you understand the ‘how to’ aspect of it, which we’ll discuss here.

1. Create Account and Enable Language Detection API

Go to IBM cloud and create an account. 

Once your account is created, you can select a free plan, and you need first to enable the language detector here. You then go to manage on the left navigation panel as shown below:

Copy or download the API key and the URL as they will be used into WotNot’s bot flow in the service-call dialog for detecting language.

2. Enable Watson Assistant API

Your next step is to visit the following site: https://cloud.ibm.com/catalog/services/watson-assistant.

Here you select the lite plan and click on create to add Watson Assistant service in IBM cloud.

Copy or download the API key and the URL as they will be used into WotNot’s bot flow in the service-call dialog.

3. Use Watson Assistant to create skills for developing intent and dialog. 

  • Now that you have generated the API use the Watson assistant to create skills for developing intents and dialog. Go to URL “

  • Select the “Lite” plan

  • Click on the “Create” button to add Watson-assistant service. You will be redirected to the managing Watson assistant page.

  • Copy or download credentials(API key and URL). This will be used in the flow in a service-call dialog.

  • Click on “Launch Watson Assistant” from the managing Watson-assistant page. You will be redirected to the initial setup of the Watson assistant. Delete already created default assistant from there

Create skills manually from start

  • Click on the “skills” option. You will be redirected to the Watson assistant skills view page. Delete already created default skill from there

  • Then create new skills by clicking the “Create Skill” button.

  • Select “Dialog Skill” from the different three skills and click on the “Next” button to create a new skill.

  • From here, we will require to create different skills as per other languages.

  • Add skill name according to the language to identify quickly and select skill language from the “Language” drop-down.

  • After skill creation, you will be redirected to the page from where you can manage your created skill.

  • To create intent, click on the “Create intent” button.

  • Add the name of the intent, add a description(optional), and then click on “Create intent.”

  • Then add Utterance in user examples and click enter to add another utterance. (Add all the utterances for that particular intent)

Fig. Before adding utterances

Fig. After adding utterances

  • Train all the intents by adding intent names and user examples. All the created intents will be listed down as below.

  • Then go to the “Dialog” from the left panel, and you will be directed to the following page.

  • Now create individual nodes for individual intents to respond to captured intent. Click on “Add node” to add nodes, and you can add nodes in the cards for every intent, as shown below.

  • Click on “Enter condition”, then select intent and then select specific intent from there. And add a response which you want to provide for captured intent in Assistant Responds.

  • Now add individual nodes for individual intents with their respective response message.

Add skills by importing them:

  • Create new skills by clicking the “Create Skill” button

  • Select “Dialog Skill” from the different three skills and click on the “Next” button to create a new skill.

  • Click on the “Upload skill” option and then upload the file by clicking on “select a file”.

  • After the file gets uploaded, click on the “Upload” button to import the skill.

Create Assistants:

  • Now we will be required to create language-wise assistants. Click on “Assistants” from the left panel.

  • Click on the “Create assistant” button to create new assistants.

  • In assistant creation, add the assistant’s name and click on the “create assistant” button.

  • Then select dialog skill by clicking the “Add dialog skill” button.

  • Then select language-wise created dialog skill.

4. Build a bot on WotNot

Now that you have created intents and responses on the Watson Assistant, you must build a bot on WotNot to deploy to your desired platform. Since you’re building an AI chatbot, you need the best of both ‘AI’ and ‘chatbot’. While IBM Watson is popular for its NLP processing and Language Detection, allowing you to leverage the AI technology, WotNot has a mastery over the chatbot UI, live chat, and analytics, allowing you to build an effective customised chatbot without any coding. By making an IBM Watson Chatbot on WotNot, you can keep track of your conversations and dictate the flow according to your use.

Step 1

Sign in to WotNot from here and go to the bot builder. 

Step 2

Start the flow by adding the first block of ‘Collect Input’ and add the initial question. Add the response as a variable to store it. It is saved as ‘user_input’ in the below image. This is to pass the customer query to IBM Watson to get a response.

Step 3

Get encoded credentials for your language detection API from “https://www.base64encode.org/” by adding apikey:{apikey}. We need to encode credentials for getting authorisation. Without getting the authorisation, we cannot call the API, so we need to generate an authorisation code we can use in the service call.

Add a service call block on the bot builder for language detection. In this block, you’ll have to input the details of the URL and API key to connect with Watson Assistant. Add the details as mentioned below.

URL: {instance-url}/v3/identify?version={version}

Type: POST

URL: {instance-url}/v3/identify?version={version}

Headers:

  • Key: “Content-Type”

  • Value: “text/plain”

  • Key: “Authorization”

  • Value: “Basic  {encoded-credentials}”

Request Body:

  • Type: Raw

  • Payload: {“text”:”{user_text}”}

  • Save variable:

Variable: “detected_language”

Object Path: “result.languages[0].language”

Also, add a send message dialog to the failure of the service call with some text such as “Sorry, we didn’t catch that. Please try again.” This message is sent in case the intent isn’t recognised. In such a case, the bot flow will be stopped here.

Step 4

Add branches according to the languages to the success of the language detection service call. Since we have created different assistants for different languages on IBM Watson Assistant, we need to have individual service calls to call the agents of that specific language. This will help Watson Assistant respond in the language that the user has used.  The language detection will identify and automatically route the query to the service call of the imputed language. If the user has asked in English, the bot will direct the quWatsonery to the English service call for getting a response. 

Compare detected language variables with language code.

  • English(en)

  • French(fr)

Add seperate service calls as per the languages.

Get encoded credentials from “https://www.base64encode.org/” by adding apikey:{apikey}.

  • Type: POST

  • URL: {instance-url}/v2/assistants/{assistant_id}/message?version={version}

Headers:

  • Key: “Content-Type”

  • Value: “application/json”

  • Key: “Authorization”

  • Value: “Basic  {encoded credentials}”

Request Body:

  • Type: Raw

  • Payload: {“input”:{“text”:”#user_input#”}}

Save variable:

  • Variable: “response_text”

  • Object Path: “result.output.generic[0].text”

Note: We can store detected intent name with object path “result.output.intents[0].intent”

Step 5

Add collect input dialog on the failure of Watson assistant API service-call with some text like “Opps didn’t get you, can you please rephrase your query?” Acknowledging a failure message will help the user understand that he/she needs to either rephrase or probably contact an agent. It can also help you improve or add intents in the Watson assistant to better respond in the future. 

Step 6

Click on ‘Test the bot’ to check if everything you built is per the expected behaviour. If it’s not, recheck all the steps for errors and make the required modifications. If done correctly, you can develop multiple intents and dialogs on IBM Watson and create a full-fledged bot on WotNot using service calls to deploy the AI bot on your site and other platforms.

Possibilities with IBM Watson

IBM Watson has broad use-cases across industries. There are many sectors already using AI to empower their customer interactions, and leading the pact are: 

Healthcare: The IBM Watson chatbot is helping with a diagnosis where doctors put patient data and use NLP for symptom analysis and treatments. Watson recognises the user input and directs them to the right doctors. It can also diagnose common health issues and respond to the patients without involving the doctor. From top cancer hospitals to physicians, Watson’s NLP engine is the latest tech addition in providing effective treatments to patients. 

Travel and Hospitality: The travel industry utilises NLP in lead generation from websites and provides 24/7 customer support to provide information to the customer about the tickets, cancellations, booking details, and weather. The IBM Watson chatbot can also provide customisations for travel plans based on personality traits and previous conversations. 

Retail: eCommerce companies are always looking to make the buying experience more personalised for customers. Whether it’s a new user or a returning user, your AI bot built with IBM Watson can identify the users and suggest products based on their interactions. Your customer can at any time of the day know the shipping status, cancel a purchase, make a purchase, and browse products on the bot. With an IBM Watson chatbot, online retailers can address complex customer queries and assist them in their online buying experience. 

Finance: Watson can answer the financial and wealth management questions of consumers. Banks and financial institutions use IBM Watson chatbot to provide financial guidance and help manage financial risk to the users. 

Integrating IBM Watson with a no-code platform like WotNot can help you predict and shape future interactions with your consumers. Join the troop of leading global brands by using IBM Watson on WotNot and transform your customer engagement with AI-powered conversations!

ABOUT AUTHOR

Hardik Makadia

Co-founder & CEO, WotNot

His leadership, pioneering vision, and relentless drive to innovate and disrupt has made WotNot a major player in the industry.