Class: Phronomy::Eval::Scorer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/phronomy/eval/scorer/base.rb

Overview

Abstract base class for all scorers. Subclasses must implement #score.

Direct Known Subclasses

ExactMatch, IncludesScorer, LlmJudge

Instance Method Summary collapse

Instance Method Details

#score(actual:, expected:, input: nil) ⇒ Float

Scores an actual output against the expected output.

Parameters:

  • actual (String)

    the callable's output

  • expected (String)

    the ground-truth value from the EvalCase

  • input (String, nil) (defaults to: nil)

    the original input (used by LLM scorers)

Returns:

  • (Float)

    a value in [0.0, 1.0]

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/phronomy/eval/scorer/base.rb', line 15

def score(actual:, expected:, input: nil)
  raise NotImplementedError, "#{self.class}#score is not implemented"
end