You can use general model training plug-ins to automatically train models, optimize hyperparameters, and evaluate models in scenarios in which matching recalls are required. You need only to configure a matching strategy and a filtering strategy to obtain a deeply optimized model. General model training plug-ins are highly compatible with Elastic Algorithm Service (EAS) of Machine Learning Platform for AI (PAI). You can use the plug-ins to deploy a tested model as a RESTful service with ease. This topic describes how to use general model training plug-ins to implement matching recalls in detail.

Prerequisites

  • AutoLearning is authorized to access Object Storage Service (OSS). For more information, see OSS authorization.
  • A Tablestore instance is created. For more information, see Create instances.
  • The matching strategy and filtering strategy of your matching recall solution are stored in Tablestore. For more information, see Create tables.

Procedure

To use general model training plug-ins to implement matching recalls, perform the following steps:
  1. Step 1: Create a model instance

    Create a model instance for matching recalls.

  2. Step 2: Configure a matching strategy

    Configure a matching strategy to reduce the number of recommendation candidates by using algorithms.

  3. Step 3: Configure a filtering strategy

    Configure a filtering strategy. In this step, specific business strategies are configured to further reduce the number of recommendation candidates. AutoLearning automatically deletes the duplicate recommendation candidates.

  4. Step 4: Deploy and test the model instance

    AutoLearning automatically deploys the matching recall solution as an online service based on the matching strategy and filtering strategy that are configured. After the service is tested, the solution can be deployed to EAS.

Step 1: Create a model instance

  1. Go to the General Purpose Model Training page.
    1. Log on to the Machine Learning Platform for AI (PAI) console.
    2. In the left-side navigation pane, choose AI Industry Plug-In > General Purpose Model Training.
  2. On the General Purpose Model Training page, click Create Instance.
  3. In the Create Instance panel, set the parameters.
    Parameter Description
    Instance type The type of the instance for model training. Set the Instance type parameter to Rec-Matching System. Valid values:
    • Image Classification
    • Rec-Matching System
    Instance name The name of the instance. The name must be 1 to 20 characters in length and can contain letters, underscores (_), and digits. It must start with a letter.
    Example Description The description of the instance. The description helps you distinguish between different instances.
    Storage dependency The storage service used by the matching recall feature. To use this feature, you must store your training data in Tablestore. For more information, see Create tables. If AutoLearning is not authorized to access Tablestore within your Alibaba Cloud account, click Authorize Now below the field.
    Instance binding The Tablestore instance used to store your training data. Select the created Tablestore instance.
  4. Click Confirm.

Step 2: Configure a matching strategy

  1. On the General Purpose Model Training page, find the model instance that you created and click Open in the Operation column.
  2. In the Matching strategy configuration step, configure a matching strategy.
    The following matching strategies are supported. You can select one or more matching strategies based on your requirements.
    • Collaborative filtering recall: a classic matching strategy that generates matching results based on the correlation between customers and products.
    • Semantic recall: a matching strategy that is widely used in news recommendation based on what topics the audience are interested in.
    • Self-definition recall: a matching strategy that generates user-item correlations based on actual requirements.
    The following table describes the parameters of each matching strategy.
    Tab Parameter Description
    Collaborative Filtering Recall Strategy name The custom name of the strategy. The name must be 1 to 20 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.
    User-Item table The Tablestore table that stores user-item correlations for the matching strategy. Move the pointer over the question mark icon next to User-Item table to view the description of the table schema.
    Item-Item table The Tablestore table that stores data between items for the matching strategy. Move the pointer over the question mark icon next to Item-Item table to view the description of the table schema.
    Matching number The number of items to be returned based on the matching strategy. The value must be a positive integer. If the actual number of returned items is smaller than the value of the Matching number parameter, the actual number of returned items prevails.
    Semantic Recall Strategy name The custom name of the strategy. The name must be 1 to 20 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.
    User-Topic table The Tablestore table that stores user-topic correlations for the matching strategy. Move the pointer over the question mark icon next to User-Topic table to view the description of the table schema.
    Topic-Item table The Tablestore table that stores topic-item correlations for the matching strategy. Move the pointer over the question mark icon next to Topic-Item table to view the description of the table schema.
    Matching number The number of items to be returned based on the matching strategy. The value must be a positive integer. If the actual number of returned items is smaller than the value of the Matching number parameter, the actual number of returned items prevails.
    Self-Definition Recall Strategy Strategy name The custom name of the strategy. The name must be 1 to 20 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.
    Item table The Tablestore table for the matching strategy. Move the pointer over the question mark icon next to Item table to view the description of the table schema.
    Matching number The number of items to be returned based on the matching strategy. The value must be a positive integer. If the actual number of returned items is smaller than the value of the Matching number parameter, the actual number of returned items prevails.
  3. Click Add to strategy list. Then, the configured strategy is added to the Added strategies list on the right.
  4. Optional:Repeat the preceding steps to configure more matching strategies.
  5. Click Next step.

Step 3: Configure a filtering strategy

  1. In the Data filter strategy configuration step, set the parameters.
    The following filtering strategies are supported. You can select one or more filtering strategies based on your requirements.
    • A filtering strategy based on historical exposure data.

      This filtering strategy filters out the data that has been recommended. The matching recall solution in PAI records the products that have been recommended to each customer and filters out these products.

    • A filtering strategy based on user-item correlations.
      If a specified user is recalled, the items that correspond to the user are filtered out. The following figure shows the table schema. Table schema
    • A filtering strategy based on items.
      If the ID of an item is recalled, the item is filtered out. The following figure shows the table schema. Table schema
    The following table describes the parameters of each filtering strategy.
    Tab Parameter Description
    Historical exposure data filtering Strategy configuration Strategy name The custom name of the strategy. The name must be 1 to 20 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.
    User-Item table The Tablestore table that stores user-item correlations for the filtering strategy. Move the pointer over the question mark icon next to User-Item table to view the description of the table schema.
    Custom filtering strategy (U-I filtering) Strategy configuration Strategy name The custom name of the strategy. The name must be 1 to 20 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.
    User-Item table The Tablestore table that stores user-item correlations for the filtering strategy. Move the pointer over the question mark icon next to User-Item table to view the description of the table schema.
    Custom filtering strategy (I strategy filtering)-I filtering Strategy configuration Strategy name The custom name of the strategy. The name must be 1 to 20 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.
    Item table The Tablestore table for the filtering strategy. Move the pointer over the question mark icon next to Item table to view the description of the table schema.
  2. Click Add to strategy list. Then, the configured strategy is added to the Added strategies list on the right.
  3. Optional:Repeat the preceding steps to configure more filtering strategies.
  4. Click Deploy and test.

Step 4: Deploy and test the model instance

  1. In the Deployment confirmation message, check the configured matching and filtering strategies. Then, click OK.
  2. In the Test Module section, set the UserID and Recommendation results parameters. 1
  3. Click Send test request.
  4. In the Debug information section, view the return results. If the results meet your requirements, click Deploy to EAS to deploy the model instance to EAS as a RESTful service.
    For more information about how to deploy a model instance to EAS, see Upload and deploy models in the console.
    Note You are charged for the deployment of a model instance to EAS. For more information, see Billing of EAS.