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.
- Open the text prediction:
- In the navigation pane of App Studio, click Channels.
- In the Current channel interfaces section, click the icon that represents a channel for which you want to configure the text prediction.
- On the channel configuration page, click the Behavior tab, and then click Open text prediction.
- In the Prediction workspace, click .
- 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.
- Click Import, and then select one of the following
- To upload topics with their respective training data, click Machine learning.
- To upload topics (taxonomy) with their respective keywords, click Keywords.
- In the Topic model field, select the topic model to which you want to add the topics.
- If you do not have a topic file ready, create a topic file by using the
- In the Topic template field, click Download to download the topic template.
- 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: 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.
- Add the topic file:
- Click Choose File, and then browse for the topic file.
- Select the file, and then click Open.
- 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.
- In the prediction workspace, click Save to save your changes.
To learn how to import topics to a text prediction, see the following video:
Previous topic Creating topics in text predictions Next topic Adding entities to text predictions