Entity Recognizers
Overview
The Entity Recognizer (ER) feature enables developers to define custom patterns to identify specific entities in natural language user queries. These patterns are used to extract relevant entities (e.g., email addresses, loan application numbers, phone numbers) that are critical for processing workflows efficiently.
For example: A user submits the query, "Give me the amortization schedule for my loan application: LA:12312331."
Developers can define a custom regex to recognize the loan application number
LA:12312331
.The Entity Recognition Node in the workflow can then use this pattern to extract the entity dynamically from the user query.
How to Create a New Entity Recognizer
Navigate to the Model Hub → Select the Entity Recognizer tab.
Click "Create Entity Recognizer."
Fill in the following fields:
Name: Provide a meaningful name (e.g., Loan Application Recognizer).
Pattern: Enter a regex pattern for the entity you wish to recognize.
Example: To identify loan application numbers in the format
LA:12312331
, use the regexLA:\d{8}
.
Flags: Optionally, specify regex flags to modify the pattern’s behavior.
Flags Explanation:
g
→ Global flag to find all matches in the input.i
→ Case-insensitive matching.s
→ Enables the dot.
to match newline characters.
Click "Create" to save the recognizer.
Using an Entity Recognizer in Workflows
To use a created Entity Recognizer, follow these steps:
Add the Entity Recognition Node to the workflow.
Pass the user query as input to the node.
Use the special variable
$agent.query
, which contains the user’s natural language query.
The node processes the input using the defined Entity Recognizer and outputs the recognized entity as shown in example below.
Example:
Entity Recognizer: Loan Application Number
Input: Give me the amortization schedule for my loan application: LA:12312331
Output:
The output from this node will be used as input for the next connected node, where the named entity can be accessed using the 'result' key
Key Use Cases for Entity Recognizers
✅ Extract Named Entities – Recognize and extract structured data (e.g., email addresses, IDs, dates) from user queries. ✅ Enhance Workflow Automation – Use extracted entities to dynamically route workflows or fetch related data. ✅ Handle Complex Inputs – Process unstructured natural language queries with precision.
Key Takeaways for Developers
✅ Customizable Patterns – Define regex patterns to recognize specific entities tailored to your use case. ✅ Seamless Workflow Integration – Use the Entity Recognition Node to incorporate entity extraction directly into workflows. ✅ Efficient Processing – Simplify user query handling by dynamically identifying and isolating critical information. ✅ Regex Flexibility with Flags – Use flags to adjust pattern behavior for better matching and adaptability.
By leveraging Entity Recognizers, developers can create AI workflows that intelligently extract and process key information, improving the efficiency and accuracy of automated responses.
Last updated