Measures how accurate is the retrieval compared to expected contexts, increasing it means less noise in the retrieval. Uses traditional string distance metrics.
POST
/
ragas
/
context_precision
/
evaluate
Copy
import langwatchdf = langwatch.datasets.get_dataset("dataset-id").to_pandas()experiment = langwatch.experiment.init("my-experiment")for index, row in experiment.loop(df.iterrows()): # your execution code here experiment.evaluate( "ragas/context_precision", index=index, data={ "contexts": row["contexts"], "expected_contexts": row["expected_contexts"], }, settings={} )