aarondb/scoring

Types

pub type NormalizationStrategy {
  MinMax
  None
}

Constructors

  • MinMax
  • None
pub type ScoredResult {
  ScoredResult(entity: fact.EntityId, score: Float)
}

Constructors

Values

pub fn weighted_union(
  results_a: List(ScoredResult),
  results_b: List(ScoredResult),
  weight_a: Float,
  weight_b: Float,
  normalization: NormalizationStrategy,
) -> List(ScoredResult)

Combines two lists of scored results using weighted union. Scores are first normalized (if requested) then combined by weight. If an entity appears in only one list, it’s treated as having score 0.0 in the other.

Search Document