Skip to main content

Creating a case classification prediction using NLP

4 Tasks

30 mins

Pega Platform '24.1
Visible to: All users
Beginner Pega Platform '24.1 English

Scenario

U+ Insurance is currently handling a high volume of car insurance claims. At present, experts review all cases and manually categorize and route them based on the description provided by the customer. It is a labor-intensive process that leads to frequent re-assignments and delays.

The company aims to streamline and enhance the insurance claims process. To achieve this, the business has decided to implement Case Classification in Pega Process AI™, which makes use of Natural Language Processing. This technology will automatically identify the accident category based on the case description provided by the customer in their insurance claim, and route it to a correct work queue without human action.

As an application developer, your role is to enable the AI case classification prediction and test it. This involves creating a new accident category field within the case and defining the topics. Then, a data scientist will use the provided training data file to train and build the models in Prediction Studio.

To confirm your work, as an application developer validate the functionality of the automatic AI accident category prediction and case routing in the Process AI Example Application.

Steps:

Use the following credentials to log in to the exercise system:

Role User name Password
Application Developer ApplicationDeveloper rules
Data Scientist DataScientist rules

Your assignment consists of the following tasks:

Task 1: Enable and verify the accident category process

As an application developer, add the new Accident Category picklist field and include following choices: Property Damage, Bodily Injury, Uninsured or Underinsured, and Other. Then, run the case type and evaluate the existing process. Note that the prediction feature is not yet active. At this point, the category still needs to be manually determined.

Task 2: Enable AI to predict accident category

In the case type Data Model, in the Accident Category picklist field, activate the AI text prediction based on Case description. The system automatically creates a new Prediction in Prediction Studio.

Task 3: Train the text Prediction

As a data scientist, download the training data file AccidentCategoryTrainingData.xlsx, and train the models in the automatically created Prediction. Manually inspect sample records in the training data during the building process to gain an understanding of the dataset. Subsequently, test the text prediction in Prediction Studio and confirm that it correctly detects the topic of each message. Use the input text provided in the following table:

Input text

Topic

While waiting at a stop sign, I was rear-ended by a speeding driver. The impact caused whiplash and a herniated disc in my spine. I sought medical treatment, including physical therapy and medication. This claim is to cover my medical bills, lost wages, and the long-term effects of the bodily injuries sustained in the accident.

Bodily Injury

The road was covered in snow, causing my car to slide and collide with the traffic light. Regrettably, an uninsured pedestrian was struck and suffered considerable injuries. This claim is being submitted to address the costs of property damage, medical bills, and the overall impact on the pedestrian's welfare resulting from the incident.

Uninsured or Underinsured

While reversing out of a parking spot, I accidentally hit a concrete pillar, causing damage to the rear bumper and tail lights of my car. The impact resulted in noticeable dents and scratches. I am filing this claim to cover the repair costs and restore my car to its pre-accident condition.

Property Damage

Task 4: Test the AI based accident category process

As an Application Developer, create a new Claims Case for each Persona and validate the functionality of the automatic AI accident category prediction. Validate the detected category using the following table:

Persona

Category

Mike Gonzalez

Bodily Injury

JoAnne Biggs

Uninsured or Underinsured

Sara Connor

Property Damage

Finally, verify the intelligent case queue routing.

 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Challenge Walkthrough

Detailed Tasks

1 Enable and verify the accident category process

  1. On the exercise system landing page, click Launch Pega Infinity™ to log in to App Studio.
  2. Log in as an Application Developer:
    1. In the User name field, enter ApplicationDeveloper.
    2. In the Password field, enter rules.
  3. On the application overview page, in the Case types section, click Claims Case to open the case type.
  4. Click the Data Model tab.
  5. Click Add field to start the new field configuration.
    click add field
    1. In the Add field to Claims Case window, in the Field name field, enter Accident Category.
    2. Expand the Type drop-down menu and select Picklist.
    3. In the Choices section, click Add choice, and in the empty field, enter Property Damage.
    4. Repeat the previous step for Bodily Injury, Uninsured or Underinsured, and Other.
    5. Click Submit to add the new field to the Data Model.
      configure field window 1
  6. In the upper-right corner, click Save and run to test the case type.
  7. In the Process AI Example App, in the New Claims Case window, click the Persona icon.
    new claims case 1
  8. Select Mike Gonzalez and click Submit.
    Note: The system automatically populates the test case details for Mike Gonzalez.
  1. Click Submit to progress the case.
  2. Scroll down to the Accident category field. Note that the system incorrectly selects Property Damage.
    default category
    Note: The system populates the Accident category field with the first entered Choice option during the Accident Category field configuration. Agents must manually choose the Accident category as the AI prediction feature is not yet activated.
  1. Click Cancel, and in the Close case popup, click Delete to cancel case creation.
  2. In the upper-right corner of App Studio, click Exit Preview to close the Process AI Example App.

2 Enable AI to predict accident category

  1. In the Data Model tab, at the end of the Accident Category row, click the Gear icon to open the Configure field window.
  2. In the Configure field window, expand the Advanced section.
  3. Select the Use AI to predict the value of this field checkbox to enable the AI prediction.
  4. In the Input text for AI analysis field, select Case description.
    select case description
  5. Click Submit to save the new field configuration.
    Note: The system automatically creates the new Prediction in Prediction Studio when the new field configuration is saved.
  1. In the upper-right corner, click Save to save the case configuration.
  2. In the lower-left corner, click the AD user icon and then select Log off to log out of App Studio.

3 Train the text prediction

  1. Log in to Prediction Studio as a Data Scientist:
    1. In the User name field, enter DataScientist.
    2. In the Password field, enter rules.
  2. On the Prediction Studio landing page, in the Accident Category prediction tile, click Open prediction to access the prediction configuration page.
    Note: The topics in the prediction reflect Choices set in the Accident Category field.
  1. Click Import to add training data.
    click import 1
  2. Download the AccidentCategoryTrainingData.xlsx file that contains the training data and open it.
  3. Examine the training data file. Note that every record matches a specific topic.
    training dataset
  4. In the Upload your topic file (CSV, XLS, XLSX) section, click Choose File, select AccidentCategoryTrainingData.xlsx file, and then click Upload.
  5. Click the Training data tab.
  6. In the upper-right corner, click Build to build the models.
  7. In the Build models popup window, select Accident Category model, and click Build to begin the building process.
    build the models
  8. The building process may take several minutes. During that time, randomly pick a training data record from the list and familiarize with the structure of the training data.
    examine the training records
  9. After approximately 2 minutes, in the upper-right corner, click Actions > Refresh.
  10. Click View build report.
    view build report
  11. In the Build report popup window, notice the COMPLETED status and close the window.
  12. In the upper-right corner, click Test to test the new text prediction.
  13. In the Test prediction window, in the Text field, paste the input text provided in the following table, and click Test to test the text prediction.

    Input text

    Topic

    While waiting at a stop sign, I was rear-ended by a speeding driver. The impact caused whiplash and a herniated disc in my spine. I sought medical treatment, including physical therapy and medication. This claim is to cover my medical bills, lost wages, and the long-term effects of the bodily injuries sustained in the accident.

    Bodily Injury

    The road was covered in snow, causing my car to slide and collide with the traffic light. Regrettably, an uninsured pedestrian was struck and suffered considerable injuries. This claim is being submitted to address the costs of property damage, medical bills, and the overall impact on the pedestrian's welfare resulting from the incident.

    Uninsured or Underinsured

    While reversing out of a parking spot, I accidentally hit a concrete pillar, causing damage to the rear bumper and tail lights of my car. The impact resulted in noticeable dents and scratches. I am filing this claim to cover the repair costs and restore my car to its pre-accident condition.

    Property Damage

  1. Verify the detected topic for each input text instance.
    injury result
     
    uninsured result
     
    damage result
    Note: During the model building process, the system randomly selects training data records for testing purposes. Due to a relatively small number of training records, this may lead to changes in the confidence scores or even the detected topics in your Pega instance.
  1. Close the Test prediction window.
  2. In the upper-right corner, click Save to save the Prediction configuration.
  3. In the lower-left corner, click the DS user icon and then select Log off to log out of Prediction Studio.

4 Test the AI based accident category process

  1. Log in to App Studio as an Application Developer:
    1. In the User name field, enter ApplicationDeveloper.
    2. In the Password field, enter rules.
  2. In the upper-right corner of App Studio, click Preview to launch the Process AI Example Application.
    click preview 1
    1. Expand the pane on the left and click Create > Claims Case.
      click claims case 1
    2. Click the Persona icon to select the demo persona.
    3. Select Mike Gonzalez, and then click Submit.
    4. Click Submit to progress the case.
    5. Scroll down to the Accident category field. Note that now, the AI correctly predicted the category as Bodily Injury.
      bodily injury correctly recognized
    6. Click Submit to create the case.
    7. Expand the pane on the left and click Home.
    8. Expand the My worklist section, and search for Bodily Injury Queue.
      expand my worklist
    9. Select the Bodily Injury Queue.
      Note: Queues for each topic are pre-configured in your Pega instance.
    10. Notice the newly created claim routed to the correct queue.
      bodily injury queue
    11. Repeat the process for other Personas and observe the results.
      Note: The intelligent routing routes JoAnne's case to the Uninsured Queue, while Sara's case is automatically approved (straight-through processed) due to Case life cycle process flow configuration, and the system does not route it to any queue.

This Challenge is to practice what you learned in the following Module:


Available in the following missions:

If you are having problems with your training, please review the Pega Academy Support FAQs.

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 Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice