LinkedIn
Copied!

Table of Contents

Importing topics to text predictions

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.

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 Outcomes Topics .

  3. In the Language field, select the language for which you want to add a topic.

    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.

    A topic file for a machine learning model can contain the following topics and training data:
    content result type
    I want to book a flight ticket action > book ticket
    What is the price for a ticket from London to Dubai action > book ticket
    I want to take a trip to Tokyo action > book ticket test
    I want to cancel my ticket action > cancel ticket
    can you help me cancel my reservation action > cancel ticket
    cancel PNR number 27382 action > cancel ticket test

    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
  8. Click Upload.

    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.

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

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 Collaboration Center to ask questions, engage in discussions, share ideas, and help others.