nlptest.transform.fairness.MinGenderF1Score#

class MinGenderF1Score#

Bases: BaseFairness

Subclass of BaseFairness that implements the minimum F1 score.

alias_name#

The name “min_f1” identifying the minimum F1 score.

Type:

str

transform(data

List[Sample]) -> Any: Transforms the input data into

an output based on the minimum F1 score.
__init__()#

Methods

__init__()

async_run(sample_list, model, **kwargs)

Creates a task for the run method.

run(model, **kwargs)

Computes the minimum F1 score for the given data.

transform(data, params)

Computes the minimum F1 score for the given data.

Attributes

alias_name

async classmethod async_run(sample_list: List[Sample], model: ModelFactory, **kwargs)#

Creates a task for the run method.

Parameters:
  • sample_list (List[Sample]) – The input data to be transformed.

  • model (ModelFactory) – The model to be used for the computation.

Returns:

The task for the run method.

Return type:

asyncio.Task

async run(model: ModelFactory, **kwargs) List[MinScoreSample]#

Computes the minimum F1 score for the given data.

Parameters:
  • sample_list (List[MinScoreSample]) – The input data to be transformed.

  • model (ModelFactory) – The model to be used for the computation.

Returns:

The transformed samples.

Return type:

List[MinScoreSample]

static transform(data: List[Sample], params)#

Computes the minimum F1 score for the given data.

Parameters:

data (List[Sample]) – The input data to be transformed.

Returns:

The transformed data based on the minimum F1 score.

Return type:

Any