Configuring machine learning services

You need to set up machine learning services before you can use the feature.

Before you begin

Ensure you complete the following tasks:
  • Enable machine learning while installing the Persona-based UI and machine learning services are up and running.
  • Add an entry in the Machine Learning Attributes Configuration Lookup table for attribute value-mapping (name of attribute on which machine learning is trained) with the following parameters:
    • Id: Auto generated depending on Container and Service type.
    • Container: The name of the catalog.
    • Service type: The type of service (Categorization, Attributes, and Standardization).
    • Attributes: The comma-separated full path of the attributes on which machine learning model is trained. For many attributes, the sequence should be same as that in the training sheet.
      <Spec_name>/<Attribute_name>
      Example
      Product Specification/Description, Product Specification/Name
  • Add an entry in the Machine Learning Services Threshold and Version Lookup Table to set the value of threshold and version:
    • Id: Auto generated depending on Container and Service type.
    • Container: The name of the catalog.
    • Service type: The type of service (Categorization).
    • Threshold Value: If the confidence score is greater than the threshold value, a category gets mapped.
    • Version: Model version to be used for prediction. By default, the latest version of a model is used if no value is specified for this parameter.
  • Add an entry in the Machine Learning Services Threshold Lookup Table to set the value of threshold over which category should be mapped for item with the following parameters:
    • Id: Auto generated depending on Container and Service type.
    • Container: The name of the catalog.
    • Service type: The type of service (Categorization).
    • Threshold Value: If the confidence score is greater than the threshold value, a category gets mapped.
  • You can add custom code for the workflow by any of the following methods:
    • Upload the class files in the Docstore folder. Generate the class files using the sample ZIP file.
      Sample path that you need to add to the Workflow step > Script editor:
      //script_execution_mode=java_api="japi://uploaded_java_classes:com.ibm.ml.extensions.workflow.MLAutoCategorizationStep.class"
    • Add the JAR file in the class path. Generate the class files using the sample ZIP file. Add the JAR file in the class path.
      Sample path that you need to add to the Workflow step > Script editor:
      //script_execution_mode=java_api="japi://com.ibm.ml.extensions.workflow.MLAutoCategorizationStep.class"

Procedure

To start using machine learning services in your existing workflows or create new workflows, proceed as follows:

  1. Log in to the Admin UI.
  2. Go to Data Model Manager > Workflows > New Workflow.
  3. In the right pane, under the New Workflow section, specify the appropriate values in the Name, Description, Access Control Group, and Container Type fields.
  4. Click Add step and add the following steps, and click Save.
    Step name Description
    Product Standardization Launches machine learning standardization service /mlapi/v1/standardization and standardizes spellings and variations based on description. Add the following script, which runs on exit from the step:
    //script_execution_mode=java_api=
    "japi://com.ibm.ml.extensions.workflow.MLStandardizationStep.class"
    Product Classification Launches machine learning categorization service /mlapi/v1/categorization and categorizes items based on the machine learning response if the confidence score is greater than the threshold value mentioned in the Machine Learning Services Threshold and Version Lookup table.
    Also sets the Suggested Categories and Confidence Score attributes. Add the following script, which runs on exit from the step and item moves to next step Distribute:
    //script_execution_mode=java_api=
    "japi://com.ibm.ml.extensions.workflow.MLAutoCategorizationStep.class"
    Distribute This is an automated step:
    • If item is mapped with a category, item moves to the next step mentioned in the Pass exit value.
    • If category is mapped, an item moves to Product Value, else it moves to Manual Categorization.
    • If no category is mapped to an item, item moves to the next step mentioned in the Fail exit value.
    Add the following script that gets started after exit of this step:
    //script_execution_mode=java_api="japi://com.ibm.ml.extensions.workflow.DistributeStep.class"
    Product Values Launches machine learning attributes service /mlapi/v1/attributes and sets item attributes that are suggested by the machine learning service based on long description. Add the following script, which runs on exit from the step and item moves to next step Approval:
    //script_execution_mode=java_api=
    "japi://com.ibm.ml.extensions.workflow.MLAttributeValueStep.class"
    Manual Categorization Item moves to manual categorization in the following scenarios:
    • If hierarchy returned for category does not exist.
    • If category does not exist in hierarchy.
    • If machine learning response has confidence score below the specified threshold value.

    In manual categorization, you must manually map the category to item. When the category is mapped, the value of the Feedback attribute is set to true this is later used by the retraining job.

    Add the following script that gets started after exit of this step and item moves to next step Approval::
    //script_execution_mode=java_api="japi://com.ibm.ml.extensions.workflow.ManualCategorizationStep.class"
    Approval Approval step for user to review changes that are done during Product Categorization and Product Values steps. Removes the last two occurrences of suggested categories set in Product Categorization step. Add the following script, which runs on exit from the step:
    //script_execution_mode=java_api=
    "japi://com.ibm.ml.extensions.workflow.ApprovalStep.class"