mindmeld.augmentation module

This module contains the data augmentation processes for MindMeld.

exception mindmeld.augmentation.UnsupportedLanguageError[source]

Bases: Exception

class mindmeld.augmentation.Augmentor(language, paths, path_suffix, resource_loader)[source]

Bases: abc.ABC

Abstract Augmentor class.

augment(**kwargs)[source]

Augments queries given initial queries in application.

augment_queries(queries)[source]

Generates augmented data given application queries.

Parameters:queries (list) -- List of queries.
Returns:List of augmented queries.
Return type:augmented_queries (list)
class mindmeld.augmentation.AugmentorFactory(config, language, resource_loader)[source]

Bases: object

Creates an Augmentor object.

config

dict -- A model configuration.

language

str -- Language for data augmentation.

resource_loader

object -- Resource Loader object for the application.

create_augmentor()[source]

Creates an augmentor instance using the provided configuration

Returns:An Augmentor class
Return type:Augmentor
Raises:ValueError -- When model configuration is invalid or required key is missing
class mindmeld.augmentation.EnglishParaphraser(batch_size, language, retain_entities, paths, path_suffix, resource_loader)[source]

Bases: mindmeld.augmentation.Augmentor

Paraphraser class for generating English paraphrases.

augment_queries(queries, **kwargs)[source]

Generates augmented data given application queries.

Parameters:queries (list) -- List of queries.
Returns:List of augmented queries.
Return type:augmented_queries (list)
class mindmeld.augmentation.MultiLingualParaphraser(batch_size, language, retain_entities, paths, path_suffix, resource_loader)[source]

Bases: mindmeld.augmentation.Augmentor

Paraphraser class for generating paraphrases based on language code of the app (currently supports: French, Italian, Portuguese, Romanian and Spanish).

augment_queries(processed_queries)[source]

Generates augmented data given application queries.

Parameters:queries (list) -- List of queries.
Returns:List of augmented queries.
Return type:augmented_queries (list)
mindmeld.augmentation.register_all_augmentors()[source]