This code is an adaptation of the original one available at the end of the official paper: SwitchOut: an Efficient Data Augmentation Algorithm for Neural Machine Translation*
I just made few tweaks to make it work with:
- python 3.9.13
- numpy==1.22.4
- torch==1.11.0
*source:
Xinyi Wang, Hieu Pham, Zihang Dai, and Graham Neubig. 2018.
SwitchOut: an Efficient Data Augmentation Algorithm for Neural Machine Translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing,
pages 856–861, Brussels, Belgium. Association for Computational Linguistics.