Skip to main content


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

Importing topics to text predictions

Updated on July 5, 2022

Add topics to a topic model behind your text prediction by uploading a file with the topics and their associated training data for machine learning models, or keywords for keyword-based models. Templates are available for download to help you create a topic file more easily.

Tip:

Machine learning is a more effective method of training topic models than keywords. Keywords are Boolean matches that cannot identify the most accurate topic. Do not use keywords in production scenarios.

Keywords influence the behavior of a machine learning model, but they are not exact rules. The Should, Must, and And words act as positive features for matching a text to a topic, while the Not words act as negative features. The training and testing data have the greatest impact on your machine learning model, while keywords have a smaller impact.

  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. In the Prediction workspace, click OutcomesTopics.
  3. In the Language field, select the language for which you want to add a topic.
    Result: The change of language refreshes the list of available topics. The list now displays the topics for the selected language.
  4. Click Import, and then select one of the following options:
    • To upload topics with their respective training data, click Machine learning.
    • To upload topics (taxonomy) with their respective keywords, click Keywords.
  5. In the Topic model field, select the topic model to which you want to add the topics.
  6. If you do not have a topic file ready, create a topic file by using the template:
    1. In the Topic template field, click Download to download the topic template.
    2. Fill in the topic template with the information for the topics that you want to upload.
    For example: A topic file for a machine learning model can contain the following topics and training data:
    contentresulttype
    I want to book a flight ticketaction > book ticket
    What is the price for a ticket from London to Dubaiaction > book ticket
    I want to take a trip to Tokyoaction > book tickettest
    I want to cancel my ticketaction > cancel ticket
    can you help me cancel my reservationaction > cancel ticket
    cancel PNR number 27382action > cancel tickettest

    You can mark some pieces of training data as test data. The system uses the training data to train the model and the test data to test the model and generate its f-score. If you do not specify any test data, the system randomly assigns a portion of the training data as test data, typically, using the 70:30 ratio of training data to test data.

  7. Add the topic file:
    1. Click Choose File, and then browse for the topic file.
    2. Select the file, and then click Open.
    Uploading a topic file with topics and training data
    A file called airlines training data is selected in the upload topics window
  8. Click Upload.
    Result: The topics are added to the Topics list with pending training data. You can use this training data directly for model building.
  9. In the prediction workspace, click Save to save your changes.
For example:

To learn how to import topics to a text prediction, see the following video:

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