> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# datasets

## load\_dataset

```python theme={null}
def load_dataset(dataset: Union['Dataset', list[dict[str, Any] | str], str, None],
                 dataset_id: str | None,
                 dataset_name: str | None) -> Optional['Dataset']
```

Load dataset based on provided parameters.

**Arguments**

* `dataset`: Dataset object, list of records, or dataset name
* `dataset_id`: ID of the dataset
* `dataset_name`: Name of the dataset

**Raises**

* `ValueError`: If no dataset information is provided or dataset doesn't exist

**Returns**

* `Dataset object or None`:

## load\_dataset\_and\_records

```python theme={null}
def load_dataset_and_records(dataset: Union['Dataset', list[dict[str, Any] | str], str, None],
                             dataset_id: str | None,
                             dataset_name: str | None) -> tuple[Optional['Dataset'], list[DatasetRecord]]
```

Load dataset and records based on provided parameters.

**Arguments**

* `dataset`: Dataset object, list of records, or dataset name
* `dataset_id`: ID of the dataset
* `dataset_name`: Name of the dataset

**Raises**

* `ValueError`: If no dataset information is provided or dataset doesn't exist

**Returns**

* `Tuple containing (Dataset object or None, records list)`:

## normalize\_dataset\_rows

```python theme={null}
def normalize_dataset_rows(rows: list[dict[str, Any]]) -> list[dict[str, Any]]
```

Normalize dataset rows by renaming `ground_truth` to `output`.

Allows callers to use either field name. `output` takes precedence when both
are present. The caller's original dicts are never mutated.

## remap\_output\_to\_ground\_truth

```python theme={null}
def remap_output_to_ground_truth(content: DatasetContent) -> DatasetContent
```

Renames 'output' back to 'ground\_truth' in DatasetContent returned by the API.

The API stores ground\_truth as 'output' internally. This is the inverse of
normalize\_dataset\_rows, applied when reading content back out.
