Skip to main content
Dataloader APIs for loading benchmark datasets and converting them to Haystack or LangChain document formats.

DataloaderCatalog

Factory class for creating dataset loaders by name.

Methods

create

Create a dataset loader instance.
Literal
required
Dataset type name. Options: “triviaqa”, “arc”, “popqa”, “factscore”, “earnings_calls”
str
default:"test"
Dataset split to load (e.g., “train”, “test”, “validation”)
int
Optional limit on record count to load
str
Optional HuggingFace dataset ID override
BaseDatasetLoader
Configured dataset loader instance ready to load data

supported_datasets

Return list of supported dataset identifiers.
tuple[DatasetType, ...]
Tuple of supported dataset type names

LoadedDataset

Wrapper for normalized dataset records with conversion methods.

Constructor

DatasetType
required
Identifier of the dataset (e.g., “triviaqa”, “arc”)
list[DatasetRecord]
required
Normalized dataset records

Methods

records

Return normalized dataset records.
list[DatasetRecord]
List of normalized dataset records

to_dict_items

Convert normalized records to dictionary items.
list[dict[str, Any]]
List of dictionary representations of records

to_haystack

Convert records to Haystack documents.
list[HaystackDocument]
List of Haystack Document objects ready for indexing

to_langchain

Convert records to LangChain documents.
list[LangChainDocument]
List of LangChain Document objects ready for indexing

evaluation_queries

Extract evaluation queries from records.
int
Optional limit applied after deduplication
list[EvaluationQuery]
List of evaluation queries with ground truth answers for retrieval testing

BaseDatasetLoader

Base class for dataset loaders. All specific dataset loaders inherit from this class.

Supported Datasets

  • TriviaQALoader: TriviaQA question-answering dataset
  • ARCLoader: AI2 Reasoning Challenge (ARC) dataset
  • PopQALoader: PopQA popularity-based question-answering dataset
  • FactScoreLoader: FactScore factual consistency dataset
  • EarningsCallsLoader: Earnings calls transcripts dataset

Usage Examples

Load a dataset

List supported datasets