RelevancyMetric
utilizes the evaluateRelevancy
function to determine the relevance of the answer to the question.
evaluateRelevancy
Functioninput
: The question posed to the model.output
: The generated answer by the model.RelevancyMetric
ClassRelevancyMetric
evaluates how well an answer addresses the posed question, focusing on its relevance.
input
: The question posed to the model.output
: The generated answer by the model.evaluateSteps
method calls evaluateRelevancy
and provides a detailed result, including a score and reasons. The evaluation concludes with a score indicating high or low relevance based on the contextual appropriateness of the answer.