About Smart Snippets

Smart snippets example

Coveo Machine Learning (Coveo ML) Smart Snippets models provide users with answers to their queries directly on the results page by displaying a snippet of the most relevant result item. This allows users to quickly find answers without having to open links from the results page.

Specifically, Coveo ML Smart Snippets models scan the items returned by the index to find which one is the most relevant according to the query. This item is then pushed to the top of the results list and its result template displays the content that is the most likely to answer the query.

Coveo ML Smart Snippets also provides additional questions and topics in a "Related Content" section that users can click to find further information related to their query without leaving the results page.

Members with the required privileges can configure and manage Coveo ML Smart Snippets.

Note

Coveo ML Smart Snippets is currently not available for HIPAA organizations.

How Coveo ML Smart Snippets Work

To provide users with the most relevant snippet of content, Coveo ML Smart Snippets leverages a machine learning algorithm that computes a similarity score between a user query and the headings of the items in a results list. If the similarity score meets a predefined minimum threshold, Coveo ML Smart Snippets will use the content attached to the header that matches the user query, and renders the information in the related search result.

Important

A Coveo ML Smart Snippets model returns snippets of content for HTML items only.

Example

In your support website, you have an FAQ page that is configured to leverage Coveo ML Smart Snippets. The FAQs appear on the page as headers (within <h2> tags) whereas the answers appear in paragraphs (within <p> tags).

One of the FAQs that appears on the page is: How to synchronize my Speedbit with my computer?

A user accesses your support website’s main page and enters the following query in the search bar: Synchronizing Speedbit with computer.

Since the Smart Snippets model calculated a high similarity score between the user query and the How to synchronize my Speedbit with my computer? header, the user obtains the FAQ page as the top result. The result template also displays the content that appears in the paragraph attached to the How to synchronize my Speedbit with my computer? header on the FAQ page.

Similarity Score Thresholds

Depending on the similarity score the model established between a query and the header of the items that appear in the results list, the model either displays the best snippet at the top of the results page, shows the snippet as a related question, or doesn’t display the snippet at all.

The following table indicates the thresholds used by the model to determine whether to display a snippet:

Similarity score Result

0.59 and more

The answer is displayed as a snippet at the top of the results page.

Between 0.49 and 0.59

The answer is displayed as a related question.

Below 0.49

The answer is not displayed by the model.

Notes

Inspect Similarity Scores

You can inspect the score computed for a given snippet by inspecting the call to the Search API:

  1. Access the search interface that contains the required components, and in which the traffic is directed to the query pipeline that you associated with your Coveo ML Smart Snippets model.

  2. Access your browser developer tools.

  3. In the search box, perform a query that would likely trigger a snippet to appear in the search results.

  4. In your browser developer tools, in the Network tab, under the Name column, select the latest request to the Search API. The request path should contain /rest/search/v2.

  5. Select the Preview tab. You should now see the query response body.

  6. In the query response body, you should see an expandable questionAnswer property. You can expand it to get detailed information about the model’s output for this specific query. The questionAnswer property doesn’t appear if the model can’t provide snippets for the current query.

  7. You can now inspect the similarity score the model gave to the displayed snippets:

    • To inspect the score of the top snippet, look at the score value.

      search api response for a smart snippets model
    • To inspect the score of the related questions for the same query:

      1. Expand the relatedQuestions property.

      2. You should now see the list of headers for which the model can provide snippets. Expand the desired question property, and then inspect the associated score value.

        search api response for a smart snippets model
What's next for me?