This document covers all you need to know about intents.
We call intent the intention of the user.
The process of associating intents with a sentence is called intent classification.
In the following, instead of sentences, we will use the term utterances. Utterances are more general than sentences because any sequence of characters can be considered an utterance.
A training set for an intent contains examples of utterances classified as this particular intent.
For example, the training set for the
buy-shoes intent could be:
I want to buy shoes! I need some new shoes. Show me some nice shoes!
In a Botfuel Dialog bot, each intent corresponds to a text file named
The content of this file is the training set associated with the intent and each line is an utterance.
Theses files are located in the
The NLU module, among other tasks, is responsible for the intent classification.
Training is the process of building a model from a training set. In order to train your bot, execute the following command in a terminal:
npm run train
Be sure to train each time you add, remove, rename or change an intent file.
Given an utterance, the NLU module computes a list of intents with their probabilities. The Dialog Manager then uses this list of intents to execute dialogs. Note that dialogs have the same names as intents.
As a general rule, the more data the better the classification algorithm will perform.
When the bot is live and used, it is possible to use real user sentences in the training sets.
When the bot is being developed, no real sentences are available and it is often required to write sentences that we imagine the user will say.
One should respect the following rules: