class_docstr: This class is an implementation of the original EDA algorithm (2019) [1].
  
  [1] Wei, J. and Zou, K., 2019, November. EDA: Easy Data Augmentation Techniques for Boosting Performance on
  Text Classification Tasks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing
  and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) (pp. 6383-6389).
  https://www.aclweb.org/anthology/D19-1670.pdf
  
  Example usage: ::
      >>> from textaugment import EDA
      >>> t = EDA()
      >>> t.synonym_replacement("John is going to town",top_n=3)
      John is give out to town
      >>> t.random_deletion("John is going to town", p=0.2)
      is going to town
      >>> t.random_swap("John is going to town")
      John town going to is
      >>> t.random_insertion("John is going to town")
      John is going to make up town
class_docstr_tok: ["This","class","is","an","implementation","of","the","original","EDA","algorithm","(","2019",")","[","1","]",".","[","1","]","Wei",",","J.","and","Zou",",","K.",",","2019",",","November",".","EDA",":","Easy","Data","Augmentation","Techniques","for","Boosting","Performance","on","Text","Classification","Tasks",".","In","Proceedings","of","the","2019","Conference","on","Empirical","Methods","in","Natural","Language","Processing","and","the","9th","International","Joint","Conference","on","Natural","Language","Processing","(","EMNLP-IJCNLP",")","(","pp",".","6383-6389",")",".","https",":","\/\/www.aclweb.org\/anthology\/D19-1670.pdf","Example","usage",":",":",":",">",">",">","from","textaugment","import","EDA",">",">",">","t","=","EDA","(",")",">",">",">","t.synonym_replacement","(","``","John","is","going","to","town","''",",","top_n=3",")","John","is","give","out","to","town",">",">",">","t.random_deletion","(","``","John","is","going","to","town","''",",","p=0.2",")","is","going","to","town",">",">",">","t.random_swap","(","``","John","is","going","to","town","''",")","John","town","going","to","is",">",">",">","t.random_insertion","(","``","John","is","going","to","town","''",")","John","is","going","to","make","up","town"]
docstr: Randomly swap two words in the sentence n times
  
  :type sentence: str
  :param sentence: Sentence
  :type n: int
  :param n: Number of repetitions to swap
  
  :rtype:   str
  :return:  Augmented sentence
docstr_tok: ["Randomly","swap","two","words","in","the","sentence","n","times",":","type","sentence",":","str",":","param","sentence",":","Sentence",":","type","n",":","int",":","param","n",":","Number","of","repetitions","to","swap",":","rtype",":","str",":","return",":","Augmented","sentence"]
code: def random_swap(self, sentence: str, n: int = 1):
      """Randomly swap two words in the sentence n times
  
      :type sentence: str
      :param sentence: Sentence
      :type n: int
      :param n: Number of repetitions to swap
  
      :rtype:   str
      :return:  Augmented sentence
      """
      self.validate(sentence=sentence, n=n)
      self.n = n
      self.sentence = sentence
      words = sentence.split()
      new_words = words.copy()
      for _ in range(self.n):
          new_words = self.swap_word(new_words)
      return " ".join(new_words)
  
file_path: textaugment/textaugment/eda.py
imports: import nltk
  from nltk.corpus import wordnet, stopwords
  import random
label_desc: Use image node_id 8 for calling the EDA obj's underlying member method code with example usage: obj.random_swap(sentence, n) and returns: str