Overview
The Intent Classification metric evaluates the intent behind a given text to determine how well it aligns with one or more predefined expected intents.IntentClassificationMetric
leverages the classifyIntent
function to perform this evaluation.
Methods
classifyIntent
Function
This function classifies the intent behind a given text and compares it against expected intents.
input
: The text to be classified.expectedIntents
: A list of expected intents to evaluate against.
IntentClassificationMetric
Class
IntentClassificationMetric
classifies and evaluates the intent behind text based on predefined expectations.
input
: The text to be classified.expectedIntents
: The expected intents against which the text will be evaluated.
evaluateSteps
method invokes classifyIntent
and returns a detailed result, including a score and reasons. The score reflects how closely the detected intent matches the expected intents, with detailed reasons explaining the similarities and differences.