Associate a Model via a JSON Configuration

You can manage the JSON configuration of a Coveo Machine Learning (Coveo ML) model association with a query pipeline when you have the required privileges.

Prerequisite for Model Association

Before you can perform a model association, you must create a Coveo ML model.

Access the “Machine Learning” Tab of a Query Pipeline

You must first access the Machine Learning tab of the query pipeline that you want to edit to manage its model associations.

  1. On the Query Pipelines page, click the desired query pipeline, and then in the Action bar, click Edit.

  2. On the query pipeline subpage, ensure the Machine Learning tab is selected.

Create a Model Association via a JSON Configuration

  1. Access the “Machine Learning” tab of the query pipeline with which you want to associate a Coveo ML model.

  2. On the Edit a Model Association subpage, click Action-Menu, and then select Associate a model in JSON view. 3175-associate-json

  3. On the Associate a Model subpage, in JSON view, replace the <Model_ID> placeholder with the actual ID of the model you want to associate with the pipeline (see Reviewing Coveo Machine Learning Model Information).

    Once you accessed the Associate a Model subpage, in JSON view:

    • You can always go back to the Associate a Model subpage in the UI view and use the available options. However, all unsaved changes made in the Associate a Model subpage in JSON view are lost (if any).

    • The Associate a Model subpage in JSON view becomes the default model association view for that model. In other words, the Associate a Model subpage in JSON view is now automatically displayed when you access this model association.

  4. Click Associate Model.

While you can specify model association parameters when creating a model association via a JSON configuration, the leading practice is to first create the association, and then edit its configuration if needed. This allows you to easily tweak the entire configuration of the model association instead of creating it from scratch.

Edit a Model Association via a JSON Configuration

  1. Access the “Machine Learning” tab of the query pipeline with which you want to associate a Coveo ML model.

  2. In the Machine Learning tab, click the desired model, and then in the Action bar, click Edit.

  3. On the Edit a Model Association subpage, click Action-Menu, and then select Switch to JSON view.

  4. On the Switch to JSON view? panel that appears, click Switch to JSON view.

    Switching to the JSON view of the Edit a Model Association subpage cancels unsaved configuration changes made on the Model Association page (if any).

  5. On the Edit a Model Association subpage, in JSON view, tune the JSON model association configuration as needed (see Model Association Parameters).

    Once you accessed the Edit a Model Association subpage, in JSON view:

    • You can always go back to the Edit a Model Association subpage in the UI view and use the available options. However, all unsaved changes made in the Edit a Model Association subpage in JSON view are lost (if any).

    • If you specified non-default parameters in JSON view of the Edit a Model Association subpage, the complete configuration will be reset to the default one when switching back to the UI view of the Edit a Model Association subpage.

    • The Edit a Model Association subpage in JSON view becomes the default model association view for that model. In other words, the Edit a Model Association subpage in JSON view is now automatically displayed when you access this model association.

  6. Click Save.

Code Samples

Automatic Relevance Tuning

The following code sample shows an Automatic Relevance Tuning (ART) model association in JSON:

{
  "position": 1,
  "modelId": "8s5ak9_topclicks_23de8d9d_4e2f_4798_94ee_629cf3dcf292",
  "condition": "be7ccad6-11c8-4734-bf4c-8da7c29deafb",
  "rankingModifier": 300,
  "intelligentTermDetection": true,
  "matchBasicExpression": true,
  "matchAdvancedExpression": true,
  "useAdvancedConfiguration": false
}

For complete information on ART model available association parameters, see ART Model Association Parameters Reference.

Query Suggestions

The following code sample shows a Query Suggestions (QS) model association in JSON:

{
  "position": 1,
  "modelId": "8s5ak9_querysuggest_969b5bda_bff0_418e_ae60_37d3da64afd9",
  "condition": "be7ccad6-11c8-4734-bf4c-8da7c29deafb",
  "maxRecommendations": 10,
  "useAdvancedConfiguration": false
}

For complete information on QS model available association parameters, see QS Model Association Parameters Reference.

Event Recommendations

The following code sample shows a Event Recommendations (ER) model association in JSON:

{
  "position": 1,
  "modelId": "8s5ak9_eventrecommendation_c4ba4f18_d179_4e5e_b686_b3d399a18a2f",
  "condition": "be7ccad6-11c8-4734-bf4c-8da7c29deafb",
  "useAdvancedConfiguration": false
}

For complete information on ER model available association parameters, see ER Model Association Parameters Reference.

Dynamic Navigation Experience

The following code sample shows a Dynamic Navigation Experience (DNE) model association configuration in JSON:

{
  "position": 1,
  "modelId": "8s5ak9_facetsense_bfeb0675_783b_49ca_8202_d45075684723",
  "condition": "be7ccad6-11c8-4734-bf4c-8da7c29deafb",
  "rankingModifier": 75,
  "customQueryParameters": {
    "facetOrdering": {
      "isEnabled": true
    },
    "facetValueOrdering": {
      "isEnabled": true
    },
    "rankingBoost": {
      "isEnabled": true
    }
  },
  "useAdvancedConfiguration": true
}

For complete information on DNE model available association parameters, see DNE Model Association Parameters Reference.

Product Recommendations

The following code sample shows a product recommendations model association in JSON:

{
  "position": 1,
  "modelId": "8s5ak9_ecommerce_468d41f6_269f_40d1_b9a8_d8b7be4e5b32",
  "condition": "be7ccad6-11c8-4734-bf4c-8da7c29deafb",
  "exclusive": true,
  "customQueryParameters": {
    "submodel": "popularViewed"
  },
  "useAdvancedConfiguration": false
}

For complete information on PR model available association parameters, see PR Model Association Parameters Reference.

Required Privileges

By default, members of the Administrators and Relevance Managers built-in groups can view and edit elements of the Query Pipelines page.

The following table indicates the privileges required to view or edit elements of the Query Pipelines page and associated panels (see Privilege Management and Privilege Reference).

Action Service - Domain Required access level
View model associations

Search - Query pipelines

Machine Learning - Models

View
Edit model associations

Search - Query pipelines

Machine Learning - Models

Edit
Recommended Articles