Associate a Smart Snippet model with a query pipeline
Associate a Smart Snippet model with a query pipeline
When a Coveo Machine Learning (Coveo ML) model has been created, it must be associated with a query pipeline to be effective in a search interface.
organization members with the required privileges can access the Machine Learning tab of a query pipeline configuration page to manage Coveo ML model associations for that query pipeline.
Associate a Smart Snippet model
-
On the Query Pipelines
(platform-ca
| platform-eu
| platform-au
) page, click the query pipeline for which you want to associate the model, and then click Edit components in the Action bar.
-
On the subpage that opens, select the Machine Learning tab, and then in the upper-right corner, click Associate Model.
-
In the Model dropdown menu, select the desired model.
-
On the right side, under Condition, you can select a query pipeline condition in the dropdown menu or create a new one.
-
Click Associate Model.
Edit a Smart Snippet model association
-
On the Query Pipelines
(platform-ca
| platform-eu
| platform-au
) page, click the query pipeline for which you want to edit a model association, and then click Edit components in the Action bar.
-
On the subpage that opens, select the Machine Learning tab, click the desired model, and then click Edit in the Action bar.
-
On the right side, under Condition, you can select a query pipeline condition in the dropdown menu or create a new one.
-
Click Save.
Associate a Smart Snippet model via a JSON configuration
Advanced users may want to manage a model association via a JSON configuration to specify association parameters that don’t fit with the parameters available in the Administration Console.
-
On the Query Pipelines
(platform-ca
| platform-eu
| platform-au
) page, click the query pipeline for which you want to associate a model, and then click Edit components in the Action bar.
-
On the subpage that opens, select the Machine Learning tab, and then in the upper-right corner, click
, and select Associate a model in JSON view.
-
On the Associate a Model subpage, in JSON view, replace the
<Model_ID>
placeholder with the actualID
of the model you want to associate with the pipeline (see Review model information). -
Click Associate Model.
Edit a Smart Snippet model association via a JSON configuration
Advanced users may want to manage a model association via a JSON configuration to specify association parameters that don’t fit with the parameters available in the Administration Console.
-
On the Query Pipelines
(platform-ca
| platform-eu
| platform-au
) page, click the query pipeline for which you want to edit a model association, and then click Edit components in the Action bar.
-
In the Machine Learning tab, double-click the desired model.
-
If the Edit a Model Association subpage opens in JSON view, proceed to the next step. Otherwise, in the upper-right corner, click
, click Switch to JSON view, and then click Switch to JSON view in the confirmation window.
-
On the Edit a Model Association subpage, in JSON view, tune the JSON model association configuration as needed (see Model association parameters).
-
Click Save.
Dissociate a model
-
On the Query Pipelines
(platform-ca
| platform-eu
| platform-au
) page, click the query pipeline from which you want to dissociate a model, and then click Edit components in the Action bar.
-
On the subpage that opens, select the Machine Learning tab.
-
In the Machine Learning tab, click the model you want to dissociate from the pipeline, and then click Dissociate in the Action bar.
Reorder model associations
The Coveo ML models of a given type are executed in the order in which they appear on the page until a condition is satisfied.
|
The first model on the list will be used if no conditions are met. |
-
On the Query Pipelines
(platform-ca
| platform-eu
| platform-au
) page, click the query pipeline in which you want to reorder model associations, and then click Edit components in the Action bar.
-
On the subpage that opens, select the Machine Learning tab.
-
In the Machine Learning tab of the desired query pipeline, click the model whose position you want to change, and then use the Move up or Move down arrows in the Action bar to change the position of the model.
Reference
Model association parameters
You can use the following parameters when creating or editing a Coveo ML Smart Snippets model association.
id
(string)
The unique identifier of the model association (automatically generated by the Coveo Search API).
Example: 62579f33-a505-4d07-b77d-545aefb2eea1
position
(integer [int32])
The position of the model in the order of execution (see Reorder model associations).
Example: 8
modelId
(string)
The unique identifier of the model (see Review model information).
Example: c7ab60e2-e6b8-41e8-be6a-ad5c8edc662e
modelDisplayName
(string)
The name of the model as selected when creating the model. This field is automatically filled with the name of the Coveo ML model.
Example: MyModelName
modelEngine
(string)
The ID of the Coveo ML model. This field is automatically filled with the ID of the Coveo ML model.
Example: mlquestionanswering
modelStatus
(string)
The status of the model. This field is automatically generated according to the current ML model status.
Example: ONLINE
condition
(string)
The unique identifier of the condition that must be satisfied for a request to be processed by the ML model.
Example: c7ab60e2-e6b8-41e8-be6a-ad5c8edc662e
conditionDefinition
(string)
The QPL expression that indicates the condition defined for the model association (see Query Pipeline Language (QPL)).
This field is automatically filled when a condition
is specified.
Example: when $searchHub is \"internalSearch\"
cacheMaximumAge
(string)
The maximum age of cached query results the ML model should accept, in the ISO-8601 format only including the seconds and milliseconds part.
For each incoming query to be processed by the ML model, if a result set for an identical previously made query is available in the cache and this result set isn’t older than the specified value, the ML model makes recommendations based on that cached query result set. Otherwise, the query is executed against the index.
Default: PT105
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 model associations |
Machine Learning - Models |
View |
Edit model associations |
Organization - Organization |
View |
Search - Query pipelines |
Edit |