Replication Functions

Available functions:

  • replace_word_with_synonym(word): Replace the given word with a synonym.

  • augment_text_with_synonyms(text, augmentation_factor, probability, progress=True): Augment the input text by replacing words with synonyms.

  • load_text_file(filepath): Load the contents of a text file.

  • augment_file_with_synonyms(file_path, augmentation_factor, probability, progress=True): Augment a text file by replacing words with synonyms.

  • insert_random_word(text, word): Insert a random word into the input text.

  • delete_random_word(text): Delete a random word from the input text.

  • random_word_deletion(text, num_deletions=1): Delete a random word from the input text.

  • swap_random_words(text): Swaps two random words in the text.

  • insert_synonym(text, word): Insert a synonym of the given word into the input text.

  • paraphrase(text): Paraphrase the input text.

  • flip_horizontal(image): Flip the input image horizontally.

  • flip_vertical(image): Flip the input image vertically.

  • rotate(image, angle): Rotate the input image by a specified angle.

  • random_rotation(image, max_angle): Randomly rotate the input image by an angle within the specified range.

  • resize(image, size): Resize the input image to the specified size.

  • crop(image, box): Crop the input image to the specified rectangular region.

  • random_crop(image, size): Randomly crop a region from the input image.

  • shuffle_words(text): Randomly shuffle the order of words in each sentence.

  • random_flip(image, horizontal, vertical): Randomly flip the input image horizontally and/or vertically.

  • random_color_jitter(image, brightness, contrast, saturation, hue): Randomly adjust the brightness, contrast, saturation, and hue of the input image.

  • noise_overlay(image, noise_factor, noise_type, grain_factor): Overlay noise on the input image.


Replace word with synonym

Replace the given word with a synonym.

Augment text with synonyms

Augment the input text by replacing words with synonyms.

Load text file

Load the contents of a text file.

Augment file with synonyms

Augment a text file by replacing words with synonyms.

Insert random word

Insert a random word into the input text.

Delete random word

Delete a random word from the input text.

Insert synonym

Insert a synonym of the given word into the input text.

Paraphrase

Paraphrase the input text.

Flip horizontal

Flip the input image horizontally.

Flip vertical

Flip the input image vertically.

Rotate

Rotate the input image by a specified angle.

Random rotation

Randomly rotate the input image by an angle within the specified range.

Resize

Resize the input image to the specified size.

Crop

Crop the input image to the specified rectangular region.

Random crop

Randomly crop a region from the input image.

Shuffle words

This function takes a list of sentences and randomly shuffles the order of words in each sentence, creating variations for text augmentation or diversity.

Random flip

This function randomly flips an input image horizontally, vertically, or even both.

Random color jitter

This function takes an input image and randomly adjusts the brightness, contrast, saturation, and hue.

Noise overlay

This function overlays noise onto the input image.

Random word deletion

This function randomly deletes a word from the input text, creating variations for text augmentation or diversity.

Swap random words

This function randomly swaps two words in the input text, creating variations for text augmentation or diversity.

Last updated

Was this helpful?