Audience – Administrator
Custom Regex can be used to capture strings with a similar pattern as an alternative to creating an Entity Class with specific named entities & synonyms.
Examples, where Regex is a better solution, is for things like IP addresses. It is going to be a lot easier to create a Regex to capture an IP address pattern like this "(?:\d{1,3}\.){3}\d{1,3}" than creating a named Entity Class with all the potential IP addresses from "0.0.0.0" to "999.999.999.999". However, Regex is considered a lazy way of doing this and is prone to errors if it does not follow a pattern as an IP address does.
Here are the steps to implement and use a custom Regex.
Problem: The client uses a custom ticketing solution that stores tickets in a numerical format different from our out of box Regex to detect Ticket ID.
Solution: To resolve the issue, use a new Regex called "BMC Ticket ID" to capture six-digit numbers.
1. Develop and test the Regex using an online regex tester like regex101.com.
2. Go to the Tenant and go to "Entities" and "Regular Expressions". Select "New Regular Expression" and provide a name and input the Regex.
3. Add the Regex to the Intent as an Input Variable. In the above example, I'm going to update the ticketId Variable to use the new Entity Class of BMC Ticket ID.
4. Add the Input Variable to the available Phrases.
5. Retrain the KGNER model followed by the intent-classification-model and Publish. You should be all set.
Comments
0 comments
Please sign in to leave a comment.