Introducing Confident Monitor

Turn Relevancy

Turn Relevancy is a multi-turn metric to determine if your chatbot responses are releveant to user input

Overview

The turn relevancy metric is a multi-turn metric that uses LLM-as-a-judge to evaluate whether your chatbot’s responses are relevant to the corresponding user inputs at each turn in the conversation.

Required Parameters

These are the parameters you must supply in your test case to run evaluations for turn relevancy metric:

turnslist of TurnRequired

A list of Turns as exchanges between user and assistant.

Parameters of Turn:

roleuser | assistantRequired

The role of the person speaking, it's either user or assistant

contentstringRequired

The content provided by the role for the turn

How Is It Calculated?

The turn relevancy metric loops over all the turns to find the assistant turns and uses an LLM to see if the corresponding turn's content is relevant to the previous user turn's content.


Turn Relevancy=Number of Assistant Turns with Relevant Assistant ContentTotal Number of Assistant Turns\text{Turn Relevancy} = \frac{\text{Number of Assistant Turns with Relevant Assistant Content}}{\text{Total Number of Assistant Turns}}

The final score is the proportion of assisant turns that give relevant output in the conversation.

Usage

To run the turn relevancy metric on Confident AI, add it to a single-turn metric collection. This will allow you to use turn relevancy metric for:

  • Multi-turn E2E testing
  • Online and offline evals for traces and spans

Last updated on

Built byConfident AI