Answers
Artificial Intelligence chatbots
Intents

Intents

When end users contact a chatbot, they have a specific goal. Example: They may contact the chatbot to obtain information, perform an action, or resolve an issue. The chatbot needs to identify the goal of the end user's message so that it can take the relevant action.

Chatbots use intents to identify these goals. The process is as follows:

  1. Identify a list of potential goals that end users might have.
  2. For each goal, create an intent.
  3. Assign the intent to the relevant dialog.
  4. When an end user sends a message, the chatbot identifies the relevant intent of the message, and directs the end user to the dialog that is associated with the intent.

Example: For a chatbot that manages bookings:

End user's messageGoal of the messageIntent that is matched for the goalDialog to which the conversation is routed
I want to create a new reservationTo create a bookingCreate_bookingCreate
Need to reschedule my bookingTo manage a bookingManage_bookingManage
Can I cancel my appointment?To cancel a bookingCancel_bookingCancel
Note

Intents are mandatory for AI chatbots and optional for rule-based chatbots.

If you enable natural language processing for a dialog, you must assign an intent to that dialog for NLP to work correctly.

Training dataset for intents

Each intent has a training dataset that helps the chatbot identify the correct intent. The training dataset contains training phrases and important words.

Training phrases

Training phrases are a set of sample messages that end users are likely to send to the chatbot. These phrases help the chatbot understand what the end user wants. The chatbot can then take the relevant action.

Example:

 Manage_booking intentBaggage intent
Training phrasesI want to change my booking.
Help me manage my booking.
I want to reschedule my appointment.
Need help to manage my booking.
How do I modify my booking?

I want to know about my baggage allowance.
How many pieces of baggage can I carry?
What is the difference between hand baggage and check in baggage?
How much cabin baggage can I carry?
What is the check in allowance?

Training phrases can be single words, phrases, or complete sentences. The more the number of training phrases, the higher the probability for the chatbot to take the right action.

Important words

Similar to training phrases, important words also help identify intents. An important word is a single word that helps the chatbot uniquely identify the intent.

It is not mandatory to add important words. However, if there are similar intents, adding important words helps identify the correct intent.

In the following example, the important words Manage and Cancel help differentiate between the two intents.

 Manage_booking intentCancel_booking intent
Training phrasesI want to change my booking.
Help me manage my booking.
I want to reschedule my appointment.
Need help to manage my booking.
How do I modify my booking?
I want to cancel my booking.
Help me scrap my booking.
I want to call off my appointment.
Important wordManageCancel

Synonyms: When end users respond to your chatbot, they may use variations of the important words. Example: Instead of using the word 'manage', the end user may say 'reschedule'. You need to add these variations to the training dataset. Instead of adding these variations as separate important words, you can add them as synonyms to an existing important word. Example: For the important word 'manage', you can add the following synonyms: reschedule, move, change, and update.

The chatbot takes the same action whether the end user's response contains the important word or a synonym.

Named entity recognition attributes

Use Named entity recognition (opens in a new tab) (NER) attributes to extract information when end users respond with unstructured text. NER is a part of natural language processing (NLP). The goal of NER is to recognize and categorize information (entities) in the end user's message. These entities can be either a single word or a set of words.

Use NER attributes in combination with intents in AI chatbots.

NER attributes have the following fields.

Name

The name of the NER attribute. Example: mobile_attribute.

Type

NER attributes can have one of the following data types:

  • Standard NER attribute type
  • Custom attribute type

Standard NER attribute types

NER attributes can have one of the following NER-enabled data types. The behavior of these data types is different from the data types for standard attributes.

  • City: Data set from GeoNames (opens in a new tab)
  • Country: Data set from GeoNames (opens in a new tab)
  • Currency: Numeric amounts and currency names, codes, or symbols
  • Date: The date is stored in the format YYYY-MM-DD.
    • If an end user's message contains the date in Month/Day/Year format, the date is stored incorrectly.
    • If an end user's message contains the date in a different format, Answers converts the date to the format YYYY-MM-DD.
    • The attribute supports only names of English months.
    • If a part of a date is missing, Answers stores the value as 0. Example: If an end user's message contains '1st March' and the year is missing, the date is stored as 0-3-1.
    • The attribute accepts the following values:
      Day: Either from 1 to 31 or is missing
      Month: Either from 1 to 12 or is missing
      Year: Either from 1900 to 2100 or is missing
    • If the day (DD) information is present, the month information (MM) must also be present.
    • Example:
      End user's messageDate attribute
      1st of March, 20232023-3-1
      01/03/20232023-3-1
      1.3.20232023-3-1
      1/3/20232023-3-1
      1-3-20232023-3-1
      First of March, 20232023-3-1
      First of March0-3-1
      March0-3-0
  • Day of week: Text for the days of the week, in English
  • Number: Numbers written in digits. Example: Use a NER attribute of type, Number, to extract the customer number
  • Relative date: Supports the following relative dates.
    • TODAY
    • YESTERDAY
    • TOMORROW
    • DAY_BEFORE_YESTERDAY
    • DAY_AFTER_TOMORROW
    • LAST_MONTH
    • LAST_YEAR
    • THIS_MONTH
    • THIS_YEAR
    • NEXT_MONTH
    • NEXT_YEAR
      Example:
      End user's messageRelative Date attribute
      That happened today?TODAY
      Is that the day before yesterday?DAY_BEFORE_YESTERDAY
      Is that the day after tomorrowDAY_AFTER_TOMORROW
      Was that the previous month?LAST_MONTH
      Was that the last month?LAST_MONTH

Validation for standard data types

Standard data typeConditionValidation
Cityis equal to | is not equal to | is null | is not nullData set from GeoNames
Countryis equal to | is not equal to | is null | is not nullData set from GeoNames
Currencyis equal to | is not equal to | is null | is not nullNumeric amounts and currency names/codes/symbols
Dateis equal to | is not equal to | is before | is before or equal to | is after | is after or equal to | is null | is not nullChecks if a word in the text is a date element (day, year, or month)
Day of the weekis equal to | is not equal to | is null | is not nullTextual input for days of the week in English
Numberis equal to | is not equal to | is before | is before or equal to | is after | is after or equal to | is null | is not nullNumbers written with digits

Custom attribute types

In addition to the NER-enabled data types, which are defined by Answers, you can create custom attribute types for NER attributes. Use custom attribute types to identify predefined entity values in end user messages.

Create a custom attribute type and add custom values to it. If the end user's message contains one of the custom values, configure the chatbot to direct the flow accordingly. For an example that explains how to use custom attribute types, refer to the Use entities section.

Custom attribute types are case sensitive. So, add values in the same format that you expect end users to use.

All AI-supported languages support custom attribute types.

Supported data type by language

The availability of an attribute type depends on the chatbot language.

English, Spanish, and Portuguese support the following NER attribute types:

  • City
  • Country
  • Currency
  • Date
  • Day of week
  • Number
  • Relative date
  • Custom attribute types

Other languages support the following NER attribute type:

  • Number
  • Custom attribute types
Note

If you change the language of the chatbot and the new languages does not support the NER attribute type, the NER attribute becomes invalid. You must correct the error before you activate the chatbot. Example: Your chatbot language is English and you create the startDate NER attribute with the Date attribute type. If you then change the chatbot language to Arabic, the startDate NER attribute is invalid because Arabic does not support the Date NER attribute type.

Subtype

A subcategory for the NER attribute type. Subtypes enable you to capture 'to' and 'from' values in responses from end users. Example: If your chatbot is for booking flights, use two City type NER attributes with Source and Target subtypes to capture the 'from' and 'to' cities.

NER attributes can have one of the following subtypes:

  • Source
  • Target
  • None

Subtype is optional. But, if you want to assign two NER attributes of the same type to an intent, you must define the subtype for each attribute. Also, the subtype for each of these attributes must be different.

If you do not add the subtype, you can add only one attribute of a specific type to an intent.

Example: For Intent_1, you can add the following attributes of the type City and define their subtypes:

  • Location_from attribute - Source subtype
  • Location_to attribute - Target subtype
  • Location attribute - None subtype

When the end user sends a message, the attributes are recognized as follows:

End user messageLocation_from attributeLocation_to attributeLocation attribute
I want to travel from London to ZagrebLondonZagrebempty
I want to travel to ZagrebemptyZagrebempty
I want to visit ZagrebemptyemptyZagreb
Note

Source and Target subtypes are available for Country, City, and Currency attribute types.

Scope

The scope can be one of the following:

  • Local: The attribute is specific to a dialog
  • Global: The attribute can be used across multiple dialogs within the chatbot

List

You can select whether the NER attribute is for a single value or a list. If you define the attribute as a single value, the attribute stores the first relevant value from the end user's message. If you define the attribute as a list, the attribute stores all relevant values from the end user's message.

Example: You want to store the name of the city in the city attribute. The end user message is "I want to visit London, Chennai, and Zagreb". If you define the city attribute as a single value, it stores the first city in the end user's response, that is, London. If you define the city attribute as a list, it stores all the cities in the end user's response, that is, London, Chennai, and Zagreb.

To define the attribute as a list, select List. Otherwise, the attribute is set as a single value.

If you define the attribute as a list, you can use other Answers elements to obtain specific information.

Example: You want to obtain the name of the city from the end user. The end user's message is "I want to visit London, Chennai, and Zagreb".

  1. Define the city attribute as a list. city stores all the cities in the end user's response. So, city contains London, Chennai, and Zagreb.

  2. Use the Conditionselement to identify the number of values in the city attribute.

  3. If the number of values is 1, use this value for the next steps of the chatbot flow.

  4. If the number of values is more than 1, use either the Quick Reply or the Carousel element to ask the end user to provide the specific value from of the list of values. In this example, the number of values is 3. So, use a Quick Reply or Carousel element to ask the end user the specific city from the 3 values. "In which of these cities you would like to start your trip? London, Chennai, Zagreb"

  5. The end user chooses Zagreb.

  6. Use Attribute element validation to make sure that only 1 value, that is, Zagreb, is now stored in the city attribute.

Available to agents

If you select this field, the NER attribute value is visible to an agent when the chat is transferred from the chatbot to an agent in Conversations.

In Conversations, the attribute value is displayed in the context card of the conversation and the conversation history.

If you also select Sensitive data, the attribute value is displayed as a hashed value in Answers and Conversations..

To hide the attribute value from agents, deselect this field.

Sensitive data

If you select this field, the attribute value is encrypted when it is stored in the database. So, the attribute value is displayed as a hashed value in Answers and Conversations.

Example: The message is displayed as follows.
When this field is disabled: Your account balance is 2123.32.
When this field is enabled: Your account balance is ####.##.

Use this field if the NER attribute contains sensitive data. This setting is especially useful when chats are transferred to live agents.

This feature is applicable only for outbound attributes.

The user interface

Intents tab

This tab contains a list of intents.

  • Intent name: Name of the intent
  • Training phrases: The number of phrases used to train the intent
  • Important words: The number of important words used with the intent
  • NER attribute: The number of NER attributes used with the intent
The Intents tab

To view the list of training phrases, important words, and NER attributes for an intent, click the intent and navigate to the relevant tab.

Training phrases for intents

Custom attribute types tab

To access this tab, go to Attributes tab > Custom attribute types. This tab shows a list of custom attribute types and the number of list items that they contain. Click a custom attribute type to view these items.

Custom attributes tab

NER attributes tab

To view a list of NER attributes, go to the Attributes tab > NER attributes tab.

For information about the fields for a NER attribute refer to the NER attributes documentation.

NER attributes tab

How to

Create an intent

Refer to the guidelines for creating intents.

You can create an intent either from the Intents tab or from a dialog.

Create intent from the Intents tab

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots and navigate to your chatbot.
  2. Go to the Intents tab.
  3. Click Add intent.
  4. Click either the pencil icon or within the 'New intent' text, and enter the name of the intent. Create intent
  5. Add training phrases and important words to the intent.

Create intent from within a dialog

You can create intents only from standard dialogs. You cannot create intents from the Default, Authentication, and Session Expire dialogs.

Follow these steps.

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots and navigate to your chatbot.
  2. Click the dialog for which you want to create the intent. Create intent from dialog
  3. In the Intent Settings section, click the menu and click Create new intent. Create new intent
  4. Enter the name of the intent and click the checkmark. Name the intent
  5. Add training phrases and important words to the intent.

Add training phrases to an intent

You can add training phrases in the following ways.

  • Manually
  • Generate automatically using AI (Early access)

Add manually

Refer to the guidelines for creating training phrases.

  1. Go to the Intents tab.
  2. Select the intent for which you want to add training phrases.
  3. In the Training phrases tab, select Add training phrase and add the phrase. Add training phrases manually

Generate automatically using artificial intelligence

EARLY-ACCESS

Note

This feature is in the Early access stage.

You can generate a maximum of 60 training phrases at a time. If you want more than 60 training phrases, generate the phrases multiple times, for a maximum of 100 times a month.

When you generate the training phrases more than once, duplicates might be created. The chatbot discards these duplicates and adds only unique values to the intent.

Follow these steps to generate a set of training phrases.

  1. Go to the Intents tab.

  2. Select the intent for which you want to add training phrases.

  3. In the Training phrases tab, select Generate using AI.

    Generate training phrases for intents
  4. In the Generate phrases side panel > Intent description section, add a description for the intent. You can add a maximum of 512 characters, including spaces, new line, and special characters.

    Configure the intent description
  5. In the Example phrases section, add sample messages that you expect the end user to send the chatbot for this intent. These examples guide the AI engine in creating the type of training phrases that you want. Follow these guidelines:

    • You must add a minimum of 2 training phrases and can add a maximum of 10 training phrases.
    • Make sure that the sample training phrases are unique and diverse.
    Add sample training phrases
  6. In the Intent language field, select the language in which you want the training phrases to be generated.

    Select the language in which training phrases must be generated
  7. Specify the number of training phrases to generate. You can specify a maximum of 60.

    Select the number of training phrases to generate
  8. Select Generate phrases. The status shows that the training phrases are being created.

    The progress of the training phrase creation is displayed

    When the training phrases are ready, the chatbot shows a notification.

    Message is displayed when the training phrases are generated

    The training phrases are now available for the intent.

    Generated training phrases are added to the intent

Add an important word to an intent

Refer to the guidelines for creating important words.

  1. Go to the Intents tab.
  2. Click the intent for which you want to add important words.
  3. In the Important Words tab, click Add important word.
  4. Enter the important word.
  5. (Optional) Add the synonyms. Add important words

Create a NER attribute and add to an intent

Carry out the steps in each of the following sections sequentially.

  1. Create an intent. Refer to the How to create intent section.
  2. Create a custom attribute type.
  3. Create a NER attribute that uses the custom attribute type.
  4. Add the NER attribute to the intent.

Create a custom attribute type

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots and navigate to your chatbot.
  2. Go to the Attributes tab > Custom attribute types tab.
  3. Click Add custom type.
  4. Click the new custom type that is created. Add custom attribute type
  5. Click either the pencil icon or within the 'New custom attribute type' text, and enter the name of the custom attribute type. Example: mobile_devices.
  6. Click Add custom value.
  7. Add each value that this attribute type can contain. Example: mobile phone, tablet, laptop. Enter the values in the exact format, including upper and lower case, in which you expect the end user to respond. Add custom values

Create a NER attribute

  1. Go to the Attributes tab > NER attributes tab.
  2. Click Add NER attribute.
  3. Configure the following fields. For information about these fields, refer to the NER attributes documentation.
    • Name: Enter a name for the attribute. Example: mobile_attribute.
    • Type: Choose the custom attribute that you created. If you want to use the attribute in a Conditions element, refer to the Validation for Attributes section to make sure that you choose the correct type. Add the custom attribute type to the NER attribute
    • Scope: Choose whether the attribute is Local or Global.
    • List: Select whether the NER attribute is for a single value or a list.
    • Available to agents: Deselect this field to hide attribute values from agents when the chat is transferred from the chatbot to an agent in Conversations.
    • Sensitive data: Select this field if you want to display attribute values as hashed values in Answers and Conversations.

Add the NER attribute to the intent

  1. Go to the Intents tab.
  2. Navigate to the intent > NER attributes tab.
  3. Click Add NER attribute.
  4. Choose the NER attribute that you created. Add a NER attribute to an intent

Assign an intent to a dialog

After you create an intent, assign it to the relevant dialog. Example: Assign the Manage_booking intent to the Manage dialog.

You can assign intents only to standard dialogs. You cannot assign intents to the Default, Authentication, and Session Expire dialogs.

  1. In the chatbot editor, click the name of the dialog to view the settings. Assign an intent to a dialog
  2. To use an existing intent, choose the intent from the list. Choose the intent
  3. To create a new intent for the dialog, refer to the Create an Intent section.

Use entities to branch a dialog

If end users contact your chatbot for similar products or categories, you would need to create a separate intent and dialog for each product. When directing the flow, you would need to add a branch for each product. You may need to add a similar set of training phrases to each intent.

Also, if there are several products, it could lead to a large number of intents and branches.

To avoid this situation, you can do one of the following:

  • If there is a small number of similar products, you can branch based on entity values.
  • If there is a large number of similar products, you can branch based on entity types.

Branch based on entity values

Example: End users contact your chatbot about different car brands - CarA, CarB, and CarC.

To branch based on entity values, do the following:

  1. Create a custom attribute type for cars and add the brands as attribute values. Create a custom attribute
  2. Create a NER attribute. In the Type field, choose the custom attribute type. Create NER attribute
  3. Create an intent that contains training phrases for all car brands. Create an intent
  4. Add the NER attribute to the intent. Add NER attribute to the intent
  5. Branch the chatbot based on the value of the NER attribute. Branch based on value
  6. Test the flow in the simulator. Example: If you enter a question about CarB, the chatbot takes you to the dialog for CarB. Test in the simulator

Branch based on entity types

Example: End users contact your chatbot about different car brands and models.

  • CarA - Model_A1, Model_A2, Model_A3, Model_A4
  • CarB - Model_B1, Model_B2, Model_B3, Model_B4
  • CarC - Model_C1, Model_C2, Model_C3

To branch based on entity types, do the following:

  1. Create a custom attribute type for each car brand and add the models as attribute values.
    • Entity_CarA = {Model_A1, Model_A2, Model_A3, Model_A4}
    • Entity_CarB = {Model_B1, Model_B2, Model_B3, Model_B4}
    • Entity_CarC = {Model_C1, Model_C2, Model_C3}
    Create the custom attribute type
  2. Create NER attributes for each car brand. In the Type field, choose the custom attribute types. Create NER attribute
  3. Create an intent that contains training phrases for all car brands. Create an intent
  4. Add the NER attributes to the intent. Add NER attribute to the intent
  5. Branch the chatbot based on the NER attribute. Branch based on entity type
  6. Test the flow in the simulator. Example: If you enter a question about Model_B3, the chatbot takes you to the dialog for CarB. Test the flow in the simulator

Import intents

Automate the process of adding intents and training phrases, instead of manually adding them one by one.

Carry out the steps in the following sections sequentially:

  1. (Optional) Download a sample file for reference.
  2. Create a file that contains intents, training phrases, important words, and synonyms.
  3. Upload the completed file.

Download a sample file

This is an optional process.

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots and navigate to your chatbot.
  2. Go to the Intents tab.
  3. Click Import.
  4. Click Download example.

Create the file

Prepare a file that contains phrases and sentences that end users are likely to use in conversations with your chatbot. Ideally, use phrases taken from your customer-facing portals. Example: online chats with your customer service.

Make sure that the file follows these criteria:

  • The file type must be .csv or .txt.
  • There must be no empty rows.
  • The file must not have a header.
  • Training phrases:
    • Add each training phrase to a separate line.
    • Use a semicolon to separate training phrases and intents.
    • Organize the training phrases by intent.
    • Format:
      Training_Phrase;Intent
  • Important words:
    • Add each important word to a separate line.
    • Use a semicolon to separate important words, intents, and the synonyms of the important words.
    • Use commas to separate multiple synonyms.
    • Organize the important words by intent.
    • Format: 
      Important_Word;Intent;Synonym1,Synonym2,Synonym3

Example: For the Welcome and Goodbye intents, the file is as follows:
How are you?;Welcome
How can I help?;Welcome
Thank you.;Goodbye
Glad to have been of help.;Goodbye
Bye.;Goodbye;farewell,ciao
Close;Goodbye;end,finished

Import the file

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots and navigate to your chatbot.
  2. Go to the Intents tab.
  3. Click Import. Import intents
  4. Select the file.
  5. Click Import. Choose the file

If there are issues with the file, Answers shows an error.

  • Incorrect file type Error when importing intents
  • Incorrect formatting. Example: wrong delimiter Error when importing intents

Export intents

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots and navigate to your chatbot.
  2. Go to the Intents tab.
  3. Select one or more intents on the page. To export all intents, select the checkbox against Intent name. Export intents
  4. Click Export.

The intents are downloaded in a predefined format as a .csv file.

Note

Any NER attributes, which are part of the intents, are not exported.

Rename an intent

  1. Click an intent. Edit the intent
  2. Either click the name of the intent or click the pencil icon. Rename the intent
  3. Add the new name.

Delete an intent

Follow one of these options:

Delete one or more intents

  1. Select one or more intents.
  2. Click Delete. Delete the intent

Delete from within an intent

  1. Click an intent. Edit the intent
  2. Click the Delete icon. Delete the intent
  3. Confirm the action. Delete intent

When the intent is deleted, you get a notification.

Deleted intents

Delete a training phrase

  1. Go to the Intents tab.
  2. Click the intent in which you want to delete training phrases.
  3. In the Training phrases tab, hover over the training phrase that you want to delete.
  4. Click the Delete icon. Delete a training phrase

Delete an important word

  1. Go to the Intents tab.
  2. Click the intent for which you want to delete important words.
  3. In the Important Words tab, hover over the important word that you want to delete.
  4. Click the Delete icon. Delete important word

Delete a NER attribute

  1. Go to the Intents > NER attributes tab.
  2. Hover over the NER attribute that you want to delete.
  3. Click the Delete icon. Delete NER attribute

Test intents

Check how well Answers recognizes the intents in your chatbot.

In the simulator, do the following:

  1. Click Start Simulation.
  2. Enter an end user message.
  3. Click Intent engine.
intent engine in simulator

In the right-hand pane, you can view the following:

Intent matched: The intent with the highest score that was recognized by evaluating the tokenized text against training phrases. If an incorrect intent is matched, follow the steps in the Incorrect intent is matched section.

Route to dialog: The dialog that was linked to the recognized intent (in the intent matched section) when the chatbot was built.

Original text: The original end user message without any changes, such as autocorrection or other post processing actions.

Tokenized text: The text that was obtained after word autocorrection and removing stop words.

Autocorrected: Indicates whether autocorrection was applied. If autocorrection was applied, the field value is true.

Resolved attributes: Resolved NER attributes that are configured for the recognized intent.

For any dialog, the intent engine details are available only outside that dialog.

Troubleshooting

Number of training phrases in intent higher or lower than others

The system has detected that the number of training phrases for one of your intents is significantly higher or lower than for others. Use a similar number of training phrases for all intents.

Incorrect intent is matched

If the intent match is not correct, check the Tokenized text section to understand which words were used to evaluate the intent score.

intent engine in simulator

Example: Your chatbot uses the following intents - 'book appointment', 'cancel appointment', and 'reschedule appointment'. If Answers incorrectly recognizes 'book appointment' as the intent instead of 'cancel appointment, do one or more of the following:

  • Add more training phrases to the correct intent (cancel appointment).
  • Relocate some of the training phrases between intents (from 'book appointment' to 'cancel appointment')
  • If intents are similar, merge them into a single intent, and use a different approach to distinguish between the actions. Example: Use a combination of named entity recognition (NER) and a custom attribute type. Refer to the Use Entities to Branch a Dialog > Branch based on Entity Types section.

Analytics

Identify unrecognized intents

Use the unrecognized intents message list in the Conversational analytics to identify the end user messages for which the chatbot cannot identify the intent.

If this list also contains user start messages, it means you need to include these messages as training phrases in your starting intent.

If this list contains messages that you did not expect as possible training phrases or intents, use these messages as training phrases or create new intents, if required.

Unrecognized intents list in analytics

Need assistance

Explore Infobip tutorials

Encountering issues

Contact our support

What's new? Check out

Release notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Service Terms & ConditionsPrivacy policyTerms of use