A search for restaurants may depend on a user’s location; a job search may depend on experience and salary preferences. A user profile represents what is known or inferred about an individual, so search results and recommendations can reflect those interests. section 9.0 section 9.1.2
A profile can include items a user has viewed, clicked, or purchased, as well as inferred or aggregated preferences such as brand affinities, clothing sizes, or desired job titles. Letting users inspect and adjust these preferences gives them a way to guide recommendations. section 9.1.2
Profiles can play different roles across the search and recommendation spectrum:
- Traditional keyword search uses explicit input and ignores the profile. section 1.2.3
- Personalized search uses the profile implicitly alongside explicit input, such as a query. section 1.2.3
- User-guided recommendations use the profile explicitly and let the user adjust it; traditional recommendations use it without that adjustment. section 1.2.3
Figure 1.5 The personalization spectrum, showing traditional keyword search and traditional recommendations as two ends of a larger continuum
The spectrum shows where profile-driven personalization fits between keyword search and recommendations. section 1.2.3
Profiles can also be represented as vectors. One approach generates embeddings from document content, then combines those embeddings with user interactions to build an evolving profile for personalized search. Each document embedding contains latent features inferred from its text; in practice, these features need not have simple labels. section 9.4.1 section 9.6
Listing 9.12 Generating product embeddings
from sentence_transformers import SentenceTransformer #1
transformer = SentenceTransformer("all-mpnet-base-v2") #1
... #2
def get_embeddings(texts, model, cache_name, ignore_cache=False):
... #2
embeddings = model.encode(texts) #3
... #2
return embeddings
product_embeddings = get_embeddings(product_names,
transformer, cache_name="all_product_embeddings")
This Python example generates product embeddings with SentenceTransformer, providing a content representation that can be used with interactions to build profiles. section 9.4.1
Interaction patterns alone can encounter a cold-start problem, including difficulty mapping previously unseen queries to item clusters. Combining behavioral signals with content attributes can help. Personalization also needs restraint: preserve user privacy and avoid boosts so aggressive that they frustrate users or push results too far outside their interests. section 9.4 section 9.6


