langtest.augmentation.augmenter.DataAugmenter#

class DataAugmenter(task: str | TaskManager, config: str | dict)#

Bases: object

__init__(task: str | TaskManager, config: str | dict) None#

Initialize the DataAugmenter.

Parameters:
  • config (Union[str, dict]) – Configuration file or dictionary.

  • task (Union[str, TaskManager]) – Task Manager.

  • columns_info ([type], optional) – Columns information. Defaults to None.

Methods

__init__(task, config)

Initialize the DataAugmenter.

allocated_size(test_name)

allocation size of the test to be augmented

augment(data)

Augment the content.

extend(data, testcases)

Extend the content.

inplace(data, testcases)

Inplace augmentation.

load_config(config)

Load the configuration file.

new_data(data, testcases)

Create new data.

prepare_hash_map(data[, inverted])

save(file_path[, for_gen_ai])

Save the augmented data.

allocated_size(test_name: str) int#

allocation size of the test to be augmented

augment(data: str | Iterable) str#

Augment the content.

extend(data: Iterable, testcases: Iterable[Sample]) DataAugmenter#

Extend the content.

inplace(data: Iterable, testcases: Iterable[Sample]) DataAugmenter#

Inplace augmentation.

load_config(config: str) dict#

Load the configuration file.

new_data(data: Iterable, testcases: Iterable[Sample]) DataAugmenter#

Create new data.

save(file_path: str, for_gen_ai=False) None#

Save the augmented data.