Skip to main content
Context relevance score measures if the retrieved context has enough information to answer the question being asked. This check is important since a bad context reduces the chances of the model giving a relevant response to the question asked, as well as leads to hallucinations. You can read our blog to learn more about why context relevance is important. Columns required:
  • question: The question asked by the user
  • context: Information retrieved to answer the question

How to use it?

By default, we are using GPT 3.5 Turbo for evaluations. If you want to use a different model, check out this tutorial.
Sample Response:
A higher context relevance score reflects that retrieved context is relevant to the question asked.
The question is asking about “the capital city of France”. The context though contains some information about France, there is no refeence to the capital city of France i.e. Paris. Which makes the context irrelevant for the given question, ultimately resulting in a low context relevance score.

How it works?

We evaluate context relevance by determining which of the following three cases apply for the given task data:
  • The extracted context can answer the given query completely.
  • The extracted context can give some relevant answer for the given query, but can’t answer it completely.
  • The extracted context doesn’t contain any information to answer the given query.

Tutorial

Open this tutorial in GitHub

Have Questions?

Join our community for any questions or requests