createModelFromText
Create a model that can learn how to accurately predict a label from given text (train model).
For example: Consider a table with two columns: list of all cities in a country (comma separated string) and country name. Create a model that can identify country name from a list of cities. The list of the cities in the prediction can be incomplete compared to the training list. For instance, adding "Cleveland, London, Paris, Venice" would predict "USA" because cities with all four of the names are found in the USA in addition to other countries.
Cleveland, London => USA, England
Paris => France, USA(CA)
Venice => Italy, USA(FL)
Operator Usage in Easy Mode
- Click + on the parent node.
- Enter Create Model from Text operator in the search field and select the operator from the Results to open the operator form.
- In the Table drop-down, enter or select the table to create a model.
- In the Model Name field, enter the name of the model to store it in a particular location.
- In the Label Column Name drop-down, select a column name that contains the labels. The drop-down list displays the data based on the selected table name.
- Optional. In the Column Names, click Add More to add the list of column names used to create the model.
- Click Run to view the result.
- Click Save to add the operator to the playbook.
- Click Cancel to discard the operator form.
Usage Details
LQL Command
createModelFromText(table, outputModelName, label, listOfColumns)
Input
table
: Input table to train a model.
outputModelName
: Model name to store trained model. Trained models are not displayed in the UI, so remember the name of the model that was created. If a model with the same name exists, this operation overwrites it without notification.
label
: Label column name.
listOfColumns
: List of columns to train a model to learn label, such as "col1", "col2", "col3".
Output
A message saying the model (name) was successfully created.
Example
Input
id | title | description | label |
---|---|---|---|
1 | a b c d | e f g h i | spam |
1 | a x y d u | u v e g x y | ham |
LQL command
createModelFromText(table,"scoreEmail", "label", "title", "description")
Output
If the operation is successful, a message that the model was successfully created. To use in prediction, see the checkout predictLabelFromText operator.