langtest.transform.representation.GenderRepresentation#
- class GenderRepresentation#
Bases:
BaseRepresentation
Subclass of BaseRepresentation that implements the gender representation test.
- alias_name#
The list of test names that identify the representation measure.
- Type:
List[str]
- __init__()#
Methods
__init__
()async_run
(sample_list, model, **kwargs)Creates a task for the run method.
run
(model, **kwargs)Computes the actual results for the Gender Representation test.
transform
(data, params)- param test:
name of the test
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 evaluated for representation test.
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[Sample] #
Computes the actual results for the Gender Representation test.
- Parameters:
sample_list (List[Sample]) – The input data to be evaluated for representation test.
model (ModelFactory) – The model factory object.
- Returns:
The list of samples with actual results.
- Return type:
List[Sample]
- transform(data, params)#
- Parameters:
test (str) – name of the test
data (List[Sample]) – The input data to be evaluated for representation test.
params – parameters specified in config.
- Raises:
ValueError – If sum of specified proportions in config is greater than 1
- Returns:
Gender Representation test results.
- Return type:
List[Sample]