mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-30 00:18:32 +02:00
add inline comments to code snippets
This commit is contained in:
+1
@@ -117,6 +117,7 @@ def retrieval_run(golden_set: list, collection: str, k: int = 10) -> Run:
|
||||
query=entry["query_vector"],
|
||||
limit=k,
|
||||
).points
|
||||
# p.id type must match the doc_id type in labels (ranx matches by equality).
|
||||
run[entry["query_id"]] = {p.id: p.score for p in results}
|
||||
return Run(run)
|
||||
|
||||
|
||||
+2
-1
@@ -119,12 +119,13 @@ Pass the eval samples into `evaluate()` with those three metrics:
|
||||
|
||||
```python
|
||||
from ragas import EvaluationDataset, evaluate
|
||||
from ragas.metrics import faithfulness, answer_relevancy, context_precision
|
||||
from ragas.metrics.collections import faithfulness, answer_relevancy, context_precision
|
||||
|
||||
dataset = EvaluationDataset(samples=samples)
|
||||
scores = evaluate(
|
||||
dataset,
|
||||
metrics=[faithfulness, answer_relevancy, context_precision],
|
||||
# For a non-OpenAI judge, pass llm= and embeddings= (see Ragas docs).
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user