createModelFromText

Predict label from text (train model)

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

  1. Click + on the parent node.
  2. Enter Create Model from Text operator in the search field and select the operator from the Results to open the operator form.
  3. In the Table drop-down, enter or select the table to create a model.
  4. In the Model Name field, enter the name of the model to store it in a particular location.
  5. 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.
  6. Optional. In the Column Names, click Add More to add the list of column names used to create the model.
  7. Click Run to view the result.
  8. Click Save to add the operator to the playbook.
  9. Click Cancel to discard the operator form.

Usage Details

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
1a b c de f g h ispam
1a x y d uu v e g x yham
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.


© 2017-2021 LogicHub®. All Rights Reserved.