Bot Creator
NLP
Natural Language Processing – NLP – is a core AI feature of the platform. It allows bot-creator to train bot to understand what end-user says (samples), detect its intention (intent detection), extract meaningful information for each intent (entity extraction) and so on.
Based on the understanding of what-user-says in natural language, the bot would be able to decide different business (scenarios/steps) and build flexible and correct answer for end-user.
Terms:
- Sample: a sentence end-user might say
- Intent: intent of sample
- Entity: meaningful information in sample (2 types: exact-match or predictive-match)
- Keyword: available values of exact-match entity
- Dictionary: lookup words to enhance sample
Their details are described as following sections.
Sample
Bot-creator can see list, add new, update and delete samples.
- Important note:
- After every change in NLP, user click button Train to tell bot to study again with new updates (not only Sample, but also others items such as Intent, Entity…)
For each sample, bot-creator can define its intent and entities – which would guide bot know what kind of important information to extract from end-user’s sentence and use it for answer business.
- Example: Event bot allows end-user to register an event ticket. The business of ‘register’ requires end-user provide some register’s information first to get the ticket, such as ‘name’, ‘email’ and ‘phone’. So bot-creator trains the bot that for samples with ‘register’ intent, bot should be able to find out 3 entities of ‘name’, ‘email’ and ‘phone’ if end-user provides in his sentence.
- if not found, the bot should be smart enough to ask back end-user to provide lacked information (see Scenario>Step>Form-card for more detail).
To quick test result of NLP training, user can click button ‘NLP Test’ and input a sample, then its result would be displayed:
- Intents (sorted by highest confidence)
- Entities
Intent
Bot-creator can see list, add new, update and delete intents.
Note:
- Intent name:
- allow lower case and underscore only
- starting word should be a verb (action)
- Intent description:
- should be defined clearly. It would be used for look up and suggestion later.
Entity
Bot-creator can see list, add new, update and delete entities.
Note:
- There are 2 types of entity which are suitable for different purposes and improve accuracy of entity extraction:
- Exact Match:
- Bot catches entity with pre-defined and fixed list of values
- Use this type if entity’s values are limitable and pre-definable.
- Ex: a shop sells around 100 products, so its retail bot should define ‘product_name’ as exact-match entity with a pre-defined list of available product names – as known as ‘keyword’. Then in real conversation, bot could understand correctly these supported products.
- Predictive Match:
- Bot catches entity by machine learning, so bot-creator trains bot with a number of samples entity tagging. Then in real conversation, bot would use the trained knowledge to guess which information is potential entity’s value (but not lookup in a fixed list values like Exact Match does).
- Use this type if entity’s values are not pre-definable.
- Ex: ‘person_name’ should be predictive match entity, because its values are various and not pre-definable.
- Exact Match:
- If not sure about which type of entity, use ‘Both’ type. However, highly recommend use one of 2 types above to get high accuracy of entity extraction.
Keyword
Exact-Match entity has a list of pre-defined values. These values called keywords.
In other words, keyword is meaningful only for Exact-Match entity, but not Predictive-Match entity.
Bot-creator can see list, add new, update and delete keywords.
Dictionary
Dictionary defines a list of phrases and their alternatives which are considered as same in a sample.
They could be synonyms, abbreviations, acronyms, initialisms or domain shortcut words etc.