Table of Contents

Article

Exploring natural language processing with NLP Sample on Pega 7.4

NLP Sample provides a set of tools and example use cases for you to explore and learn about natural language processing. After you become comfortable with the default demonstration tools, you can create custom text analyzers that support your business goal. For example, you can automate the analysis of customer tweets so that only certain tweets are forwarded to a customer service representative, who reviews them and responds.

  1. Installing NLP Sample
  2. Exploring text analytics features
  3. Using natural language processing in the application context
  4. Advanced: Updating models with feedback data
  5. Next steps

Installing NLP Sample

Install NLP Sample by importing to your application the archive file that contains the application ruleset.

  1. Download the icon_zip.gifNLPSample7.4 archive file.
  2. Import the archive file to your application.
  3. Log in to Pega® Platform by entering the following credentials:
    • user: admin@nlpsample
    • password: rules
      To access NLP Sample through your operator account, add the NLPSample:Administrators access group to your account.
  4. In Designer Studio, click Launch web interface > NLP Sample to open the application.

Exploring text analytics features

Become familiar with natural language processing on Pega Platform and explore the text categorization, text extraction, and language detection by applying a Text Analyzer rule to a piece of text. Before you configure custom Text Analyzers, start with the demonstrative instance of the Text Analyzer rule in NLP Sample (the Example text analyzer).

  1. To open NLP Sample, in Designer Studio, click Launch web interface > NLP Sample.
  2. In NLP Sample, click Try Text Analytics.
  3. Click the Feature tab.
  4. In the Feature field, select from the following options:
    • Text categorization – Perform one of the following types of categorization tasks:
      • Topic detection – Detect the talking point of a piece of text by classifying that text into one or more predefined categories. For more information, see Topic detection.
      • Sentiment detection – Determine whether a piece of text carries negative, positive, or neutral meaning. For more information, see Sentiment analysis.
      • Intent detection – Detect the purpose of a piece of text, for example, to discover whether it is a complaint, request for information, a threat of churn, and so on. For more information, see Intent analysis.
    • Text extraction – Perform one of the following text extraction tasks:
      • Entity extraction – Detect and classify named entities into predefined categories, for example, names of people, locations, organizations, and so on. Each entity type is associated with a unique icon and color when it is highlighted in the input text.
      • Auto-tagging extraction – Mark the most important entities that define a piece of text.

        For more information, see Text extraction.

  5. Configure the input for analysis by expanding the Configure input list and configuring the following fields:

    • Text analyzer – Select one of the following Text Analyzer rules:
      • Example text analyzer – Use the default Text Analyzer rule (recommended).
      • Custom text analyzer – Select a custom Text Analyzer rule by specifying that rule's applicable class and name.
    • Only for topic detection: Taxonomy – Select a use case for topic detection.

      A taxonomy contains a list of categories into which you can classify input text. Each taxonomy that you can select contains a unique set of categories that correspond to a specific type of use case, business type, or industry area, for example, banking or customer support. To learn about taxonomies in Pega Platform, see Requirements and best practices for creating a taxonomy for rule-based classification analysis.

    • Input type – Provide a text sample to analyze. You can select the following sources of input:
      • Input Text – Select one of the default text samples.
      • Input URL – Load text from an external URL.
  6. Click Try it to analyze text.

You discovered the natural processing capabilities of Pega Platform by applying different types of analysis on various text samples.

Using natural language processing in the application context

Explore the implementation of natural language processing in Pega Platform by specifying the routing logic and case types to create when the Text Analyzer classifies text as part of a specific category, detects a sentiment type, a particular intent, and so on.

  1. In Designer Studio, click Launch web interface > NLP Sample to open NLP Sample.
  2. Click Try Text Analytics.
  3. Click the Application tab.
  4. In the Data source field, click Choose file and select an .XLS or .XLSX file that contains text input for analysis.
    Click Download template to obtain sample records and view the file format that is required by NLP Sample.
  5. Expand the Configure text analyzer rule list.
  6. Perform one of the following actions:
    • To select the demonstrative instance of the Text Analyzer rule, perform the following actions:
      1. In the Text analyzer field, select Example text analyzer.
      2. In the Taxonomy field, select a taxonomy to apply on the input data.
    • To select a custom text analyzer, in the Text analyzer field, select Custom text analyzer and specify the applicable class and the name of that Text Analyzer.
  7. Configure the cases that are created when input text is categorized into one or more topics by performing the following actions:

    Configuring case creation

    Configuring case creation based on the detected categories

    1. In the Category field, press the Down Arrow key and select a topic (category).
    2. In the Case type, field, press the Down Arrow key and select a case type.

      This case type is created when the Text Analyzer classifies a piece of text as belonging to the corresponding topic.

    3. Optional: To create more topic and case type pairings, click Add.
  8. Configure the conditions for case creation and routing by performing the following actions:

    1. In the Routing logic section, click the Add icon.
    2. Select a group or a single operator to whom to route the case.

      Configuring case assignment

      Configuring case assignment in NLP Sample

    3. Click the Expand icon to open the section for creating conditions.
    4. Click Add condition.
    5. Configure the condition logic for routing cases.

      Case routing full configuration

      Sample case routing logic in NLP Sample

  9. Click Start.

You can view the results of the case creation and routing on the right in the Reports and Cases routed sections.

Routing results

Case routing results

You can access the cases that you created with NLP Sample in the Case Manager portal, where you can act on each case, as shown in the following example:

NLP Sample cases in Case Manager

An NLP Sample case in the Case Manager portal

You created an application logic in which, based on the output of natural language processing of a piece of text, you created a corresponding case that was routed to an appropriate work party to be acted on. You can now use natural language processing to derive structured business intelligence and further process it in the context of Pega Platform in accordance with the Next-Best-Action principle.

Advanced: Updating models with feedback data

You can provide feedback on any machine outcome of natural language processing by using the pxCaptureFeedback activity in NLP Sample. When a model incorrectly classifies a piece of text, you can provide a correct NLP outcome which is stored for that model. If at least 10 corrected records are gathered, you can feed these records to that model as training data, so that next time a similar record is processed, the accuracy of classification improves.

  1. Log on to NLP Sample as admin@nlpsample.
  2. In Designer Studio, click Launch web interface > Analytics Center.
  3. For a model that you want to test, click the More icon and select Test.
  4. Paste the test phrase in the Sample text box and click Test.
  5. View the text analytics outcome.
  6. Click Update to provide feedback to the model. For example, you can change the outcome of sentiment analysis, as shown in the following example:

    Updating records

    Providing feedback on text analytics outcome

  7. Click Submit. You must provide at least 10 feedback items before you can update a model.
  8. To start the model update wizard for the model to which you provided feedback, click the More icon and select Update.
  9. In the Source selection step of the model update wizard, make sure that the Do you want to add feedback? checkbox is selected and click Next.
  10. Follow the steps of the wizard. For more information, see Text analytics.

Analytics Center updating a model

Updating a model in Analytics Center

Next steps

Published May 8, 2018 — Updated June 25, 2018


77% found this useful

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.