paddlespeech.s2t.frontend.augmentor.base module

Contains the abstract base class for augmentation models.

class paddlespeech.s2t.frontend.augmentor.base.AugmentorBase[source]

Bases: object

Abstract base class for augmentation model (augmentor) class. All augmentor classes should inherit from this class, and implement the following abstract methods.

Methods

__call__(xs)

Call self as a function.

transform_audio(audio_segment)

Adds various effects to the input audio segment.

transform_feature(spec_segment)

Adds various effects to the input audo feature segment.

abstract transform_audio(audio_segment)[source]

Adds various effects to the input audio segment. Such effects will augment the training data to make the model invariant to certain types of perturbations in the real world, improving model's generalization ability.

Note that this is an in-place transformation.

Parameters:

audio_segment (AudioSegmenet|SpeechSegment) -- Audio segment to add effects to.

abstract transform_feature(spec_segment)[source]

Adds various effects to the input audo feature segment. Such effects will augment the training data to make the model invariant to certain types of time_mask or freq_mask in the real world, improving model's generalization ability.

Args:

spec_segment (Spectrogram): Spectrogram segment to add effects to.