If your Zendesk AI Agent Advanced isn't recognising entities like email addresses, order numbers, or names, there are a few key areas to investigate. This article will guide you through common reasons for entity detection issues, with a particular focus on the crucial role of entity order.
Understanding How Entities Work in Zendesk AI Agent Advanced
Zendesk AI Agent Advanced uses "entities" to identify and extract specific pieces of information from customer input (e.g., an email address, a full name, an order ID). This allows your bot to understand context and provide more accurate and efficient support.
The system relies on Regular Expressions (RegEx) to define what an entity looks like. When a customer interacts with your bot, the AI Agent attempts to match their input against the RegEx rules of your defined entities.
The Critical Role of Entity Order
One of the most important, and often overlooked, aspects of entity configuration is their order within your Zendesk settings.
How Entity Order Works:
When the AI Agent attempts to recognise an entity, it processes your defined entities from top to bottom in the list. The first entity whose RegEx rule successfully matches the customer's input will be recognised, and the system will stop checking for further matches for that specific piece of data.
Why This Matters:
If you have a broad or general RegEx rule at the top of your entity list, it might inadvertently "catch" values that are intended for more specific entities further down the list. This leads to incorrect entity recognition, as demonstrated in the example below:
-
Scenario: Imagine you have a
full-name
entity with a broad RegEx rule that matches 1-3 words, including characters like@
and.
. Below it, you haveemail
andorder_number
entities with more specific rules. -
Problem: If a customer provides their email address, the
full-name
entity (being higher in the list and having a broad rule) might incorrectly identify the email as a full name, preventing theemail
entity from ever being recognised. The same applies to order numbers that might contain numbers and appear as "words" to a broad full-name RegEx.
Common Issues and Solutions
Here's how to troubleshoot and resolve issues with entity recognition:
1. Review and Refine Your RegEx Rules
This is the most critical step. Overlapping or overly broad RegEx rules are a primary cause of incorrect entity detection.
-
Be Specific: Ensure each entity's RegEx rule is as specific as possible to the data it's meant to capture.
-
Example of a broad
full-name
RegEx:^\s*(\S+\s*){1,3}$
(This matches 1-3 non-whitespace "words" and can incorrectly capture emails or order numbers because.
and@
are considered non-whitespace characters, as are numbers). -
Example of a more specific
full-name
RegEx (letters only):^\s*([A-Za-z]+(?:\s+[A-Za-z]+){0,2})\s*$
(This ensures only alphabetical characters are matched for names).
-
Example of a broad
- Test Your RegEx: Use an external RegEx testing tool like regex101.com to test your RegEx rules against various inputs, including valid examples and examples meant for other entities. This will help you identify unintended matches.
2. Strategically Order Your Entities
Given the "top-down" processing of entities, their order is crucial.
-
Prioritise Specific Entities: Place your most specific and least sensitive entities higher up in the list.
-
Example:
email
andorder_number
entities typically have very specific RegEx patterns. They should generally be placed above afull-name
entity, especially if thefull-name
entity's RegEx is somewhat broad.
-
Example:
- Avoid Overlapping Catches: By placing specific entities first, you ensure they have the first opportunity to match, preventing broader rules lower down from incorrectly identifying data.
-
General Guidance: While there isn't a single "framework," a good rule of thumb is:
- Highly Specific Identifiers: Email, Order ID, Phone Number (if you have them)
- Specific but Potentially Broader: Dates, Times
- General Identifiers: Full Names, Addresses (these often have more flexible formats)
3. Check for Entity Overlap
After refining your RegEx and adjusting the order, re-evaluate if any entities still overlap.
- Systematic Review: Go through your entity list from top to bottom. For each entity, consider what types of input it could match.
- Cross-Reference: Compare the RegEx of an entity with the RegEx of the entities below it. If a higher entity's rule could match data intended for a lower entity, you'll need to either refine the higher entity's RegEx or reorder them.
Steps to Resolve Entity Recognition Issues
- Identify the Misrecognised Entity: Determine which entity is incorrectly being detected, and what kind of data it's incorrectly matching.
- Examine the RegEx: Go to the definition of the misbehaving entity and analyse its RegEx rule.
- Test the RegEx Externally: Use a tool like regex101.com to input your RegEx and various test strings (correct data, incorrect data, data for other entities).
- Refine the RegEx: Modify the RegEx to be more specific and prevent unintended matches.
- Adjust Entity Order: In your Zendesk AI Agent Advanced settings, reorder your entities to ensure that more specific entities are positioned higher than broader ones.
- Test Your Bot: Thoroughly test your AI Agent Advanced bot with various customer inputs to confirm that entities are now being recognised correctly.
By carefully managing your RegEx rules and understanding the impact of entity order, you can significantly improve the accuracy and effectiveness of your Zendesk AI Agent Advanced. If you continue to experience issues, please contact Zendesk Support with details of your entity configurations and examples of misrecognised input.
Comments
0 comments
Please sign in to leave a comment.