WeightedScore
Weighted score combination.
Normalizes scores from each source to [0, 1] and combines with weights. Score = vectorWeight * normalizedVectorScore + keywordWeight * normalizedKeywordScore
Invalid weights are a programming error, like any require-guarded value here: the constructor throws IllegalArgumentException for a NaN, infinite, negative or all-zero pair, or one whose sum overflows (an infinite weight scores Inf, or NaN where a channel scored 0, and breaks the ranking). There is no Result twin: RAGConfig.withWeightedScore is a chainable builder that returns a RAGConfig, and a Left cannot be chained. Validate weights that come from user input before building the strategy (#1318, item 5).
Value parameters
- keywordWeight
-
Weight for keyword matching (default: 0.5)
- vectorWeight
-
Weight for vector similarity (default: 0.5)
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait FusionStrategyclass Objecttrait Matchableclass Any