mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
feed: make Explore "new-to-you + diverse, less recency"
Explore shared the full active set with Recent/For You and leaned on freshness,
so it read like a reshuffled Recently-added. Give it a discovery identity:
- Weights: drop freshness (0.25 -> 0.12) and bump novelty (0.30 -> 0.35) so
recency stops dominating and topic-novelty leads.
- Add a soft followed-author penalty (weight 0.3): the scorer now reads
subscriptionAuthors from the Explore runtime and deprioritizes creators you
already follow, so non-followed creators surface ("new to you"). A penalty,
not a filter, so the feed stays full if you follow lots of people.
- More variety: lower the diversity sorter's MMR lambda (0.7 -> 0.5).
Also compacted For You's subscriptionAuthors reader to a one-liner to stay
under feedCoordinator's size cap while adding the same reader to Explore.
Tests: explore follows-penalty scoring; existing explore-scorer/diversity +
feedCoordinator suites green.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
4873a43135
commit
087cf410cb
3 files changed
+55
-18
No files matched your search
@@ -4,12 +4,13 @@ import { normalizeHashtag } from "../utils/hashtagNormalization.js";
|
||||
import { isPlainObject, toSet } from "./utils.js";
|
||||
|
||||
const DEFAULT_WEIGHTS = Object.freeze({
|
||||
novelty: 0.3,
|
||||
freshness: 0.25,
|
||||
novelty: 0.35, // reward topics outside your watch history (discovery)
|
||||
freshness: 0.12, // Explore is discovery, not "what's new" — recency matters less
|
||||
historySimilarity: 0.2,
|
||||
newTagFraction: 0.1,
|
||||
popularityNorm: 0.1,
|
||||
disinterestOverlap: 0.25,
|
||||
followedPenalty: 0.3, // deprioritize creators you already follow → new-to-you
|
||||
});
|
||||
|
||||
const DEFAULT_FRESHNESS_HALF_LIFE_DAYS = 14;
|
||||
@@ -319,6 +320,10 @@ export function createExploreScorerStage({ stageName = "explore-scorer", ...opti
|
||||
const popularityMax = resolvePopularityMax(options, context);
|
||||
const freshnessHalfLifeDays = resolveFreshnessHalfLife(options, context);
|
||||
const now = resolveNow(context);
|
||||
// Soft penalty for creators you already follow so Explore leans toward
|
||||
// creators that are NEW to you. A penalty (not a filter) keeps the feed full
|
||||
// when you follow lots of people.
|
||||
const follows = toSet(context?.runtime?.subscriptionAuthors);
|
||||
|
||||
for (const item of items) {
|
||||
if (!item || typeof item !== "object") {
|
||||
@@ -379,13 +384,17 @@ export function createExploreScorerStage({ stageName = "explore-scorer", ...opti
|
||||
freshness = clamp01(decay);
|
||||
}
|
||||
|
||||
const followedMatch =
|
||||
typeof video.pubkey === "string" && follows.has(video.pubkey) ? 1 : 0;
|
||||
|
||||
const score = clamp01(
|
||||
weights.novelty * novelty +
|
||||
weights.freshness * freshness +
|
||||
weights.historySimilarity * historySimilarityPositive +
|
||||
weights.newTagFraction * newTagFraction +
|
||||
weights.popularityNorm * popularityNorm -
|
||||
weights.disinterestOverlap * disinterestOverlap,
|
||||
weights.disinterestOverlap * disinterestOverlap -
|
||||
(weights.followedPenalty || 0) * followedMatch,
|
||||
);
|
||||
|
||||
if (!isPlainObject(item.metadata)) {
|
||||
@@ -400,6 +409,7 @@ export function createExploreScorerStage({ stageName = "explore-scorer", ...opti
|
||||
historySimilarity,
|
||||
popularityNorm,
|
||||
freshness,
|
||||
followedMatch,
|
||||
tags: Array.from(videoTags),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user