langtest.transform.representation.EthnicityRepresentation#

class EthnicityRepresentation#

Bases: BaseRepresentation

Subclass of BaseRepresentation that implements the ethnicity 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 enthicity representation test.

transform(data, params)

param test:

name of the test

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 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 enthicity representation test.

Parameters:
  • sample_list (List[Sample]) – The input data to be evaluated for representation test.

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

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:

Ethnicity Representation test results.

Return type:

List[Sample]