/** * Discriminative query-term scoring using the session BM25 corpus. * * Rare query terms (high IDF among indexed query tokens) are treated as * salient: chunks that match more salient term mass rank higher; chunks that * miss them are slightly down-ranked. Pure logic — no I/O. */ import { BM25Index } from "./bm25"; import type { DiscriminativeWeights } from "../entities/rankingWeights"; /** @deprecated Use {@link DEFAULT_DISCRIMINATIVE_WEIGHTS} from entities. */ export declare const DISCRIMINATIVE_CONSTANTS: DiscriminativeWeights; export interface DiscriminativeTermResult { /** Additive boost ∈ [0, boostCap] */ boost: number; /** Multiply hybrid score by this after additive boosts (≤ 1 when penalty applies) */ penaltyFactor: number; /** Query tokens (indexed in BM25) with IDF ≥ median among indexed tokens */ salientTerms: string[]; matchedSalient: string[]; missingSalient: string[]; /** Σ IDF(matched salient) / Σ IDF(salient), or 1 if no salient set */ salientCoverage: number; } /** * Score how well chunk text hits corpus-rare query terms using an already-built * {@link BM25Index} over the same chunk set used for retrieval. */ export declare function scoreDiscriminativeTerms(bm25Index: BM25Index, query: string, chunkText: string, chunkName?: string, weights?: DiscriminativeWeights): DiscriminativeTermResult;