AWS Personalize: How to Exclude Previously Viewed Items Temporarily by Dynamic Date Range?

67 Views Asked by At

I'm trying to refining our content recommendation system to enhance user experience. Specifically, my goal is to temporarily exclude items (e.g., articles) that a user has previously interacted with for a specific period, like 30 days, after which these items can become eligible for recommendation again.

This approach contrasts with the permanent exclusion of items based on purchase events, as suggested by AWS Personalize documentation:

EXCLUDE ItemID WHERE Interactions.EVENT_TYPE IN ("purchased")

Initially, I explored using AWS Personalize's permanent exclusion feature, hoping there might be a straightforward way to adapt this for temporary exclusions based on interaction dates using filters. However, this method does not support some kind of dynamic date range filter.

I am considering a custom solution outside AWS Personalize to manage these temporary exclusions, but i assume that integrating this functionality directly within AWS Personalize would yield the most accurate and efficient recommendations.

The ideal solution would dynamically exclude interacted items for a set period and then automatically reintroduce them into the pool of recommendable items.

Has anyone implemented a similar feature or can offer insights into achieving this within AWS Personalize? Any advice, examples, or best practices would be greatly appreciated.

1

There are 1 best solutions below

2
James J On

Excluding items based on the timestamp of interactions, such as a time range, is currently not supported by Personalize filters. Instead, the current mechanism of excluding by event type is count-based. That is, excluding by event type defaults to considering the most recent 100 interactions by the user for the event type. So in your case, the 100 most recent read/viewed articles would be excluded from recommendations (assuming you had an event type for reading/viewing articles). The limit of 100 is adjustable (see limits page).

If you would like to exclude by time range, you would need to keep track of recently read/viewed articles for each user using something like Redis. Then you could over-sample Personalize at inference (ask for more than you need) and post-process recommendations to drop recently read/viewed articles for the user.

Alternatively, you could pass in the item IDs of recently read/viewed articles to a dynamic filter that excludes those items. This eliminates the post-processing step but still requires that you store recently read article IDs outside of Personalize. Since you can't filter on the ITEM_ID column in the items dataset, this requires you to create a custom column (e.g., ITEM_ID2) in the items dataset that is populated with the item ID for each item. The filter would look something like this:

EXCLUDE ItemID WHERE Items.ITEM_ID2 IN ($RECENTLY_READ_ITEM_IDS)

Using this approach is limited by how many item IDs you can pass as RECENTLY_READ_ITEM_IDS (1000 characters for entire comma delimited list). So the length of you item IDs is a limiting factor.