✍🏼 Generators#

class text_machina.src.generators.base.DatasetGenerator(config)[source]#

Bases: ABC

Base class for dataset generators.

add_config_info(dataset)[source]#

Adds config information to the dataset.

Parameters:

dataset (Dataset) – the dataset to add config information to.

Returns:

the dataset with config information added.

Return type:

Dataset

generate()[source]#

Generates a labeled dataset based on the provided config.

Returns:

the dataset

Return type:

Dataset

class text_machina.src.generators.detection.DetectionDatasetGenerator(config)[source]#

Bases: DatasetGenerator

Dataset generator for the detection task type.

class text_machina.src.generators.attribution.AttributionDatasetGenerator(config)[source]#

Bases: DatasetGenerator

Dataset generator for the attribution task type.

class text_machina.src.generators.boundary.BoundaryDatasetGenerator(config)[source]#

Bases: DatasetGenerator

Dataset generator for the boundary task type.

class text_machina.src.generators.mixcase.MixCaseDatasetGenerator(config)[source]#

Bases: DatasetGenerator

Dataset generator for the mixcase task type.

class text_machina.src.generators.mixcase.MixCaseGapPacker(config, extractor)[source]#

Bases: MixCasePacker

Packer for mixcase task type when using gap-based extractors.

class text_machina.src.generators.mixcase.MixCaseMaskPacker(config, extractor)[source]#

Bases: MixCasePacker

Packer for mixcase task type when using mask-based extractors.

class text_machina.src.generators.mixcase.MixCasePacker(config, extractor)[source]#

Bases: ABC

Base class for mixcase packers.

class text_machina.src.generators.mixcase.MixCaseRewritingPacker(config, extractor)[source]#

Bases: MixCasePacker

Packer for mixcase task type when using rewriting-based extractors.