RelevanceEvaluator Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An IEvaluator that evaluates the 'Relevance' of a response produced by an AI model.
public ref class RelevanceEvaluator sealed : Microsoft::Extensions::AI::Evaluation::IEvaluator
public sealed class RelevanceEvaluator : Microsoft.Extensions.AI.Evaluation.IEvaluator
type RelevanceEvaluator = class
interface IEvaluator
Public NotInheritable Class RelevanceEvaluator
Implements IEvaluator
- Inheritance
-
RelevanceEvaluator
- Implements
Remarks
RelevanceEvaluator measures an AI system's performance in understanding the input and generating contextually appropriate responses. It returns a NumericMetric that contains a score for 'Relevance'. The score is a number between 1 and 5, with 1 indicating a poor score, and 5 indicating an excellent score.
High relevance scores signify the AI system's understanding of the input and its capability to produce coherent and contextually appropriate outputs. Conversely, low relevance scores indicate that generated responses might be off-topic, lacking in context, or insufficient in addressing the user's intended queries.
Note: RelevanceEvaluator is an AI-based evaluator that uses an AI model to perform its evaluation. While the prompt that this evaluator uses to perform its evaluation is designed to be model-agnostic, the performance of this prompt (and the resulting evaluation) can vary depending on the model used, and can be especially poor when a smaller / local model is used.
The prompt that RelevanceEvaluator uses has been tested against (and tuned to work well with) the following models. So, using this evaluator with a model from the following list is likely to produce the best results. (The model to be used can be configured via ChatClient.)
GPT-4o
Constructors
RelevanceEvaluator() |
Properties
EvaluationMetricNames |
Gets the Names of the EvaluationMetrics produced by this IEvaluator. |
RelevanceMetricName |
Gets the Name of the NumericMetric returned by RelevanceEvaluator. |
Methods
EvaluateAsync(IEnumerable<ChatMessage>, ChatResponse, ChatConfiguration, IEnumerable<EvaluationContext>, CancellationToken) |
Evaluates the supplied |