Skip to main content


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

Adding entities to text predictions

Updated on July 5, 2022

Configure your text prediction to detect entities in the text, such as names of people, organizations, addresses, emails, phone numbers, and postal codes. You can use entities to populate case properties automatically from incoming messages in your conversational channels.

  1. Open the text prediction:
    1. In the navigation pane of App Studio, click Channels.
    2. In the Current channel interfaces section, click the icon that represents a channel for which you want to configure the text prediction.
    3. On the channel configuration page, click the Behavior tab, and then click Open text prediction.
  2. For the prediction that you want to configure, click Open prediction.
  3. In the Prediction workspace, click OutcomesEntities.
  4. In the Language field, select the language for which you want to add an entity.
    Result: The change of language refreshes the list of available entities. The list now displays the entities for the selected language.
  5. Click Create entity, and then perform one of the following actions:
    ChoicesActions
    Create an entity
    1. Select Create new entity, and then click Next.
    2. In the New entity window, in the Entity name field, enter the name for the new entity.
    3. In the Entity model field, select an entity extraction model with which you want to associate the new entity.
      You can also create an entity extraction model by selecting Create new, and then providing a name for the model.
    4. Click Create.
    Choose an entity from the list
    1. Select Choose existing entity, and then click Next.
    2. From the list of available entities, select one or more entities, and then click Add.
      Result: The selected entity type is added to the list.
    3. To configure the entity, click the Properties icon next to the entity.
  6. Configure the entity by using one of the following methods:
    ChoicesActions
    Machine learning
    1. On the Machine learning tab, click Add training data.
    2. In the Text window, enter a text sample to use as training data for the entity extraction model, and then click Add.
      Result: The text sample is added to the list of pending training data.
    3. Add multiple training data by repeating steps 6.a and 6.b.
    4. Click each training data in the list, and then review the results of text analysis.
    5. If the model does not detect the entity in the text or assigns an incorrect entity type to the entity, double-click and then right-click the entity in the text, and then select the correct entity type from the list.
    6. Add training data to train the entity extraction model that is associated with this entity type.
      Tip: Machine learning models for detecting entities work best when entities do not follow any specific pattern but appear in a specific context or are surrounded by certain words or phrases. For example, in the sentence I work at uPlusTelco, a machine learning model might classify uPlusTelco as an organization with greater confidence because of the verb work and the preposition at, which often appear together with organization names.
      Identifying flight number entities in text samples
      Selecting a flight number entity for the number in a text sample
    RUTA
    1. Click RUTA, and then select the Enable RUTA check box.
    2. Use the Ruta language to define the detection pattern.
      Tip:

      Use this method to detect entity types whose structure matches a certain pattern. For example, you can use a Ruta script to detect strings that contain the @ symbol and the .com sub-string as email_address. In addition, you can use this detection method to detect entity types through the token length (for example, postal_code or telephone_number), or to extract entities from a word or token. You can select and modify any of the templates that are provided.

      You can also combine entity types through a Ruta script. For example, you can combine an entity type for currency ($) and number (10) to get the entity money whenever the two entities appear together. When you reference another entity type in a Ruta script, always use lowercase, irrespective of the original configuration. For example, EntityType{FEATURE("entityType", "amount")}

      The following figure shows a Ruta script that detects letters or words followed by numbers, which you can use to recognize flight numbers, such as AE3123.

      Adding a Ruta script for detecting flight numbers
      A Ruta script that recognizes letters followed by numbers
    Keywords
    1. Click Keywords, and then select the Enable keywords check box.
    2. To add a keyword manually, click Add keyword, and then enter the keyword and its synonyms.
    3. To create a list of keywords by uploading a file, click Choose File, browse for the file, and then click Open.
      If you do not have a topic file ready, you can create it by using the keyword template.
    Tip: Use this detection method when the entity type that you want to extract is an umbrella term for a finite number of associated terms or phrases that do not follow any specific pattern. For example, you can define and associate the city entity type with the keyword New York, with such synonyms as NY, NYC, Big Apple, The Five Boroughs.
    Adding keywords for an airport entity type
    A keyword for Birmingham Shuttlesworth International Airport includes the synonym BHM
  7. Click Save.
  8. In the prediction workspace, click Save to save your changes.
For example:

The following video shows a sample entity configuration using machine learning:

The following video shows a sample entity configuration using keywords:

What to do next: Build your models to train them with the new training data. For more information, see Building models in text predictions.

    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