Mind Expression Docs
English
  • Mind Expression Docs
  • Why Mind Expression
  • Quickstarts
    • Create Scope
    • Add Subject
    • Test
    • Audit
  • Concepts
    • Scopes
    • Subjects
    • Components
    • Sandbox
    • Conversation history
    • Webhooks and escalation
    • Knowledge
    • Live Chat
    • Target Messages
    • Analytics
  • How-to Guides
    • Set up webhooks and escalation
    • Manage global keys
    • Customize messages
    • Educate AI
      • Manage ontologies
      • Recognition Check
      • Semantic Relations
      • Manage entities
    • Steps
    • Components
      • Normal Components
        • Conditions
        • Selection Classes
        • Parameter Bundles
      • Response Components
        • Component Actions
    • Build Q&A Subjects
      • Case 1. Online Payment
      • Case 2. Data Plans
    • Build Info Search Subjects
      • Case 1. Data Usage
      • Case 2. Payment History
    • Build Query Freestyle Subjects
      • Case 1. Data Purchase
      • Case 2. Change Mobile Plan
    • Intelligent Process
      • Introduction to Mindscript
      • Mindscript with Mind Expression
      • Frequently Asked Question
      • Package: Collections and Sequenceable
      • Package: Collections Unordered
      • Package: Collections-Strings
      • Package: Engine-Conversation
      • Package: Kernel-HTTP
      • Package: Kernel-Methods
      • Package: Kernel-Numbers
      • Package: Kernel-Dates
      • Package: Kernel-Objects
      • Package: Kernel Exceptions
      • Package: Cryptography
    • Test and debug
    • Integration
      • Mind Expression API
      • Chat Widget
      • LINE
      • Facebook Messenger
      • Viber
      • Instagram
      • Discord
      • WhatsApp
      • Google Sheet
        • Google Sheet Webhook
      • Google Calendar
        • Google Calendar Webhook
        • Google Calendar: Use Cases
    • Audit AI Activities
    • Live Chat
    • Target Messages
    • Back up, import and restore Scopes
  • Reference
    • Glossary
    • API Docs
Powered by GitBook
On this page
  • Before you begin
  • Add Selection Class

Was this helpful?

  1. How-to Guides
  2. Components
  3. Normal Components

Selection Classes

By having a Selection Class, you can set up Selections to define diverging paths for your customers to follow in the conversation. A Selection Class must include multiple Selections.

PreviousConditionsNextParameter Bundles

Last updated 1 year ago

Was this helpful?

Before you begin

  • This tutorial requires a webhook setup. Add a test webhook URL to your webhook settings.

http://mock-webhook.mind.ai

Add Selection Class

Add a Selection Class to set up Selections to define diverging conditions in the conversation.

  1. Click Add Component in the Components panel.

  2. Click Selection Class.

3. In the popup, enter Selection Class name as "Account Quantity" and Selection names as "Single" and "Multiple". A Selection Class requires at least two Selections.

4. Click Add.

Set up Selections

Each Selection requires Selection Term only, but adding Query Statement helps to better understand the customer query. The term and statement should be unique among the sibling Selections.

  1. Select the Single Selection in the Components panel to set it up.

2. In the Component Settings panel, you can optionally enter a binding key for the Selection Class. This case doesn't require a binding key.

3. Enter Selection Term as "Single" which is the term directing to the Selection when it is called out from the customer. You can also use a literal entity as a selection term instead of a literal value.

4. Optionally enter Query Statement which is the expected query from the customer as "I have one account". Additional Query Statement to Recognize may also be added but not required. This is used when multiple statements are expected from the user to choose a selection.

5. Click Recognize Statement to get the Recognition Results. The Recommended Statement is the statement which is semantically related to more ontologies and can generally capture more statement structures with the same intent. To use the recommended statement, just tick the checkbox saying Use Recommended Statement.

6. Optionally select a reference that will create a shift in the current conversation flow. Having a reference means the conversation will be directed to the selected Component in the current Subject or to another Subject. Normal Components (Selections and Conditions) can be a reference only for normal Components. This case doesn't require a reference because we will continue building the following flow in the current Component.

7. You can optionally set up termination at this Component by turning the Terminate toggle on. This case doesn't require a termination.

8. Click Save.

9. Now that you have set up for one Selection, the rest should be also set up. Select the next Component Multiple in the Components panel.

10. Enter Query Statement which is the expected statement of the problem from the customer as "I have multiple accounts".

11. Click Recognize Statement to get the Recognition Result.

12. Optionally select a reference that will create a shift in the current conversation flow. Having a reference means the conversation will be directed to the selected Component in the current Subject or to another Subject. Normal Components (Selections and Conditions) can be a reference only for normal Components. This case doesn't require a reference because we will continue building the following flow in the current Component.

13. You can optionally set up termination at this Component by turning the Terminate toggle on. This case doesn't require a termination.

14. Click Save.

Collect Selection Term or Query Statement

To collect the Selection Term or Query Statement, you need to set up the Selection Class with Check. Only one Check action can be added to a Selection Class. Check allows you to get the Selection Term or Query Statement from the customer, system, or both.

Check with customer is a way to prompt the customer to get the value. This is an example in a Pay the bill Subject to check with the customer how many accounts they have.

CONVERSATION PREVIEW

  1. Click Add Action in the Conversation panel.

  2. Click Check and stay in the Customer tab in the Action Settings panel.

3. You can optionally enter an instruction to be displayed before the prompt in the Action Settings panel. This case doesn't require an instruction.

4. Enter the prompt to the customer as "Do you have one account or multiple accounts with us?"

5. Select the number of max prompt attempts which is how many times the prompts will be repeated in case of not getting the expected response.

6. Click Save.

When the Check action is set up, the expected customer response will be shown with the Recognized Query Statement of the Selection (or Selection Term if there is no Query Statement).

Check with webhook is a way to interface with your back-end system to get the value. This is an example in a Pay the bill Subject to check with the system using a webhook how many accounts the customer has.

CONVERSATION PREVIEW

  1. Click Add Action in the Conversation panel.

  2. Click Check and select the Webhook tab in the Action Settings panel.

  3. Choose a webhook URL http://mock-webhook.mind.ai to use from the dropdown and enter URL Parameter (domain path and/or query string) as tutorial/tv-account?code=200&out=m. It will return a "multiple" Selection Term for the Selection Class.

Webhook URL (Method: GET)

BASE URL http://mock-webhook.mind.ai http://mock-webhook.mind.ai

URL PARAMETER tutorial/tv-account?code=200&out=m


Response Body

{
  "mind-visions-quantity": "multiple",
  "mind-visions": [
    {
      "name": "Mind Vision",
      "id": "92741023",
      "etc": "Mind Economy Package",
      "desc": "Mind Economy Package with 120 channels"
    },
    {
      "name": "Mind Vision",
      "id": "91244132",
      "etc": "Mind Sports Extra Package",
      "desc": "Mind Sports Extra Package with 180 channels"
    },
    {
      "name": "Mind Vision",
      "id": "72364018",
      "etc": "Mind Movie Lover Package",
      "desc": "Mind Movie Lover Package with 250 channels"
    }
  ]
}

4. Select the request method as GET.

5. Select an error message display method as Template and select an action as Terminate to take in case of HTTP 400. If Passthrough is selected, the webhook response will be displayed without modification.

6. Enter an error message that will be displayed to the customer.

Sorry, I am terminating the session.

7. Decide if you want to escalate the session by turning the Escalate on Termination toggle on or off. It will send the entire chat script to your backend system upon the termination. To turn on the escalation, you need to have an escalation webhook set up in the Scope.

8. Optionally, you can enter Key and JSONPath pairings for Result Mapping. This case doesn't require Result Mapping.

9. Enter JSONPath for Term Matching to extract a value to match the term literally.

$.mind-visions-quantity

10. Click Save.

When the Check action is set up, the result will be shown with the Recognized Query Statement of the Selection (or Selection Term if there is no Query Statement).

\

Check with customer using webhook is a way to prompt the customer to get the value based on a system response. This is an example in a Pay the bill Subject to check with the customer using a webhook how many accounts they have.

CONVERSATION PREVIEW

  1. Click Add Action in the Conversation panel.

  2. Click Check and select the Combined tab in the Action Settings panel.

3. Choose a webhook URL http://mock-webhook.mind.ai to use from the dropdown and enter URL Parameter (domain path and/or query string) as tutorial/tv-account?code=200&out=m. It will return a "multiple" Selection Term for the Selection Class.


Webhook URL (Method: GET)

BASE URL http://mock-webhook.mind.ai

URL PARAMETER tutorial /tv-account?code=200&out=m


Response Body

{
  "mind-visions-quantity": "multiple",
  "mind-visions": [
    {
      "name": "Mind Vision",
      "id": "92741023",
      "etc": "Mind Economy Package",
      "desc": "Mind Economy Package with 120 channels"
    },
    {
      "name": "Mind Vision",
      "id": "91244132",
      "etc": "Mind Sports Extra Package",
      "desc": "Mind Sports Extra Package with 180 channels"
    },
    {
      "name": "Mind Vision",
      "id": "72364018",
      "etc": "Mind Movie Lover Package",
      "desc": "Mind Movie Lover Package with 250 channels"
    }
  ]
}

4. Select the request method as GET.

5. Select an error message display method as Template and select an action as Terminate to take in case of HTTP 400. If Passthrough is selected, the webhook response will be displayed without modification.

6. Enter an error message that will be displayed to the customer.

Sorry, I am terminating the session.

7. Decide if you want to escalate the session by turning the Escalate on Termination toggle on or off. It will send the entire chat script to your backend system upon the termination. To turn on the escalation, you need to have an escalation webhook set up in the Scope.

8. Optionally, you can enter Key and JSONPath pairings for Result Mapping. Enter Key and JSONPath pairing as below.

Result Mapping Pair 1

KEY mind-visions mind-visions

JSONPATH $.mind-visions $.mind-visions

9. You can optionally enter an instruction to be displayed before the prompt in the Action Settings panel. Enter the instruction as below.

Account List:
{{#mind-visions}}
  {{name}}: ({{id}})
{{/mind-visions}}

10. Enter the prompt to the customer as "Do you have one account or multiple accounts with us?"

11. Select the number of max prompt attempts which is how many times the prompts will be repeated in case of not getting the expected response.

12. Click Save.

When the Check action is set up, the expected customer response will be shown with the Recognized Query Statement of the Selection (or Selection Term if there is no Query Statement).

ENTITY FOR SELECTION

Users can also utilize entities for selection classes to detect a response to decide which option the user prefers.

Just click on From Literal Entity Type then Select from Entity Type to choose which entity you are expecting for the user to input.

\

Learn more about

Managing Entities.