Before you begin
To follow the steps in this tutorial, set up a sample Pega Platform application with the Insurance Quote case type and a Legacy Webchat channel.
Create the Insurance Quote case type for car insurance quotes with the following settings:
- Add the following data types to the Insurance Quote case type for the car make,
model, and vehicle identification number (VIN): carMake,
carModel, and carVIN.
For more information, see Associating data objects with case types.
- Enable Legacy Webchat channel-specific conversations for
a stage of the Insurance Quote case type.
For more information, see Adding a conversational channel to a case type process.
- Configure conversation questions for a stage process of the Insurance Quote case type by adding three simple questions for the make, model, and VIN data types.
Configure a Legacy Webchat channel with the following settings:
- In the Content section on the
Configuration tab, add the
insurance create case command for the Insurance Quote
For more information, see Adding case commands for a conversational channel.
- On the Behavior tab, enable advanced text analyzer
configuration and add the iNLP text analyzer. Ensure that the IVA can interpret
text in both the context of the case and outside of the case context.
For more information, see Adding a text analyzer for an IVA.
After you configure these settings for your IVA for Legacy Webchat, the system text analyzer engine can detect when a user requests a car insurance quote in the chat window. As a result, the chatbot will create the Insurance Quote case in the system. The system then asks the three insurance questions about the make, model, and VIN of the car.
Associating topics with user input
Improve the chatbot so that the system can correctly detect topics from user input by simulating a conversation in the preview console. You can associate existing topics with the user input that the chatbot does not recognize correctly, and add more examples of similar user input to improve future responses.
Topics are the general subject matter of a chat conversation that the system detects, for example, a request for a car insurance quote or an enquiry about a bank loan. After updating the text analytics model with samples of user input for the insurance topic, the chatbot correctly detects the subject matter and automatically starts the Insurance Quote case when the user requests information about a car insurance quote.
Associate topics with user input by performing the following steps:
- In the navigation pane of App Studio, click Channels.
- In the Current channel interfaces section, click the icon that represents your existing Legacy Webchat channel.
- In the channel, click the Behavior tab.
- In the preview console in the right panel, enter a request for a car insurance quote.
- Click Define topic below the entered text.
- In the Topic field, press the Down arrow key, and then select the correct topic.
- Optional: To associate the topic with additional similar user input, perform the
- In the field below the topic name, enter more sample user input for the insurance topic.
- Click Add example and add additional sample user input for the insurance topic.
- To define additional user input, repeat step 7.b.
- Click Submit.
- Rebuild the model by clicking Build model.
Configuring and mapping entities to case type properties
Train the chatbot to detect the correct entities from user input when a user requests an insurance quote, by simulating a conversation in the preview console. When you enter text and receive replies in the preview console, you can also define entities that are missing from user input. As a result, the system automatically adds the detected information about car makes and models from the actual chat conversations with users to the created Insurance Quote case properties.
Entities are short phrases detected in the conversation, for example, an email address, car make, or car model. In the example below, create the Carmakeent and Carmodelent entities to associate them with the car make and model in the user input. Map these two entities to the .carMake and .carModel case properties that you define for the Insurance Quote case, respectively.
- In the preview console, enter a request for an insurance quote.
- Display more information about the conversation and the case by turning on the Show analysis switch
- Associate new entities with "Ford" and
"Mustang GT" from the text that you entered in step
1 by performing the following steps:
- Select and right-click Ford in the displayed text, and then click New entity.
- In the Entity name field, enter: Carmakeent
- Click Submit.
- Select and right-click Mustang GT in the displayed text, and then click New entity.
- In the Entity name field, enter: Carmodelent
- Click Submit.
- Map the extraction of the two entity types that you created to case properties,
by performing the following steps:
- In the Create case section, click the Open response configuration icon.
- In the Response configuration dialog for the Insurance Quote case type, click the Entities extraction tab.
- Click Add mapping.
- In the Entity list, select Carmakeent.
- In the Case property list, select carMake.
- Click Add mapping.
- In the Entity list, select Carmodelent.
- In the Case property list, select carModel.
- Click Submit.
- Build the model and refresh the updated entity information in the chatbot by clicking Build model.
Testing changes in the chatbot
After creating new entities, mapping the extraction of the entities to case properties, and rebuilding the model, you can test your changes to ensure that the chatbot responds correctly. In the preview console, verify that the chatbot automatically extracts the information about the car make and model that you mapped to the entities, and saves this information in the related Insurance Quote case properties.
When you provide the car make and model in a request for information about car insurance, the chatbot automatically skips the first two questions for which it recognized the answer and assigns the details to the Insurance Quote case properties.
- In the preview console, click Reset.
- Enter the same text as in step 1 of the Configuring and mapping entities to case type properties
section to request an insurance quote.
- Display more information about the conversation and the case by turning on the Show analysis switch.
You made configuration changes to the chatbot algorithm, rebuilt the text analytics model, and successfully verified that the system improves how it responds to user requests for car insurance quotes. If the chatbot detects the correct topic and entities in user input, the system automatically skips the first two questions that it recognized the answer for, and then assigns the details to the Insurance Quote case properties.