import langwatch
df = 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_f1",
index=index,
data={
"contexts": row["contexts"],
"expected_contexts": row["expected_contexts"],
},
settings={}
)[
{
"score": 123,
"passed": true,
"label": "<string>",
"details": "<string>",
"cost": {
"currency": "<string>",
"amount": 123
}
}
]RAG Quality
Context F1
Balances between precision and recall for context retrieval, increasing it means a better signal-to-noise ratio. Uses traditional string distance metrics.
POST
/
ragas
/
context_f1
/
evaluate
import langwatch
df = 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_f1",
index=index,
data={
"contexts": row["contexts"],
"expected_contexts": row["expected_contexts"],
},
settings={}
)[
{
"score": 123,
"passed": true,
"label": "<string>",
"details": "<string>",
"cost": {
"currency": "<string>",
"amount": 123
}
}
]Authorizations
API key for authentication
Body
application/json
Response
Successful evaluation
Was this page helpful?
⌘I