Class: RubricLLM::Metrics::Base
- Inherits:
-
Object
- Object
- RubricLLM::Metrics::Base
- Defined in:
- lib/rubric_llm/metrics/base.rb
Direct Known Subclasses
ContextPrecision, ContextRecall, Correctness, FactualAccuracy, Faithfulness, Relevance
Instance Attribute Summary collapse
-
#judge ⇒ Object
readonly
Returns the value of attribute judge.
Instance Method Summary collapse
-
#call(question:, answer:, context: [], ground_truth: nil) ⇒ Object
Evaluate a single sample.
-
#initialize(judge:) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(judge:) ⇒ Base
Returns a new instance of Base.
8 9 10 |
# File 'lib/rubric_llm/metrics/base.rb', line 8 def initialize(judge:) @judge = judge end |
Instance Attribute Details
#judge ⇒ Object (readonly)
Returns the value of attribute judge.
6 7 8 |
# File 'lib/rubric_llm/metrics/base.rb', line 6 def judge @judge end |
Instance Method Details
#call(question:, answer:, context: [], ground_truth: nil) ⇒ Object
Evaluate a single sample. Subclasses must implement this.
Returns { score: Float (0.0-1.0), details: Hash }
15 16 17 |
# File 'lib/rubric_llm/metrics/base.rb', line 15 def call(question:, answer:, context: [], ground_truth: nil, **) raise NotImplementedError, "#{self.class}#call must be implemented" end |