langtest.tasks.task.Stereoset#

class Stereoset#

Bases: BaseTask

StereoSet Stereotype

__init__()#

Methods

__init__()

column_mapping(item_keys, columns_names, ...)

Return the column mapping.

create_sample(row_data[, bias_type, ...])

Create a sample.

load_model(model_path, model_hub, *args, ...)

Load the model.

Attributes

get_sample_cls

Return the sample class.

task_registry

column_mapping(item_keys, columns_names, *args, **kwargs)#

Return the column mapping.

create_sample(row_data: dict, bias_type: str = 'bias_type', test_type: str = 'type', target_column: str = 'target', context: str = 'context', sent_stereo: str = 'stereotype', sent_antistereo: str = 'anti-stereotype', sent_unrelated: str = 'unrelated', *args, **kwargs) StereoSetSample#

Create a sample.

property get_sample_cls#

Return the sample class.

classmethod load_model(model_path: str, model_hub: str, *args, **kwargs)#

Load the model.

sample_class#

alias of StereoSetSample