langtest.transform.disinformation.DisinformationTestFactory#

class DisinformationTestFactory(data_handler: List[Sample], tests: Dict | None = None, **kwargs)#

Bases: ITests

Factory class for disinformation test

__init__(data_handler: List[Sample], tests: Dict | None = None, **kwargs) None#

Methods

__init__(data_handler[, tests])

async_run(model, *args, **kwargs)

available_tests()

Returns a list of available test scenarios for the test class.

run(sample_list, model, **kwargs)

Runs the specified tests on the given data and returns a list of results.

transform()

Runs the test and returns the results.

Attributes

alias_name

supported_tasks

classmethod available_tests() Dict[str, str]#

Returns a list of available test scenarios for the test class.

Returns:

A list of available test scenarios for the test class.

Return type:

List[str]

async classmethod run(sample_list: List[Sample], model: ModelAPI, **kwargs) List[Sample]#

Runs the specified tests on the given data and returns a list of results.

Parameters:
  • sample_list (Dict[str, List[Sample]]) – A dictionary mapping test scenario names to a list of Sample objects.

  • model (ModelAPI) – A ModelAPI object representing the model to be tested.

Returns:

A list of Sample objects with the test results.

Return type:

List[Sample]

transform() List[Sample]#

Runs the test and returns the results.

Returns:

A list of results from running the test.

Return type:

List[Results]