Skip to main content

Data & Intelligence

A Comprehensive Insight into Coveo Content Recommendation ML Model for Reforming Content Strategy

Business Intelligence And Business Analytics Concept 3d Illustration

Introduction

Coveo’s Content Recommendation Model is a machine learning feature that provides personalized content recommendations to users based on their behavior and preferences. It enhances user engagement and satisfaction by suggesting relevant information, products, or content. The model continuously learns and adapts, ensuring that recommendations remain accurate over time. Coveo’s solution integrates seamlessly, offers configuration options, considers user and item context, and contributes to a more tailored and effective user experience.

Content Recommendation Model In Coveo

The Recommendation component shows suggestions based on user history and typically operates alongside the primary Search Interface. It triggers a separate query for recommendations when the main Search Interface generates a query

The Recommendation component can function independently as a complete search interface. It can also be embedded within another Search Interface, allowing for the inclusion of various components like Search boxes, Facets, Sort options, and more, similar to the primary Search Interface

When a user visits a page with a dedicated recommendation interface, Coveo’s machine learning model offers relevant page suggestions based on user interactions and past sessions, ensuring the most fitting content recommendations for each user

Concrete Scenario

If we have four movies, and the user likes or rates the first two items, and if Item 3 shares a similar genre with Item 1, the engine will also recommend Item 3 to the user. This is essentially what content based recommender systems do.

Recommender

Let’s Dive In!

Note: Before start ensure you have a dataset for training your recommendation model.

Setting up the Content Recommendation Model in Coveo admin console

  • Access Coveo Admin Console: Log in to  Coveo Admin Console with the necessary permissions.
  • Navigate to Recommendations: In the left-hand menu, click on “models” under the “Machine Learning” section.
  • Create a New Model:  Click the “Add Model” button to start the setup process select the “Content Recommendations”

12

3

  • Create a query pipeline: To utilize the content recommendation machine learning model effectively, it’s essential to create a dedicated Query Pipeline for it. This is necessary because attempting to associate the content recommendation model with a pipeline that already includes other models like Query Suggestion and ART may lead to compatibility issues. Similarly, if a pipeline is already associated with the content recommendation model, adding other models like Query Suggestion and ART may not be possible. Therefore, it’s advisable to always create a new, separate Query Pipeline specifically for the content recommendation model.

5

  • Create Hosted Search Page: In order to demonstrate the implementation of the content recommendation model within the user interface, it is necessary to create a Coveo Hosted Search page. Follow the steps below to create a hosted search page in coveo:
    > Go to the ‘Search’ menu. > Select ‘Search Page.’ > Click ‘Add Search Page.’ > Access the ‘Classic Interface Editor.’ > Add the ‘Page Name’ and ‘HTML Title.’ > Click ‘Add Search Page’ again. > Proceed to ‘Setup Search Page.’ > Select ‘All Content.’ > Click ‘Create Page.’ > Upon completion, the search interface will be visible.

Integration of recommendation model in hosted search page

Incorporate a Coveo JavaScript Search Framework recommendation interface into each page where we wish to show the recommendations panel to use a Coveo Machine Learning Content Recommendation (CR) model in a website or hosted page we should probably include the scripts in the hosted search page to get recommendations. Use the Recommendation component along with the Coveo Machine Learning model, however, to create a simple “coveo recommendations” interface.

  • Configure a search endpoint for the recommendation interface
document.addEventListener("DOMContentLoaded", () => {
fetch('https://analytics.cloud.coveo.com/rest/ua/v15/analytics/view?org={ORGANIZATIONID}&prioritizeVisitorParameter=true', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer {APIKEY}'
},
body: JSON.stringify({
"language": "en",
"context_product": "book"
})
})
.then(response => response.json())
.then(response => console.log("json res for recommedation", JSON.stringify(response)))
Coveo.SearchEndpoint.endpoints['default'] = new Coveo.SearchEndpoint({
restUri: 'https://platform.cloud.coveo.com/rest/search',
accessToken: saveToken
}); 
});
  • Initialize the recommendation interface.
let mainSearchInterfaceElement = document.getElementById("#search");
let recommendationElement = Coveo.$$(document).find("#recommendation");
// add context-based logic here...
Coveo.initRecommendation(recommendationElement, mainSearchInterfaceElement);
// Coveo.init(mainSearchInterfaceElement);
  • Configure the recommendation interface in the page markup.
<body>
    <div id="recommendation"
         class="CoveoRecommendation"
         data-results-per-page="5"
         data-pipeline="<RECOMMENDATION_QUERY_PIPELINE>">
      <div class="CoveoAnalytics" data-search-hub="<RECOMMENDATION_SEARCH_HUB>"></div>
      <div class="coveo-recommendation-header">
        <div class="coveo-recommendation-title">RECOMMENDATION_INTERFACE_TITLE</div>
      </div>
      <div class="coveo-recommendation-body">
        <div class="CoveoResultList"></div>
      </div>
    </div>
</body>
  • Save and Test.

Utilize user context information in the recommendation interface.

Follow the steps below to get content recommendations based on the context:

  • To receive a recommendation based on product context, we must set the context in request call. A key/vale pair should be used to represent it. Follow this link to learn more about setting context:
  • Remember to include the following code here: The product is key, and productContext takes the value from the user on the search interface at runtime
Coveo.$$(recommendationElement).on("buildingQuery", function(e, args) { 
let productContext = document.getElementById("productContext").value;
args.queryBuilder.addContext({
 "product": productContext 
}); 
});
  • For obtaining content recommendations that are tailored to the product context, it’s essential to configure the required conditions for this particular model
    Pr3 Qp ConditionContext[product] is not populated” suggests that this recommendation module relies on a specific product-related context to make recommendations
  • Save and Test.

Result

Usually, this component checks the primary Search Interface. The Recommendation component generates a separate query to obtain the recommendations simultaneously with the query that the main Search Interface generates.

To see the query-based recommendation: Enter any search term in the search interface to view the recommendation based on that term.

For Ex.:
search term: Too many redirects error when accessing SmartEdit with http.

Cr6
To see the context-based recommendation:

  1. Complete the input with a relevant product value. Utilize some of the product values to populate the recommendation panel with an accurate recommendation!

  2. Next, click Create Context before starting a fresh search.Pr1 Book

Pr2 Batchlogfile

Pay
Conclusion

Coveo’s content recommendation machine learning model is a game-changer in the world of conteCoveo’s Content Recommendation Model (CR) is a powerful machine learning feature that enhances user engagement by providing personalized content recommendations based on user behavior and preferences. It seamlessly integrates into the Coveo ecosystem, allowing for easy setup and configuration. Whether it’s query-based or context-based recommendations, Coveo’s model ensures relevant content is suggested, contributing to a more tailored and effective user experience. Implementing this model involves setting up a dedicated query pipeline, creating hosted search pages, and utilizing user context information, ultimately leading to improved user satisfaction and content discovery.

Important Links:

Manage query pipelines | Coveo

About Query Suggestions (QS) | Coveo Machine Learning

About Automatic Relevance Tuning (ART) | Coveo Machine Learning

Send custom context information | Coveo JavaScript Search Framework

Integrate a recommendation interface in a web page | Coveo JavaScript Search Framework

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ashwini Bhave

Ashwini works at Perficient as a Technical Consultant. She is familiar with various technologies and frameworks, including Coveo enterprise search and AI-powered relevance. She holds a Coveo developer certification. Learning about cutting-edge technology interests her she is also motivated to share her knowledge through her blogs.

More from this Author

Follow Us