Media Next Content Recommendation
Task type: RecommendationTask Industry: Media / Content
Predict the next content item a reader or viewer will consume. Sequential recommendation learns from dated media interactions, such as article reads or video views, and produces a ranked list of content IDs.
Prerequisites
- A trained foundation model with an
interactionsdata source containing an entity ID, event timestamp, and stablecontent_id. - A content catalogue using the same IDs, so ranked items can be resolved to articles or videos.
- A future window containing the interactions used as recommendation targets.
For training-data planning, the volume guidelines recommend at least 100,000 interactions per month. No media-specific minimum based on the total interactions in an export is established there. Assess ranking quality and catalogue coverage on a held-out time window against a popularity baseline.
Target function
from monad.ui.target_function import (
Attributes,
Events,
Sketch,
sequential_decay,
sketch,
)
def next_content_target_fn(
history: Events,
future: Events,
attributes: Attributes,
ctx: dict,
) -> Sketch | None:
"""Recommend content from the next dated interaction group."""
interactions = future["interactions"]
if interactions.count() == 0:
return None
return sketch(
interactions["content_id"],
sequential_decay(interactions, gamma=0),
)
gamma=0 gives weight to the earliest future timestamp group. Items sharing that timestamp form the next group. Returning None excludes an entity with no future interactions rather than inventing a target item.
To recommend content categories instead, use a stable category ID column and a catalogue at the same category level. Keep target IDs, foundation-model item mapping, and the candidate catalogue consistent.
See the recommendation implementation guide for training and evaluation, and the target-function reference for sketch and sequential_decay.