langtest.transform.representation.ReligionRepresentation#
- class ReligionRepresentation#
Bases:
BaseRepresentation
Subclass of BaseRepresentation that implements the religion representation test.
- alias_name#
The list of test names that identify the representation measure.
- Type:
List[str]
- supported_tasks#
name of the supported task for the representation measure
- Type:
List[str]
- __init__()#
Methods
__init__
()async_run
(sample_list, model, **kwargs)Creates a task for the run method.
run
(sample_list, model, **kwargs)Computes the actual representation of religion names in the data.
transform
(test, data, params)Compute the religion representation measure
Attributes
test_types
- async classmethod async_run(sample_list: List[Sample], model: ModelAPI, **kwargs)#
Creates a task for the run method.
- Parameters:
sample_list (List[Sample]) – The input data to be evaluated for representation test.
model (ModelAPI) – The model to be used for the computation.
- Returns:
The task for the run method.
- Return type:
asyncio.Task
- async static run(sample_list: List[Sample], model: ModelAPI, **kwargs) List[Sample] #
Computes the actual representation of religion names in the data.
- Parameters:
sample_list (List[Sample]) – The input data to be evaluated for representation test.
model (ModelAPI) – The model to be evaluated.
- Returns:
Religion Representation test results.
- Return type:
List[Sample]
- classmethod transform(test: str, data: List[Sample], params: Dict) List[MinScoreQASample] | List[MinScoreSample] #
Compute the religion representation measure
- 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:
Religion Representation test results.
- Return type:
Union[List[MinScoreQASample], List[MinScoreSample]]