Skip to main content

Building Reliable Recommendation Systems with Keras Recommenders (KerasRS)

Google for DevelopersDecember 18, 20259 min7,896 views
14 connections·19 entities in this video→

Introduction to Keras Recommenders

  • πŸ’‘ While Large Language Models (LLMs) can be used for recommendations, they often suffer from hallucinations.
  • 🎯 Keras Recommenders (KerasRS) is introduced as a Python library designed to build reliable and high-performing recommendation systems without these issues.
  • 🌐 Recommendation systems are crucial for everyday online experiences, appearing as suggestions in shopping, social media, and video platforms.

KerasRS: Features and Setup

  • 🧩 KerasRS provides building blocks for tasks like ranking and retrieval.
  • βš™οΈ Built on Keras 3, it offers compatibility with TensorFlow, JAX, or PyTorch backends.
  • πŸ“¦ Installation is straightforward via pip: pip install keras-rs.
  • πŸ“š The library includes numerous examples, available as web pages and Colab notebooks.

Sequential Retrieval with GRU

  • πŸš€ The video focuses on sequential retrieval, predicting the next item in a series.
  • 🧠 A Gated Recurrent Unit (GRU), a type of recurrent neural network, is used to analyze user history and predict the next item.
  • 🎬 An example using the MovieLens dataset demonstrates predicting the next movie a user will watch.

Data Preparation and Model Architecture

  • πŸ“Š The MovieLens dataset is prepared by creating sequences of movie reviews for each user, ordered by timestamp.
  • 🐍 The "snake" method is used to generate multiple training examples from a single user sequence, where each subsequent example includes one more item.
  • πŸ§ͺ The final review in each sequence is set aside for the test dataset to ensure it's not exposed during training.
  • 🧱 The model features a two-tower architecture: a query tower using GRU for historical sequences and a candidate tower with embeddings for potential recommendations.
  • πŸ” The BruteForceRetrieval layer is used to decode query embeddings and retrieve predictions from the candidate tower.

Training and Prediction

  • πŸ› οΈ After data preparation, the model is instantiated, compiled, and trained using standard Keras procedures.
  • 🎬 Predictions can be made using test data or by inputting a custom sequence of favorite movies to evaluate the model's suggestions.
  • ✨ KerasRS offers various other example architectures, such as the Deep and Cross Network and two-tower embedding models for retrieval and ranking.
Knowledge graph19 entities Β· 14 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
19 entities
Chapters4 moments

Key Moments

Transcript34 segments

Full Transcript

Topics15 themes

What’s Discussed

Keras RecommendersRecommendation SystemsRankingRetrievalSequential RetrievalGated Recurrent UnitGRUMovieLens DatasetTwo-Tower ModelBruteForceRetrievalMachine LearningDeep LearningTensorFlowJAXPyTorch
Smart Objects19 Β· 14 links
ProductsΒ· 11
CompanyΒ· 1
ConceptsΒ· 7