Skip to content

Spreadsheet dataset

Spreadsheet Dataset Class.

This class is a wrapper around the Spreadsheet dataset class. The dataset is loaded from a Google Sheet and converted to a Hugging Face dataset.

Authors

Christina Alexandra (christina.alexandra@gdplabs.id)

References

NONE

SpreadsheetDataset(dataset)

Bases: BaseDataset

Spreadsheet dataset class for the evaluator.

Attributes:

Name Type Description
dataset list[MetricInput]

The dataset to use for the evaluation.

Initialize the SpreadsheetDataset class.

Parameters:

Name Type Description Default
dataset Dataset

The dataset to use for the evaluation.

required

from_gsheets(sheet_id, worksheet_name, client_email, private_key) async staticmethod

Load the dataset from Google Sheets.

Parameters:

Name Type Description Default
sheet_id str

The ID of the Google Sheet.

required
worksheet_name str

The name of the worksheet within the Google Sheet.

required
client_email str

The client email for Google Sheets API.

required
private_key str

Base64-encoded private key for Google Sheets API.

required

Returns:

Name Type Description
SpreadsheetDataset SpreadsheetDataset

The loaded dataset.

load()

Load the dataset.

Returns:

Type Description
list[MetricInput]

list[MetricInput]: The loaded dataset.

validate()

Validate the dataset.

Raises:

Type Description
ValueError

If the dataset is not a list of MetricInput.