Skip to content

Commit

Permalink
docs: document new load from hf and save
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmachan committed Oct 14, 2024
1 parent 5083f90 commit 4b5120a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
11 changes: 1 addition & 10 deletions docs/getstarted/rag_evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,7 @@ Converting data to ragas [evaluation dataset](../concepts/components/eval_datase
```python
from ragas import EvaluationDataset, SingleTurnSample

samples = []
for row in dataset['eval']:
sample = SingleTurnSample(
user_input=row['user_input'],
reference=row['reference'],
response=row['response'],
retrieved_contexts=row['retrieved_contexts']
)
samples.append(sample)
eval_dataset = EvaluationDataset(samples=samples)
eval_dataset = EvaluationDataset.from_hf_dataset(dataset["eval"])
```


Expand Down
15 changes: 3 additions & 12 deletions docs/howtos/migrations/migrate_from_v01_to_v02.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,13 @@ You can easily translate
from ragas import EvaluationDataset, SingleTurnSample

hf_dataset = ... # your huggingface evaluation dataset
samples = []
for row in hf_dataset:
sample = SingleTurnSample(
user_input=row['user_input'],
reference=row['reference'],
response=row['response'],
retrieved_contexts=row['retrieved_contexts']
)
samples.append(sample)
eval_dataset = EvaluationDataset(samples=samples)
eval_dataset = EvaluationDataset.from_hf_dataset(hf_dataset)

# save eval dataset
TODO
eval_dataset.to_csv("path/to/save/dataset.csv")

# load eva dataset
TODO
eval_dataset = EvaluationDataset.from_csv("path/to/save/dataset.csv")
```

## Metrics
Expand Down

0 comments on commit 4b5120a

Please sign in to comment.