Skip to main content

Dataset & Batch

Fair Forge uses two primary data structures to represent conversation data: Dataset and Batch.

Dataset

A Dataset represents a complete conversation session with an AI assistant.

Fields

Example

Batch

A Batch represents a single question-answer interaction within a conversation.

Fields

Field Details

A unique identifier for the interaction within the conversation. Use a consistent naming scheme:
The user’s input message or question. This is what the assistant is responding to:
The assistant’s actual response. This is what gets evaluated:
The expected or ideal response. Used by some metrics for comparison:
This is optional but recommended for metrics like Context and Conversational.
Additional context or notes about the interaction:
Metadata dictionary for storing additional information:
Used by generators to store query metadata.
Log probabilities from the model (if available):
Optional relative importance of this interaction when metrics aggregate scores at session level (Conversational, Context, Regulatory). Controls how much each QA pair contributes to the session mean.
If all weights are provided but do not sum to 1.0, a warning is emitted and equal weights are applied instead.

JSON Format

The data structures can be easily serialized to/from JSON:

Dataset JSON

Loading from JSON

Saving to JSON

Pydantic Validation

Both Dataset and Batch are Pydantic models with built-in validation:

Usage with Metrics

Different metrics use different fields:

Best Practices

Use Descriptive IDs

Choose meaningful qa_id values that help identify issues:

Include Ground Truth

When possible, include ground_truth_assistant for better evaluation:

Set Context Properly

The context field should contain system instructions:

Use Metadata

Store useful metadata in agentic for analysis:

Next Steps

Statistical Modes

Learn about Frequentist vs Bayesian analysis

Metrics Overview

See how metrics use these structures