Content-Based Recommendation system with Tensorflow Recommenders (tfrs)

I want to create content-based recommendation system with Tensorflow Recommenders, but I can’t find any material about it. There are a few about collaborative filtering. including official tutorial, but can’t find content-based (where you recommend based on item attributes and not users interactions). As I guess TFRS utilizes two tower model with user embedding and item embedding layers, then compiling it with TFRS retrieval task, but I can’t wrap my head around how I can translate it to item features without other users previous interactions (except the one who I should recommend items to).

I know I’m probably lacking knowledge of several important topics of neural nets, Keras layers, matrix factorization, but TFRS recommender seems to be easy to utilize for content-based filtering.

Please recommend what should I do, or any materials about this topic in particular or some prerequisite topics required for it.

You say you want to “recommend based on item attributes and not users interactions”. To train a TFRS model, you will need training data that includes user interactions (clicks or ratings, etc.) with content. That interaction data can include attributes of the users (e.g. age, gender), attributes of the content (e.g. title, description, tags), and other context attributes (hour of day, day of week when the interaction occurred).

The “official” tutorials incorporate all these concepts, though I get from personal experience that it can be challenging to understand how it all ties together and works. Beyond the official tutorials, I found Preston Blackburn’s example to be helpful.

Yes, user interaction will be present, but only for the user the model will predict on. I will not have any other interactions of other users.
The official documentation seemed extensive, but for the beginner in this field, it seemed really difficult to fully comprehend.
I’ll take a look at this example, thanks a lot.

Maybe if you make content based filtering for the search feature, you can change the role from user model to item target model, hope that helps, thank you.

1 Like

https://www.youtube.com/watch?v=8CPI5_Ivmj4&list=PLQY2H8rRoyvy2MiyUBz5RWZr5MPFkV3qz I think this official tutorial help full to you

1 Like