Skip to main content

Overview

The Retriever is the data entry point for every Gaussia evaluation. You subclass it and implement load_dataset() to return your conversation data in the Dataset format.

The interface

Any keyword arguments passed to Metric.run(MyRetriever, **kwargs) are forwarded to your retriever’s __init__.

Iteration levels

Full dataset (default)

Loads the entire dataset into memory. Best for small to medium datasets.

Stream sessions

Yields one Dataset (session) at a time. Ideal for large datasets or database-backed sources.

Stream batches

Yields individual QA pairs wrapped in StreamedBatch. Useful for real-time or event-driven evaluation.

Passing configuration

Configuration flows from Metric.run() kwargs through to your retriever:
When using STREAM_BATCHES or STREAM_SESSIONS with a generator, you cannot use FULL_DATASET iteration level. Gaussia will raise a ValueError if a generator is returned with FULL_DATASET.