Setting Context
Last updated
Last updated
From the response script, the intention that starts a conversation context and the subsequent intentions within that context will be determined. For the intent that started the context, set the output context for that intent. Subsequent intentions that appear in this context have an input context that is also the output context of the starting intention.
Example: Scenario "Consulting on savings products"
With the above scenario, the intention to start the context of "consulting about savings products" is "request_open_savings" (sample sentence: I want to deposit savings at Abank). The output context of this intent is “request_open_savings _context”. The next intent that appears in the context of “savings product consulting” is “ask_savings_interest_rate” (sample sentence: What is the bank's current interest rate?), this intent has the main input context as “ request_open_savings _context”.
Add an initial intent and set the output context
Step 1: In the context section, select "Create new" intent
Step 2: At the intent tab, enter the starting intent name
Step 3: At the output context tab, enter the corresponding context name (The trainer adds a small number of sample sentences corresponding to the intention to check the response)
Step 4: Set the “Life-span” parameter to determine the lifetime of the output context. Click on the circled icon and change the “Life-span” parameter (system default is 5, Trainer can change the value depending on the scenario).
Note: It is recommended to set a large value for the lifespan parameter to maintain the conversation context.
For example: Output context hoi_gui_tiet_kiem_context (Lifespan: 5): Activity context after 5 consecutive customer inquiries.
Step 5: Click "Save" to complete
Note when naming the context
The next intention that appears in the context of "Consulting on savings products" is "ask_savings_interest_rate" corresponding to the sample sentence "What is the current interest rate of the bank?". This intent has the main input context “request_open_savings_context”.
Set the input context for this intent as request_open_savings_context as follows:
When given two intents with identical trained sample sentences, the intent whose input context is currently active will be recognized. In natural communication, there are conversational flows made up of intentions that follow each other and appear in pairs of intent – follow-up intent. The follow-up intent feature allows trainers to manage the context for pairs of intents that occur together. Besides, helping to orient the bot to situations that may occur in the context of a conversation helps the bot give accurate responses and meet customer requests.
For example:
In the scenario below, the request to change information intent (change_information) is the main intent of the “request to change information” context. The following intentions that can occur in this context are: change phone number (change_phone_number), change email (change_email), or change customer name (change_name).
When adding a follow-up intent, the output context is automatically added to the main intent and it is also the input context of the corresponding follow-up intent. Follow-up intents are recognized only when the main intent is triggered in the conversation by the customer. Trainers can also create multiple levels of follow-up intent.
The output context of change_information intent is automatically added as the input context of the change_email intent
Regulations
For example
Use alphanumeric characters or numbers
Context1
Use - or _ instead of spaces.
Context-1
Use upper or lower case characters as desired
Context or Context are both correct
You should name the context associated with the intent name for easy distinction
Intent name: check_account
Context name: check_account_context