Paraphrasing

class augmentation.paraphrase.paraphrasing.ParaPhrasing

Bases: object

Class loads pegasus model for text augmentation

static paraphrases(input_text, num_return_sequences=10, num_beams=20)

generates variations for a given sentence/text

Parameters:
  • input_text – sentence or text

  • num_return_sequences – Number of variations to be returned

  • num_beams – Number of beams for beam search. 1 means no beam search

Returns:

list of variations of the input text