nlptest.transform.fairness.MaxGenderF1Score#
- class MaxGenderF1Score#
Bases:
BaseFairness
Subclass of BaseFairness that implements the maximum F1 score.
- alias_name#
The name identifying the test.
- Type:
str
- transform(data
List[Sample]) -> List[Sample]: Transforms the
- input data into an output samples.
- __init__()#
Methods
__init__
()async_run
(sample_list, model, **kwargs)Creates a task for the run method.
run
(model, **kwargs)Computes the gendered max F1 score tests for the given data.
transform
(data, params)Computes the gendered max F1 score tests for the given data.
Attributes
- 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[MaxScoreSample] #
Computes the gendered max F1 score tests for the given data.
- Parameters:
sample_list (List[MaxScoreSample]) – The input data to be transformed.
model (ModelFactory) – The model to be tested.
- Returns:
The transformed samples.
- Return type:
List[MaxScoreSample]
- static transform(data: List[Sample], params)#
Computes the gendered max F1 score tests for the given data.
- Parameters:
data (List[Sample]) – The input data to be transformed.
- Returns:
The transformed samples.
- Return type:
List[Sample]