How to use the Botfuel Trainer

This document will show you how to use the Botfuel Trainer (https://app.botfuel.io) to create intents and QnAs, manage your content, and train your app:

  • Intent defines an action that the user is looking to perform. Each intent has a list of training phrases that are used to detect if the user input corresponds to the intent. The process of associating intents with a user input is called intent classification.

  • QnA consists of several paraphrases of a question and the corresponding answer. If the user input is similar to one of the questions then the QnA answer will be sent back to the user.

Working with intents

Your bot can have one or more intents. To create a new intent, click on the Add intent button to get to the intent creation and editing page and fill in the following:

Create new intent
  • Label (required): the label or name of the intent. Please note, this label will be used in your bot.
  • Description (optional): the intent description to provide more context on what the intent is supposed to do.
  • User prompt (optional): useful in cases when you have two or more similar intents or QnAs, and, as a result, the classification returns more than one result to a given user input. The user prompts can be used by the bot to ask the user to clarify. See the Botfuel Dialog document on intents and QnAs for more details on how Botfuel Dialog uses the user prompts.

Training phrases:

For each intent, you must provide a set of training phrases which are examples of what a user may say for that intent.

For example, the training phases for the buy-shoes intent could be:

I want to buy shoes!

I need some new shoes.

Show me some nice shoes!

Working with QnAs

Working with QnAs is very similar to working with intents.

To create a new QnA you click on the Add QnA button to get to the QnA creation and editing page and fill in the following:

Create new QnA
  • Title (required): that would help you to identify the QnA in a list, so make it short and distinctive.
  • Answer (required): the answer for the QnA. This answer will be returned to the user if the user input is classified to be similar to the example questions. If you need to include a lot of information, you can include hyperlinks in the answer.
  • User prompt (optional): useful in cases when you have two or more similar intents or QnAs, and, as a result, the classification returns more than one result to a given user input. The user prompts can be used by the bot to ask the user to clarify. See the Botfuel Dialog document on intents and QnAs for more details on how Botfuel Dialog uses the user prompts.

Training questions:

For each QnA you must provide a set of training questions. Each question corresponds to an example of what users may ask for that QnA.

For example, the training questions for the Opening Time QnA could be:

What is your opening time?

Are you open this Sunday?

What time will you close?

Training your app

Based on the training phrases (for intents) or training questions (for QnAs) you provided, the Botfuel Trainer will build a model for intent/QnA classification. You don’t need to know anything about NLP or machine learning to train your app. Training is done automatically each time you update the training phrases or questions.

Note that the Trainer has one model that includes both QnAs and intents for better understanding of user input. User input may correspond either to a specific intent or to a QnA question.

Testing your training

You can test how well your app understands users by writing any phrase in the test panel on the right. Given the input, the Trainer will present up to three matching intents or QnAs with their probabilities:

Test intent

Testing allows you to see what will happen in the actual bot when it responds to the user input using Classification Service API. See the Botfuel Dialog document on intent and QnA for more details on how Botfuel Dialog processes the trainer classificaiton result.

How to write good training sets?

  • When the bot is still being developed, no real sentences are available and it is often required to write sentences that we imagine the user will say.
  • When the bot is live, it is possible to improve bot understanding further by using real user sentences from your bot logs as training phases and training questions.

One should respect the following rules:

  • In general, the more training examples you provide, the better your app will understand the user
  • At least 5 utterances for each intent
  • Within an intent or QnA, training phases or questions should not be similar, but instead use varied words
  • The more intents you have in your app, the more training phrases and questions you need for each intent or QnA
  • Test the app and, if necessary, modify training examples to improve understanding