Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Building an IVA for Web Chatbot in the preview console

Updated on August 21, 2019

Develop a Pega Intelligent Virtual Assistant™ (IVA) for Web Chatbot by simulating conversations in the preview console. Analyze responses to your input to make instant changes in the chatbot configuration, validate the updates, and build the model, so that the chatbot is more responsive in the future.

In this tutorial, learn how to train and build the model to enhance the text analyzer engine that is used by the chatbot, and to improve how the model responds based on artificial intelligence algorithms.

Use case

This tutorial covers the following topics:

Note: This walkthrough takes approximately 15 minutes to complete.

Before you begin

In a sample Pega Platform™ application that you want to use as the testing environment for this tutorial, perform the following actions:

  1. Create the Insurance Quote case type related to a car insurance quote. Perform the following:
    Thumbnail
    Case types explorer
    • Add data types to represent information for a car insurance quote: the make, model, and VIN number.
    • Enable the Web Chatbot channel specific conversations for a stage of the Insurance Quote case type.
      Thumbnail
      Stage configuration for the Insurance Quote case type
    • Configure conversation questions for a stage process of the Insurance Quote case type by adding three simple questions for data types about the make, model, and VIN number of a car.
       
      Thumbnail
      Sample questions for the Insurance Quote case type
  2. Configure a Web Chatbot channel with the following settings:
    Thumbnail
    Sample create case command for a case type
    • After you configure this setting, the text analyzer engine detects when you enter a request for an insurance quote in the chatbot, and creates the Insurance Quote case in the system. As a response, the bot asks the three insurance questions about the make, model, and VIN number of the car.
    • In the behavior configuration section of the channel, enable the advanced text analyzer configuration.
    • This setting configures the chatbot to use the text analyzer that is generated by Pega NLP, to interpret text in the context of a case and outside of a case content.
      Thumbnail
      Enabled text analyzer types

Configuring topics for user input

Configure topics for user input by simulating a conversation in the preview console. You can associate topics with the user input that the chatbot does not recognize correctly, and add more examples of similar user input to improve future responses. After updating the model with samples for the insurance topic, the chatbot automatically starts the Insurance Quote case when the user requests information about a car insurance quote.

  1. Log in to Pega Platform.
  2. In Dev Studio, click the name of your application, and click Channels and interfaces.
  3. Click the name of the Web Chatbot channel that includes the Insurance Quote case type that is tied to a command.
  4. Click the Configuration tab.
  5. In the preview console, enter a command asking for a car insurance quote, for example:
    Give me a car quote please
    Thumbnail
    Sample car quote question
    Notice that the chatbot cannot recognize a request for a car insurance quote because no topic is associated with the entered text.
  6. Associate the insurance topic with your input:
    1. Click Define topic.
    2. In the Topic field, press the Down Arrow key, and then select the insurance topic.
    3. In the field below the topic name, enter sample user input for the insurance topic, for example:
      I need car quote
    4. Click + Add example and add additional sample user input for the insurance topic, for example:
      How can I get car quote?
      Thumbnail
      Associating user input with a topic
    5. Click Submit.
      Thumbnail
      Sample topic that is associated with user input
      Notice that the insurance topic is now associated with the user input that appears above the topic name.
  7. Rebuild the model by clicking Build model.
    The chatbot learns how to respond to this user input and the additional two examples that you provided. To further ehance the text analyzer engine and improve the chatbot responses, add more examples of the same user input and rebuild the model a few more times.

Configuring entities and mapping extraction information

Configure IVA for Web Chatbot to obtain correct entities from user input when an insurance quote is required, by simulating a conversation in the preview console. When you enter text and receive replies in the preview console, you can define the missing entities for the user input.

In this example, 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 are defined for the Insurance Quote case, respectively.

  1. In the preview console enter a request for an insurance quote, for example:
    I would like to obtain an insurance quote for my Ford Mustang GT
    Thumbnail
    Sample request for an insurance quote
    Based on the insurance keyword, the chatbot correctly associates the text with the Insurance Quote case type, starts a case, and responds by asking the first question about the make of the car. The #insurance label below your request represents the topic, while the vertical line indicates the start of the I-60 case.
    If the correct topic is already associated with your input, you can improve how the chat responds in the model in the future by clicking the Like icon next to the topic name, and then rebuilding the model.
  2. Display more information about the conversation and the case by turning on the Show analysis switch.
    Thumbnail
    Sample user input analysis
    The analysis shows that the sentiment of the text that you entered was classified as neutral and that the insurance topic guess had a confidence of 97 percent. The chatbot did not detect any entities in your input, even though the text included the make of a car, Ford, and the model of a car, Mustang GT.
  3. Associate new entities with words in the text that you entered:
    1. Associate Ford with a new entity for the make of the car:
      1. Select and right-click Ford, and then click New entity.
      2. In the Entity name field, enter: #Carmakeent
      3. Click Submit.
    2. Associate Mustang GT with a new entity for the model of the car:
      1. Select and right-click Mustang GT, and then click New entity.
      2. In the Entity name field, enter: #Carmodelent
      3. Click Submit.
        Thumbnail
        Sample user input analysis with mapped entities
        The two entity types that you created are mapped to the make and model of the car in the text, Ford and Mustang GT, respectively.
  4. Provide the mapping extraction to case properties for the two new entities:
    1. In the Create case section, click the Open response configuration icon.
    2. In the Response configuration dialog for the Insurance Quote case type, click the Entities extraction tab.
    3. Click + Add mapping.
    4. In the Entity list, click Carmakeent.
    5. In the Case property list, click carMake.
    6. Click + Add mapping.
    7. In the Entity list, click Carmodelent.
    8. In the Case property list, click carModel.
      Thumbnail
      Response configuration dialog for a case type command
    9. Click Submit.
  5. Build the model and refresh the updated entity information in the system by clicking Build model.

Testing changes in the chatbot

After creating new entities, providing the mapping 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 information about the car make and model that you enter is automatically extracted to entities and mapped to the 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 it recognized the answer for and assigns details to the Insurance Quote case properties.

  1. In the preview console, click Reset.
  2. Enter the same text as in step 1 of the previous section to request an insurance quote:
    I would like to obtain an insurance quote for my Ford Mustang GT
    Thumbnail
    Sample insurance quote
    The chatbot correctly associates the text with the Insurance Quote case type, and starts a case. However, this time the bot asks only the third question about the VIN number of the car.
  3. Display more information about the conversation and the case by turning on the Show analysis switch.
    Thumbnail
    Sample user input analysis with mapped entities and skipped questions
    The first and the second question about the make and model of the car are greyed out because they were skipped. The reason behind this action is that the #Carmakent and #Carmodelent entities were successfully extracted from your input, and automatically mapped to the .carMake and .CarModel case properties, respectively.

Conclusions

You have made configuration changes to the chatbot algorithm, rebuilt the model and successfully verified that IVA for Web Chatbot improves how it responds to user input for an insurance quote.

Next steps

When you successfully test all conversations with the IVA for Web Chatbot, to ensure that the bot responds correctly to user input, move it to the production environment.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us