Chatbot

The Chatbot section of Amity Bots is dedicated to offering a comprehensive solution for businesses and developers to craft automated conversational agents tailored to their requirements. This section delves into how the system receives, processes, and responds to user messages.

Chatbot Menu Section

The Chatbot menu is the starting point of your bot-building journey. It primarily contains:

  • Decision: Here, you can adjust the parameters and settings for how your chatbot interacts and responds. Fine-tune according to your business goals and target audience. This section includes the following configuration

  • Content: This is the repository of pre-defined responses, templates, and other assets you'd like your chatbot to utilize.

Decisioning Process

For a chatbot to function effectively every message received is subjected to a decision-making process with the following steps:

1. Intent and Entity Extraction

The system analyzes the message content to pinpoint the user's intent (what they want) and entities (specific details or subjects related to that intent). For instance, in the message "Book a flight to Paris", the intent is "book a flight" and the entity is "Paris".

2. Mapper

Upon determining the intent and entities, each potential response or action is scored based on its relevance to the detected intent and entities. These actions are mapped in Mapper entries.

The system chooses the mapper entry with the highest score, ensuring the most appropriate and contextually relevant reaction.

Mapping qualification Criteria

  1. Intent Matching: The intent from the message should either match the intent in the mapper or neither should have an intent.

  2. Entity Conflict: There should be no conflicting entities between the message and the mapper. An entity is said to "conflict" when both the mapper and the message have the same entity name but different values. For instance, if the mapper has the entity "color=red" and the message detects "color=blue", there's a conflict and the mapper is disqualified.

Scoring Formula Simplified:

Let I be the matching intent confidence.

Score, S:

  1. Base score: S = I * 2.5

  2. For each entity name that matches, add 1: S = S + 1

  3. For each entity value that matches, add 1: S = S + 1

  4. If neither the mapper nor the result has an intent, add 0.5: S = S + 0.5

Examples:

Example 1: Message: Intent "buy" with confidence 0.8, Entities: color=blue, size=large. Mapper: Intent "buy", Entities: color=blue. Score calculation:

sqlCopy codeS = 0.8 * 2.5
S = S + 1 (for 'color' entity name match)
S = S + 1 (for 'color=blue' entity value match)
Final S = 4

Example 2: Message: No intent, Entities: fruit=apple. Mapper: No intent, Entities: fruit=banana. Score calculation:

S = 0.5 (no intent on both sides)
S = S + 1 (for 'fruit' entity name match)
Final S = 1.5

Example 3: Message: Intent "sell" with confidence 0.9, Entities: material=wood. Mapper: Intent "sell", Entities: material=wood, shape=circle. Score calculation:

S = 0.9 * 2.5
S = S + 1 (for 'material' entity name match)
S = S + 1 (for 'material=wood' entity value match)
Final S = 4.25

This approach ensures the selection of the most suitable mapper based on both intent and entities.

3. Action Execution

Once a mapper entry is selected, action defined in the selected entry is executed. There are currently 2 supported action types:

  1. Triggering a Message Template: The system can initiate a predefined response from the Message Template, offering a quick and relevant answer to the user's query.

  2. Triggering a Flow in Chatlogic: For those with the Advance package, the system is equipped to activate a specific flow within Chatlogic. This allows for more intricate and dynamic conversation paths, tailored to provide richer user experiences.

Last updated