retrieval_context
are ranked higher than irrelevant ones, based on their contribution to answering the user’s query.
High contextual precision means that the retriever is efficiently surfacing the most useful information near the top.
Evaluation Parameters
To compute thecontextual_precision
metric, the following are required:
input
: The user’s query.retrieval_context
: The list of retrieved documents or nodes, in ranked order.
How Is It Calculated?
The score is calculated as follows:- Relevance Annotation: An LLM identifies which items in the
retrieval_context
are relevant to theinput
. - Ranking Evaluation: It checks whether relevant items appear near the top of the list.
This metric was incorporated to the Galtea platform from the open source library deepeval, for more information you can also visit their documentation.