Principle:Confident ai Deepeval Dataset Export
| Knowledge Sources | |
|---|---|
| Domains | |
| Last Updated | 2026-02-14 09:00 GMT |
Overview
Dataset export is the process of persisting evaluation datasets to portable file formats on disk. It enables sharing, versioning, and reproducibility of evaluation data by serializing EvaluationDataset contents to standard formats such as JSON, CSV, and JSONL.
Description
After generating or curating evaluation goldens, the data must be saved in a durable, portable format for downstream use. Dataset export addresses this by:
- Serializing to standard formats -- supporting JSON, CSV, and JSONL output, each suited to different consumption patterns (JSON for structured access, CSV for spreadsheet tools, JSONL for streaming pipelines).
- Preserving data fidelity -- ensuring that all golden fields (input, expected_output, context, source_file, additional_metadata) are faithfully represented in the output format.
- Enabling reproducibility -- saved datasets can be reloaded and re-evaluated to verify results or track evaluation quality over time.
- Supporting version control -- file-based exports can be committed to version control systems alongside application code, creating an auditable history of evaluation data.
In the DeepEval framework, dataset export is performed via the save_as method on EvaluationDataset, which writes the dataset contents to a specified directory in the chosen format.
Usage
Dataset export is used whenever evaluation data needs to be:
- Shared with team members who do not have access to the generation environment
- Archived for compliance or audit purposes
- Loaded into external tools or pipelines for analysis
- Version-controlled alongside application source code
Theoretical Basis
Dataset export applies established principles from data management:
- Data serialization -- converting in-memory data structures to byte-stream representations that can be stored and reconstructed. JSON and JSONL provide hierarchical serialization, while CSV provides tabular serialization.
- Format interoperability -- supporting multiple output formats (JSON, CSV, JSONL) ensures compatibility with diverse tools and workflows:
- JSON -- nested structure, human-readable, suitable for complex data with lists and nested objects.
- CSV -- flat tabular structure, widely supported by spreadsheet applications and data analysis tools.
- JSONL -- line-delimited JSON, optimized for streaming and append-only workflows.
The abstract export process follows this pattern:
DATASET_EXPORT(dataset, file_type, directory, file_name):
1. VALIDATE file_type is one of ("json", "csv", "jsonl")
2. SERIALIZE dataset goldens to the chosen format
3. WRITE serialized data to directory/file_name.{ext}
4. RETURN saved file path
Key properties:
- Lossless serialization -- all golden fields are preserved in the output.
- Deterministic output -- the same dataset produces identical output files.
- Configurable naming -- custom file names allow organizing exports by version, date, or experiment.