Attributes

Each conversation between the chatbot and the end user has a certain context behind it. The context is not configurable, it actually exists in the background and is created using attributes. Context in the chatbot universe is pretty much the same as you would imagine it when having a conversation with another human - you know that your friend loves pizza and that whenever you want to eat something, they will want pizza.

The attributes serve that purpose in chatbot creation. Picture them like parameters filled with different values through which you gain more information about the end user and their potential problems, wishes or inquiries. The attributes can be either local or global, which means if you configure a local attribute, its value will only be valid for the current dialog (for example the value of account_balance). And if you configure the attribute with a global reach (for example, first_name), its value will be shared between all intent-based dialogs.

Create Attributes

When the chatbot is determining the intent, there are several attributes which need to be acquired for the successful resolution of the intent.

All the attributes used in a dialog with the end user constitute the context. The context can be either global or specific to the dialog (local) and will help guide the conversation in the right direction.

Attributes panel allows the configuration of:

 

  • Attribute Name – needs to be entered without spaces
  • Attribute Type – regular or NER-enabled attribute
  • Attribute Scope - local or global
  • Agent visibility - when Answers are connected with Conversations
  • Editing of attributes – change of entered values
  • Deletion of attributes – remove attributes that are no longer needed

New attribute actions

 

Click ADD ATTRIBUTE to create a new attribute.

LIst of regular attributes in Answers

For the new attribute define the following:

  • Name - cannot contain space, must start with a letter or underscore, and use underscore to separate words
  • Type regular, MO attribute, or NER-enabled attribute
  1. Regular: text, URL, date, phone number, email, json, list, number, boolean, location
  2. MO attributes: MO Audio, MO Contact, MO Image, MO Document, MO Video, MO Location
  3. NER-enabled: Number, Date, Currency, Day of week, Country, City
  • Scope (local or global)

List of MO attributes in Answers

 

Use the check mark to save the attribute or the x mark to remove the line.

 

If you select  Edit (available when you click three dots menu), the attribute row becomes editable:

Editing of attributes in Answers

 

NER-enabled attributes

NER-enabled attributes help you extract relevant entities from the end user communication. They are used in combination with intents. When you want to extract entities from the user’s text, you can add them to the intent where you want to use them.

When creating an attribute for your chatbot, after the list of regular attributes, NER-enabled attributes follow.

NER-enabled attribute types

You can select one of the following attribute types. Check below what will be recognized as valid input for each attribute type:

  • Number - Numbers written in digits
  • Date - Checks if a word in the text is a date element (day, year, or month), accepts the following format yyyy-MM-dd 
  • Currency - Numeric amounts and currency names/codes/symbols
  • Day of week - Text for days of the week in English
  • Country - Data set from GeoNames
  • City - Data set from GeoNames

MO Attributes

MO stands for mobile originated – meaning a message that came from the end-user’s mobile phone. These messages can contain not only text, but images, video, locations, etc. In Answers, when you expect your end users to send messages containing files, you can use MO Attributes to save the content you receive.

Not all channels support all types of MO messages – check the table below to see which attribute you can use on which channel.

MO Attributes per channels in Answers

In case you entered an attribute that doesn’t follow the guidelines for attribute naming, here are examples how the Answers will transform them:

  • "COVID-19" -> "COVID_19" – underscore is used as replacement for non-alphabetic characters
  • "Flight Number" -> "Flight_Number" - no spaces are allowed
  • "Doctor's Contact" -> "Doctors_Contact" - underscore is used as replacement for non-alphabetic characters
  • "1" -> "_1" – cannot begin with a number, only letter or underscore
  • " "dsadsad" – character removed so the name starts with a letter

 

The list below shows how the validation for each attribute type works and the available operators when that type of attribute is used in Conditions element of the dialog:

Attribute type

Conditioning

Validation

Text

is, is not, contains, starts with, ends with, is null, is not null

Can contain letters/numbers/space

Number

is equal to, is not equal to, is less than, is less than or equal to, is greater than, is greater than or equal to, is null, is not null

Can contain only numbers, decimal with dot

Phone Number

is, is not, contains, starts with, ends with, is null, is not null

Contains only numbers

Boolean

is, is not, is null, is not null

True, False

Date

is equal to, is not equal to, is before, is before or equal to, is after, is after or equal to, is null, is not null

YYYY-MM-DD, only numbers

Location

is equal to, is not equal to, is null, is not null

 

URL

is equal to, is not equal to, is null, is not null

Validated with URL validator

Email

is, is not, contains, starts with, ends with, is null, is not null

Validated with email address validator

MO attribute type

Conditioning

Validation

MO Audio

is null, is not null

Accepts different audio files depending on the channel

MO Contacts

is null, is not null

Message can include: address, name, birthday, phone, organization, and URL

MO Document

is null, is not null

Accepts different formats depending on the channel

MO Image

is null, is not null

Accepts different image formats depending on the channel

MO Location

is null, is not null

Needs to come in the form of location’s latitude and longitude

MO Video

is null, is not null

Accepts different video formats depending on the channel

NER-enabled attribute type

Conditioning

Validation

Number

is equal to, is not equal to, is before, is before or equal to, is after, is after or equal to, is null, is not null

Numbers written with digits

Date

is equal to, is not equal to, is before, is before or equal to, is after, is after or equal to, is null, is not null

Checks if a word in the text is a date element (day, year, or month)

Currency

is null, is not null, is equal to, is not equal to

Numeric amounts and currency names/codes/symbols

Day of the week

is null, is not null, is equal to, is not equal to

Textual input for days of the week in English

Country

is null, is not null, is equal to, is not equal to

Data set from GeoNames

City

is null, is not null, is equal to, is not equal to

Data set from GeoNames

Fixed attributes

Fixed attributes were introduced to help with background processes. They are not visible in the list of attributes and do not have to be created in the system, they are already a part of Answers:

  • phoneNumber
  • lastReceivedMessage
  • lastReceivedTextMessage
  • endUserDestination
  • authenticated

phoneNumber attribute is used for channels that use MSISDN as destination and at the moment is enabled for the following channels: WhatsApp, SMS, Viber, and RCS.

Answers will automatically create it as a "Number" attribute with "Global" scope and fill it with the phone number of the user who sent the message.

You can use lastReceivedMessage attribute when you need to (re)start the conversation from a certain moment – this will work for all MO attribute values received except text message. For text messages use lastReceivedTextMessage.

You can also use these attributes if you expect your end users to start the conversation with a particular message (for example when you offer a discount or a benefit if the end user contacts you with a pre-set message).

endUserDestination is the attribute where the channel’s identification of the end user is saved. The way each channel identifies the end user as that particular user (for example, Facebook ID of the user).

authenticated  fixed attribute is type Boolean so the value it can have is either true or false. It has an expiry limit so even when set to true, that only lasts for a specific time period.

As mentioned, you don’t have to create them, they will be available for selection in Answers everywhere you have the Personalize option {}

After all attributes are created, the next step is to create necessary keywords

Delete Attributes

Lastly, the three dots menu on the right-hand side of the attribute enables you to delete the attribute, just select DELETE and confirm your choice:

Delete attribute in Answers