Yay bot building! To make your onboarding as easy as possible, here are 10 tips to efficiently setup your bot’s understanding. We’ll talking intents, entities and languages.
As a support to this article, we created two bots: a good assistant, and a bad assistant. Go check them out to see the dos and don’ts of bot building with Recast.AI!
First thing you need to understand are intents.
An intent is a box of expressions that mean the same thing but are constructed in different ways. You can picture it as a folder where your bot will be sorting user inputs. Intents are the heart of your bot’s understanding because they each represent an idea your bot will be able to understand.
1. Intents have to be distinct
That being said, the purpose of your intents is to understand what your end users means. You don’t want your bot to think that maybe you want to book a train ticket for tomorrow: you want your bot to be sure of it.
If the bot cannot understand exactly what you want, it will create a frustrating user experience. To avoid that, create very specific intents that serve one defined purpose.
2. Balance your intents
If you want Recast.AI’s intent classification to be truly efficient, it’s important to have a roughly equal number of expressions in each intent.
Even if it usually takes more examples to train your most important intent than you second-order ones, strive to keep their number of expressions around the same amount. This helps avoid a bias towards intents with a big expression count. In the Training Analytics part of your “MONITOR” tab, you can find your training balance in real time!
3. Merge similar intents
If two of your intents are very close in terms of expressions’ syntax or content, you should probably merge them.
Let’s take an example with an agent responsible for booking travel tickets. You could create an intent handling plane reservations, another for train tickets, and one more for bus tickets.
The problem here is that the expressions in each intent would be really similar, with only the transportation mode changing from time to time. You’ll be better set with only one intent handling reservation, and an entity catching the requested vehicle (don’t worry, we’re getting to entities soon).
4. Add common intents that all bots need
There are lots of things that all bots should do, like say hello, say goodbye, receive compliments, handle insults, get the weather… These are not a real part of the specific service your bot will provide but it greatly contributes to its sympathy quota!
These intents are very common and right now, you can easily fork them from a special bot we created: scaffolder. Scaffolder is a collection of bots and well-trained intents to help you build bots faster and focus on the core components of your agents. More, you can explore trending and new bots to get inspiration from the community.
Expressions are sentences your end users send to your bot. If you can imagine an intent as folder, an expression is a file neatly stored in it.
The more expressions you have, the more precisely your bot will be able to understand users.
5. Diversify your sentences
Amongst the infinity of parameters of text classification, one of the most important is the diversity between expressions of the same intent. If you want your bot to understand a very large panel of sentences, it’s paramount to train it with completely different grammatical structures and not to bias it with a single sentence pattern repeated a hundred times.
To cope with that, we introduced a “Diversity Indicator” in the Training Analytics section of the “MONITOR” tab. Hopefully everything should be green!
6. Avoid noise
Usually, your user will tend to either over-explain their request, or under-explain it by using only keywords.
As a bot builder, you want to add expressions that can help understand both extremes. To do this, you need to keep your expressions straight to the point of what your intent is supposed to catch.
Don’t be afraid to remove bits of your users inputs to keep the interesting parts.
Entities are important keywords extracted from expressions. We automatically detect 28 of them such as datetimes, names, locations, currencies, etc. You can find the exhaustive list here.
In addition to those gold entities, you can train your own and extract keywords specific to your use case. Simply select words and tag them.
Sometimes, entities can be mistaken for intents, but they don’t serve the same purpose. Let’s see how to use them efficiently.
7. Use entities as a part of your intents
While the syntax of your sentences is important, the entities present in the sentences also have a big influence on the classification. Bear in mind that the presence of an entity in a sentence will steer the intent detected towards others with the same entity.
8. Don’t tag everything
I sometimes see intents with almost every words tagged as an entity. That’s not necessary, and can even hurt the performances of your bot.
The purpose of entities is to be extracted from the sentence, allowing you to use it for a specific action. That means you should only tag information that your bot specifically needs to know and no more.
Recast.AI currently supports three languages: English, French, and Spanish. You can integrate all three of them in one unique bot to make it bilingual or even trilingual!
Keep in mind that if you only use one language, sending it as a parameter in your API call will make the response faster, by avoiding the process of detecting the language.
9. Balance your languages
It is not mandatory to use all three languages, but if you do, you’ll have to keep your intents balanced and homogeneous.
They should have nearly the same amount of sentences and contain the same entities.
With this principle applied, you can be sure that the performance of your bot in French is roughly the same in Spanish and English!
10. Be up to date
At Recast.AI, we try to release new features at the earliest. This mindset comes from two benefits: we get to release new features more frequently, and get feedback on a daily baisis.
To keep up with the most recent changes, keep an eye on the changelog section of our user manual, follow us on twitter to be notified when a new feature is coming up, and subscribe to receive our changelog via email!
You can find all tips in our developer guide here.
Happy bot building 🙂