CrucibleDatasets.Dataset (CrucibleDatasets v0.5.4)
View SourceUnified dataset representation across all benchmark types.
All datasets follow this schema regardless of source (MMLU, HumanEval, GSM8K, custom).
Summary
Functions
Filter dataset items by predicate.
Create a new dataset with validation.
Shuffle multiple-choice options while preserving correct answer mapping.
Slice dataset by index range or start/count.
Sort dataset items by key function or atom.
Validate dataset schema.
Types
@type item() :: %{ :id => String.t(), :input => input_type(), :expected => expected_type(), optional(:metadata) => map() }
Functions
Filter dataset items by predicate.
Examples
iex> dataset |> Dataset.filter(fn item ->
...> item.metadata.difficulty == "hard"
...> end)
Create a new dataset with validation.
Shuffle multiple-choice options while preserving correct answer mapping.
Options
:seed- Random seed for reproducible shuffling
Examples
iex> dataset |> Dataset.shuffle_choices(seed: 42)
Slice dataset by index range or start/count.
Examples
iex> dataset |> Dataset.slice(0..9) # First 10 items
iex> dataset |> Dataset.slice(10, 5) # 5 items starting at index 10
@spec slice(t(), non_neg_integer(), non_neg_integer()) :: t()
Sort dataset items by key function or atom.
Examples
iex> dataset |> Dataset.sort(fn item -> item.id end)
iex> dataset |> Dataset.sort(:id, :desc)
Validate dataset schema.