Wit.ai is an AI and Natural Language Processing engine provided by Facebook. Using Wit.ai or any Natural Language Processing engine helps your bot adapt much better to free-style inputs from users and provide the correct answers which wasn’t taken care by your flow-based design.
Enable Wit.ai or other NLP integrations to the following BotStar features:
Use Wit.ai in Training
Training is a much more adaptive version of Keyword Training. A well-trained bot can respond to diversified ranges of input by users.
For example, if you train your bot with the keyword "booking", it can (and should) respond to both of the following requests "Can I book a table" and "I need a table" instead of rejecting the later one.
Main flow as a best-case scenario for your bot but your users do not always have to follow a predefined path. They might want to exit the current flow and ask your bot other topics that flash through their minds. By using
Training, you can train your bot to handle some of the expected topics or casual small talks, thus increasing end-users’ satisfaction with your bot.
Use Wit.ai in Flow Editor
In BotStar platform, NLP can be used to increase the flexibility and power of the connectors conditions in the Flow Editor. However this requires that you already have an already-trained Wit.ai app with predefined Entities and Intents. (See Wit.ai for more information about Entity and Intent).
You can utilise NLP to increase the chance of:
Matching the right connector between blocks by analysing the semantics of the whole sentence instead of single words.
Reading and extracting the necessary information from the sentence.
Wit.ai is an optimal choice to provide your bot this ability through the natural language processing engine.
Integrate Wit.ai to BotStar
Before activating Wit.ai in BotStar, you need to enable the integration with an app in your Wit.ai account.
Step 1: Set up Wit.Ai account
Home page of app in Wit.ai
Select an app and open Settings, then copy the code in the Server Access Token.
Step 2: Connect BotStar to Wit.Ai
Access to your BotStar account and select a bot
Set up "Integrations" for a bot
Enable Wit.ai's integration and fill the copied code above to the Server Access Token (see image).
Click on the Save button to save all settings
Congrats! Now you can start using Wit.ai in the Flow Editor and Training.
Use Wit.AI for Training
After building a seamless flow in the Flow Editor, you can make your bot more lively and sound more like humans by adding some randomness or funny questions. Training will support you to improve chat conversations and make your bot smarter.
In the example below, you can train your chatbot how to respond to customers.
Step 1: Define a Set
Set is a group of bot responses for a specific topic. Think of set like a group of related topics for example.
In this example, we will create a set "Small Talk", let's open
Training in BotStar editor and click on New set. Then you need to consider "Minimum Confidence" that provided by Wit.ai. "Minimum Confidence" is the minimum ratio of confidence for analyzed results.
Go to Training and create Set
Note: In case your bot is multilingual, you can add more the similar sets through the supported language of Wit.ai.
Step 2: Create a New dialogue
Dialogue is a group of related questions and answers. There are two ways to define the response for a dialog:
Method 1: Using a block and text that the bot will respond to users automatically
Create a response by block
Create a response by text
Method 2: Writing as many the different types of text responses as possible
Define sample questions
In a dialogue, keep in mind that the more sample phrases you give, the better your bot will understand your users.
In a set, dialogues should not have the similarity of sample phrases, otherwise this will reduce the accuracy of the responses.
Use Wit.ai in the Flow Editor
(Before continuing with this section, we assume that you are already familiar with and have trained content in your Wit.ai app.)
You can start solving the problem: Matching the connector between blocks by analysing the semantics of the whole sentence instead of single words in the given example:
Sometimes, a part of the flow requires your bot to be able to understand user’s response, but the designed connector is only able to read a part of user response and can be misleading. Take a look at the example below:
In this scenario, the bot might trigger the wrong outgoing connector when a user responds with a phrase like "I don’t like any city" due to the condition of the block Smart Response containing the word "city", so the bot will respond incorrectly to a user.
What should we do to change this behavior?
Step 1: Train your chatbot
Firstly, we need to create an entity in the app associated with the bot.
Wit.ai Example Entity
Step 2: Update the flow
Next you can apply the trained entity into the flow. Then you can change the connector condition between Question and Smart Response.
After changing the condition, chatbot will respond with Smart Response when the user's response is similar to the sample answer (the trained sample phrases), which is accompanied by the accurate rate greater than or equal to 50%, provided by Wit.ai.
Note: In order to make bot more intelligent and sophisticated, you can continuously train your chatbot with different text responses.
For more information, please visit the official documentation page: https://wit.ai/docs