'Customized sklearn Transformer to increase rows of X & Y (for text Augmentation)

Is it possible to create a customized sklearn Transformer that increase the # of rows of X & Ys. Basically what I would like to do is to augment the text (X, which is a 1D list of strings) based on NLP data augmentation method like translations, the new text will take the same label as the original one. The Transformer can then be added to a pipeline for downstream classifier say, BERT wrapped as sklearn classifier.

Thanks, Ying



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source