# Add data augmentation process during training every epoch

**URL:** <https://discuss.huggingface.co/t/add-data-augmentation-process-during-training-every-epoch/3274>\
**Category:** Beginners\
**Created:** [January 19, 2021, 5:46am UTC](https://discuss.huggingface.co/t/add-data-augmentation-process-during-training-every-epoch/3274 "2021-01-19T05:46:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![yusukemori](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/yusukemori/32/23302_2.png) [@yusukemori](https://discuss.huggingface.co/u/yusukemori)\
**Post date:** [January 20, 2021, 3:52am UTC](https://discuss.huggingface.co/t/add-data-augmentation-process-during-training-every-epoch/3274/3 "2021-01-20T03:52:24Z")

</div>

Hi @sgugger

Thank you for the answer!  
I now understand for my purpose I should treat a `DataCollator` or `getitem` in a Dataset, depending on what I am trying to do, and the `Trainer` is not an appropriate place in which data augmentation is done.

Referring to your answer in my another question [How to use Seq2SeqTrainer (Seq2SeqDataCollator) in v4.2.1 - #5 by sgugger](https://discuss.huggingface.co/t/how-to-use-seq2seqtrainer-seq2seqdatacollator-in-v4-2-1/3243/5),  
I’ll consider the best way to implement to get something randomized in my case.

Thank you so much!

---

_[View the full topic](https://discuss.huggingface.co/t/add-data-augmentation-process-during-training-every-epoch/3274)._
