# Use of Data Augmentation Techniques in Detection of
## 2 Data Augmentation
### Easy Data Augmentation  
EDA consists of augmentation techniques developed and evaluated in [39]. This set of methods uses traditional and straightforward approaches to increase the volume of data. These techniques create new data so that the meaning and grammatical structure of the original data are preserved. EDA consists of the following four methods that prevent model learning and help train more robust models:  
* **Synonyms replacement**--this method creates new samples of textual documents by the replacement of suitable words from the text with their synonyms which retain the meaning of the text. The user needs to provide the parameter \(n\), which specifies how many words will be replaced by their synonyms in the given sentence. Users must also focus on selecting the right words and appropriate synonyms that do not change the meaning of the text. In our research, we used the Wordnet lexical database for the English language, which is available in the NLTK library in Python. In addition, we used the Stopwords dictionary (a corpus containing English stop words) to identify nonmeaningful words in the data. An example of this method on the toxic comments dataset used in the study is as follows: _All_ _stupid, no brains, is a more **accurate** description of [PERSON]_ _Wholly_ _stupid, no brains, is a more **precise** description of [PERSON]._
* **Random insertion**--this method works with synonyms of selected words as in the previous method. However, the difference is that \(n\) synonyms of the words chosen are randomly inserted at different positions in the text. The random insertion of the synonyms of certain words from the text, as opposed to a synonyms replacement, can be more relevant to a given context, as it retains the original evaluation of the text. The method is specified by the number of full-meaning words whose synonyms are randomly inserted at particular positions. An example of an application of this method on a sample record from the toxic comments database is as follows: _Presidents are unpredictable. What do you **think** we should do about it, shoot him in the back?_ _Presidents are unpredictable. What **recover** do you think we should do **chairperson retrieve** about it, shoot him in the back?_
* **Random swap**--unlike previous methods, this method does not use synonyms to create new samples. This method aims to select two random words that swap positions in the text. The user specifies parameter \(n\), which defines how many pairs of words should exchange positions in the text. This method could help the model to be more robust. However, a very high number of words exchanged can worsen the model due to a change in the meaning of the text. An illustrative example of this method on the toxic comments dataset is as follows: _Only **wishful** thinking on **your part**--simple and silly **imagiting**. something would happen that **isu't realistic**. Only **your** thinking on **wishful isn't**--simple and silly **realistic**. something would happen that **part imagining**._* **Random deletion--**the goal of this method is to randomly remove words in the text with a certain probability specified by a parameter \(p\). It is necessary to choose the probability appropriately so we do not delete many words from the text. The text in the toxic comments dataset after applying this augmentation technique is changed as follows: _Funny you should link [PERSON] and [PERSON]. They are both grifters, **playing** the poorly educated for fools. _Funny should link [PERSON] and [PERSON]. They are both grifters, the poorly educated for fools._  
The EDA provides simple methods for increasing the training data volume, but it is important to follow certain rules for the methods to work properly. In each method, it is necessary to correctly choose the number of words to be replaced, inserted, deleted, or replaced so that the meaning and structure of the text are preserved. For text with a small number of words, the meaning of the text is more likely to change.