Design and Build Intents and Entities
Designing and building intents and entities are crucial steps in developing a conversational AI like Oracle Digital Assistant. These components help the AI understand and process user inputs effectively. Here’s a detailed guide on how to design and build intents and entities:
1. Define Use Cases
Start by identifying the specific use cases your conversational AI will handle. This helps in determining the required intents and entities.
2. Design Intents
Intents represent the goals or purposes behind a user's input. Here’s how to design them:
Identify Common User Goals
List out the main actions users will want to perform. For an HR assistant, these might include:
- Checking leave balance
- Applying for leave
- Retrieving payroll information
- Asking about company policies
Create Intent Names
Name each intent clearly and concisely, reflecting the user’s goal. For example:
CheckLeaveBalanceApplyForLeaveGetPayrollInfoAskPolicyDetails
Define Training Phrases
Training phrases are example user inputs that map to each intent. Include various phrasings and synonyms to cover a broad range of possible user expressions. For example, for CheckLeaveBalance:
- "How many vacation days do I have?"
- "Check my leave balance."
- "How much PTO do I have left?"
- "Tell me my remaining leave days."
3. Design Entities
Entities are specific pieces of information that the AI needs to extract from user inputs to fulfill the intent.
Identify Required Entities
Determine what pieces of information are necessary for each intent. For ApplyForLeave, you might need:
LeaveType(e.g., vacation, sick)StartDateEndDate
Create Entity Types
Define the types of entities. For the ApplyForLeave intent, you might have:
LeaveTypeDate(for bothStartDateandEndDate)
Define Entity Values and Synonyms
For each entity type, list possible values and their synonyms. For LeaveType:
- Vacation: ["vacation", "holiday", "time off"]
- Sick: ["sick leave", "sick", "medical leave"]
4. Build Intents and Entities
Using Oracle Digital Assistant or any other platform, follow these steps to build intents and entities:
Create Intents
- Log in to Oracle Digital Assistant Console.
- Navigate to the Skills section and create a new skill or select an existing one.
- Add a New Intent.
- Name the intent (e.g.,
CheckLeaveBalance). - Add training phrases that users might say to express this intent.
- Name the intent (e.g.,
Create Entities
- Navigate to the Entities section within the same skill.
- Add a New Entity.
- Define the entity type (e.g.,
LeaveType). - List possible values and synonyms.
- Define the entity type (e.g.,
Link Entities to Intents
- Go back to the Intents section.
- Select an Intent and link the required entities to it.
- Define where in the training phrases the entities might appear.
- Set the entity extraction logic.
5. Implement and Test
Implement Dialog Flows
Create dialog flows that guide the conversation based on the detected intents and extracted entities. For example, for ApplyForLeave:
- Greet the user and confirm the intent.
- Ask for required entities if not provided (e.g., "What type of leave would you like to apply for?" "When would you like to start your leave?").
- Confirm the details and submit the request.
Test the Intents and Entities
- Test with Sample Data: Use a variety of test inputs to ensure the AI correctly identifies intents and extracts entities.
- User Testing: Conduct real-world testing with users to gather feedback and identify areas for improvement.
Example: Designing and Building CheckLeaveBalance Intent
Intent: CheckLeaveBalance
- Training Phrases:
- "How many vacation days do I have?"
- "Check my leave balance."
- "How much PTO do I have left?"
- "Tell me my remaining leave days."
Entity: No specific entities are needed for this simple intent.
Example: Designing and Building ApplyForLeave Intent
Intent: ApplyForLeave
- Training Phrases:
- "I want to apply for vacation leave from June 1 to June 5."
- "Request sick leave starting tomorrow for three days."
- "Apply for medical leave from next Monday to next Friday."
Entities:
- LeaveType
- Values:
- Vacation: ["vacation", "holiday", "time off"]
- Sick: ["sick leave", "sick", "medical leave"]
- Values:
- Date
- Use a pre-built date entity or create custom date handling.
Dialog Flow:
- User: "I want to apply for vacation leave from June 1 to June 5."
- AI:
- Detects
ApplyForLeaveintent. - Extracts
LeaveTypeas "vacation" andDateas "June 1 to June 5". - Confirms: "You want to apply for vacation leave from June 1 to June 5, right?"
- Detects
- User: "Yes."
- AI: "Your leave request has been submitted for approval. You will receive a confirmation email shortly."
Summary
Designing and building intents and entities involves understanding user needs, defining clear intents, and identifying the necessary entities. Proper implementation and thorough testing are crucial to ensure the conversational AI provides accurate and helpful responses. This structured approach helps create a robust and user-friendly digital assistant.
No comments:
Post a Comment