Create and manage a Content Recommendation (CR) model

Coveo Machine Learning (Coveo ML) Content Recommendation (CR) models suggest to the current user items that are relevant to their current browsing session. The results that are returned by the CR service can be included in a search page or in any other web page, such as in a side panel window.

To take advantage of Coveo ML CR, members with the required privileges must first create their CR models.

Prerequisites

Ensure that view events and search action events are being pushed to Coveo Usage Analytics (Coveo UA) for your organization (see Deploy Content Recommendations (CR)).

Even if the model only receives search or click events, it will still provide recommendations. However, we strongly recommend that you send view events on the web pages which correspond to the indexed items that you want to recommend.

Note

When there isn’t enough data for the model to recommend content, the CR model won’t return results, and the Recommendation Component will be empty.

If you recently started collecting usage analytics data, recommendations will improve as more data becomes available each time the model is retrained.

Create a CR model

  1. On the Models (platform-ca | platform-eu | platform-au) page, in the upper-right corner, click Add Model to open the Add a Machine Learning Model panel.

  2. Under Name, enter a meaningful display name for the model.

  3. Under Model type, select Content Recommendations, and then click Next.

  4. (Optional) In the Learning Interval section, change the default and recommended Frequency and Data period values, and then click Next.

  5. (Optional) In the Learn From section, add filters to refine the data that the model uses to make its recommendations.

  6. Click Next.

  7. (Optional) In the Recommended item types section, choose the type of items that the model will recommend.

  8. Click Add Model.

  9. On the Models (platform-ca | platform-eu | platform-au) page, under the Status column, in the model row, the value is most probably Inactive.

    Note

    The model value will change to Active when the model creation is complete (typically within 30 minutes, depending on the amount of usage analytics data to process). The model can only return recommendations when its status is Active.

    For more information on Coveo ML model statuses, see the Status column reference.

  10. (Optional) If you want to specify advanced parameters for your model, you can use the Advanced tab of the model configuration.

  11. You can then associate the model with a pipeline to take advantage of the model in a search interface and test your model to ensure that it behaves as expected.

    Important

    Make sure to follow the model association leading practices before associating your model with your production query pipeline.

Edit a CR model

  1. On the Models (platform-ca | platform-eu | platform-au) page, click the model you want to edit, and then click Edit in the Action bar.

  2. On the subpage that opens, select the Configuration tab.

  3. Under Name, you can optionally edit the model’s display name.

  4. (Optional) In the Learning Interval section, change the Frequency and Data period values.

  5. (Optional) In the Learn From section, add filters to refine the data that the model uses to make its recommendations.

  6. (Optional) In the Recommended item types section, choose the type of items that the model will recommend.

  7. Click Save.

  8. On the Models (platform-ca | platform-eu | platform-au) page, under the Status column, in the model row, the value is most probably Updating.

    Note

    The model value will change to Active when the model edition is complete (typically within 30 minutes, depending on the amount of usage analytics data to process). The model can only return recommendations when its status is Active.

    For more information on Coveo ML model statuses, see the Status column reference.

  9. You can then associate the model with a pipeline to take advantage of the model in a search interface and test your model to ensure that it behaves as expected.

    Important

    Make sure to follow the model association leading practices before associating your model with your production query pipeline.

Create a CR model with JSON

Advanced users who have the required privileges may want to create a model using a JSON configuration.

  1. Access the Models (platform-ca | platform-eu | platform-au) page.

  2. On the right side of the page, click menu-button, and then select Add model with JSON.

  3. In the Add a Model With JSON panel that appears, select Model configuration, and then modify the model placeholder configuration:

    {
        "engineId": "eventrecommendation",
        "modelName": "<MODEL_NAME>",
        "modelDisplayName": "<MODEL_DISPLAY_NAME>",
        "exportPeriod": "<EXPORT_PERIOD>",
        "intervalTime": <INTERVAL_TIME>,
        "intervalUnit": "<INTERVAL_UNIT>"
    }

    Where:

    • modelName (string, required) is the name of the model, which must be unique in your Coveo organization.

    • modelDisplayName (string) is the name of the model appearing on the Models (platform-ca | platform-eu | platform-au) page.

    • exportPeriod (ISO-8601 string, required) is the period defining the age of the usage analytics data used to build the model. Must be in the ISO8601 period format (e.g., PyYmMwWdDThHmMsS).

      Note

      Unless an exportOffset is specified, the exportPeriod uses the moment when the model was generated as a base.

    • intervalTime (integer, required) is the number of intervalUnit (e.g., DAY, WEEK, or MONTH) between each update of the model. Must be between 1 and 30 inclusively.

    • intervalUnit (string enum, required) is the duration unit of the interval between each update of the model. See intervalTime. Accepted values are: DAY, WEEK, and MONTH.

  4. Click Add Model.

    The model now appears on the Models (platform-ca | platform-eu | platform-au) page.

Notes
  • The default configuration contains all the required parameters with placeholder values.

  • You can add other advanced model parameters.

  • When using an existing configuration as a starting point, make sure to change the modelDisplayName as it must be unique in a Coveo organization.

Edit a CR model JSON configuration

  1. Access the Models (platform-ca | platform-eu | platform-au) page.

  2. Click the desired model, and then click More > Edit JSON in the Action bar.

  3. In the Edit a Model JSON Configuration panel that appears, modify the existing model configuration:

    {
      "modelDisplayName": "<MODEL_DISPLAY_NAME>",
      "exportPeriod": "<EXPORT_PERIOD>",
      "intervalTime": <INTERVAL_TIME>,
      "intervalUnit": "<INTERVAL_UNIT>",
      "commonFilter": "<COMMON_FILTER>",
      "customEventFilter": "<CUSTOM_EVENT_FILTER>",
      "exportOffset": "<EXPORT_OFF_SET>",
      "searchEventFilter": "<SEARCH_EVENT_FILTER>",
      "viewEventFilter": "<VIEW_EVENT_FILTER>",
      "extraConfig": [<ADVANCED_ML_PARAMETERS>],
    }

    Where:

    • modelDisplayName (string) is the name of the model appearing on the Models (platform-ca | platform-eu | platform-au) page.

    • exportPeriod (ISO-8601 string, required) is the period defining the age of the usage analytics data used to build the model. Must be in the ISO8601 period format (i.e., PyYmMwWdDThHmMsS).

      Note

      Unless an exportOffset is specified, the exportPeriod uses the moment when the model was generated as a base.

    • intervalTime (integer, required) is the number of intervalUnit (i.e., DAY, WEEK, or MONTH) between each update of the model. Must be between 1 and 30 inclusively.

    • intervalUnit (string enum, required) is the duration unit of the interval between each update of the model. See intervalTime. Accepted values are: DAY, WEEK, and MONTH.

    • commonFilter (string) is the filter to apply to the common event dimensions (shared by all event types) in the export. Multiple filter parameters are joined with the AND operator.

    • customEventFilter (string) is the filter to apply to the custom event dimensions in the export. Multiple filter parameters are joined with the AND operator.

    • exportOffset (ISO-8601 string) is the offset of the usage analytics data used to build the model. Must be in the ISO8601 period format (i.e., PyYmMwWdDThHmMsS). The default value is PT0S, meaning that all events are considered when building a model (the exportPeriod is based on the moment the model was generated).

      Example

      You want to ignore events that occur on the current day, so you set the exportOffset value to P1D.

    • searchEventFilter (string) is the filter to apply to the click and search event dimensions in the export. Multiple filter parameters are joined with the AND operator.

    • viewEventFilter (string) is the filter to apply to the view event dimensions (shared by all event types) in the export. Multiple filter parameters are joined with the AND operator.

    • extraConfig (array of string) are additional advanced parameters used to tailor the model to your use case.

  4. Click Save to apply your changes.

Delete a CR model

Important

You must Dissociate a model from all its associated query pipelines before deleting it. Models aren’t automatically dissociated from pipelines when they’re deleted.

  1. On the Models (platform-ca | platform-eu | platform-au) page, click the ML model that you want to delete, and then click More > Delete in the Action bar.

  2. In the Delete a Model panel that appears, click Delete model.

Review active model information

On the Models (platform-ca | platform-eu | platform-au) page, click the desired model (must be Active), and then click Open in the Action bar (see Reviewing Coveo Machine Learning model information).

Reference

"Status" column

On the Models (platform-ca | platform-eu | platform-au) page of the Administration Console, the Status column indicates the current state of your Coveo ML models.

When inspecting the Status column, a given model is either in the Active or Inactive state. Additional information can be displayed depending on the model’s current state.

status column

The following table lists the possible model statuses, their definitions, and their status colors as shown in the Administration Console:

Status Definition Status color

Active

The model is active and available.

green

Inactive

The model isn’t available.

grey

Update in queue

Waiting to process a scheduled update or configuration change.

green

Updating

The model is being rebuilt based on a new configuration.

green

Waiting

The model is in the building queue.

blue

Building

The model is currently being processed.

blue

Degraded

The model is active, but has some limitations. Additional information is available in the Error section of a model (see Review Coveo Machine Learning model information).

orange

Failed

The model couldn’t be built with the requested configuration. Additional information is available in the Error section of a model (see Review Coveo Machine Learning model information). See Edit a CR Model for information on how to edit a model configuration.

red

Update failed

The model couldn’t be updated with the requested configuration.

red

Error

An error prevented the model from being built successfully.

grey

Archived

The model was archived because it hasn’t been queried for at least 30 days.
Learn more on archived models.

grey

“Learning Interval” section

In this section, you can modify the following:

  • Frequency: The rate at which the model is retrained.

  • Data period: The usage analytics data time interval on which the model will be based.

The more data the model has access to and learns from, the better the recommendations. As a general guide, a usage analytics data set of 10,000 queries or more typically allows a Coveo ML model to provide very relevant recommendations. You can look at your Coveo Usage Analytics (Coveo UA) data to evaluate the volume of queries on your search hub, and ensure that your Coveo ML models are configured with a training Data Period that corresponds to at least 10,000 queries. When your search hub serves a very high volume of queries, you can consider reducing the data period so that the model learns only more recent user behavior and be more responsive to trends.

A Coveo ML model is regularly retrained on a more recent Coveo UA data set, to ensure that recent user behavior is learned and that the model freshness maintained.

Set the Coveo ML model training Frequency based on the Data Period value. Less frequent for a larger Data Period and more frequent for a smaller Data Period as recommended in the following table.

Data Period

Frequency

Daily

Weekly

Monthly

1 month

check

check

3 months (Recommended)

check

6 months

check

Note

If you’re testing the model in a sandbox environment in which very little analytics data is available to train the model, you can activate the Test configuration mode advanced option to ensure the model provides recommendations.

“Learn From” section

The Learn From section allows you to refine the data that the model uses to make its recommendations. By narrowing down the set of data that a model uses, you can better customize relevancy for specific user groups and use cases. You can apply filters on all events, or on every event that belongs to a specific category (i.e., search, click, view, or custom events).

Example

You want your CR model to return recommendations that pertain to a specific user group, so you add a data filter to ensure that only a specific set of analytics are used by the model for training purposes.

To add an event filter:

  1. (When creating a model only) Click Add-Filter.

  2. In the Select a dimension dropdown menu, select the dimension on which you want to base the learning of the model.

  3. In the Select an operator dropdown menu, select the appropriate operator.

  4. In the Select value(s) dropdown menu, add, type, or select the appropriate value.

  5. Click Add filter.

In the Recommended Item Types section, you can choose the types of items that a CR model recommends. By default, All types is selected, meaning that all types of content are returned. Alternatively, you can choose specific item types to filter out.

To filter out specific item types

  1. Select the Specific item types radio button.

  2. Click Add-Filter.

  3. Click the Select value(s) dropdown menu, and then select or type one or more specific content types.

    Example

    The view events that are pushed to Coveo UA for your organization include various types of content, such as Article, Application, Download, and Course. You only want to use this model to recommend relevant downloads, so you select Download.

    Notes
    • The view events that are pushed to Coveo UA for your organization must contain appropriate contentType values.

    • The View Content Type option doesn’t behave like the other filters. All view event content types and search events are analyzed to create the model, but only pages of the specified content types are recommended.

    • Only create more than one recommendation model if you want to include recommendation windows for different content types (see the note in Deploy Content Recommendations (CR)).

  4. Click Add Filter.

Required privileges

By default, members with the required privileges can view and edit elements of the Models (platform-ca | platform-eu | platform-au) page.

The following table indicates the privileges required to use elements of the Models page and associated panels (see Manage privileges and Privilege reference).

Action Service - Domain Required access level

View models

Machine Learning - Models
Organization - Organization
Search - Query pipelines

View

Edit models

Organization - Organization
Search - Query pipelines

View

Machine Learning - Models

Edit