Self-supervised text de-stylization based on BERT
Abstract
Recent advancements in Natural Language Processing (NLP) have ushered in a new era of textual style transfer (TST), a domain aimed at altering textual attributes such as tone and sentiment while preserving the content's essence. This study introduces a creative framework that employs a dual-component architecture consisting of a classifier and a generator to achieve text de-stylization, particularly sentiment neutralization. The classifier, built upon the Bidirectional Encoder Representations from Transformers (BERT) model, serves as a dynamic loss function guiding the generator, constructed on a Transformer-based encoder-decoder framework, to produce sentiment-neutral text. Our method leverages a self-supervised mechanism, enabling the generation of target text without reliance on parallel corpora, thereby addressing the limitations of existing TST methodologies. We preprocessed datasets from Stanford Sentiment Treebank-5 (SST-5) and Internet Movie Database (IMDb) movie reviews and employed them for training the classifier and generator, respectively. Preliminary results demonstrate the model's proficiency in preserving semantic integrity while effectively neutralizing sentiment. Future work envisions expanding this framework to enable text stylization across a spectrum of discursive contexts, enhanced by deep learning architectures and an iterative feedback mechanism for user-driven refinement.
References
- Xu W, Long C, Wang R, et al. Drb-gan: A dynamic resblock generative adversarial network for artistic style transfer[C] In Proceedings of the IEEE/CVF international conference on computer vision. 2021: 6383-6392.
- Jhamtani H, Gangal V, Hovy E, et al. Shakespearizing modern language using copy-enriched sequence-to-sequence models[J]. arXiv preprint arXiv:1707.01161, 2017.
- Olohan M. Intercultural faultlines: research models in translation studies: v. 1: textual and cognitive aspects[M]. Routledge, 2017.
- Devlin J, Chang M W, Lee K, et al. Bert: Pre-training of deep bidirectional transformers for language understanding[C] In Proceedings of naacL-HLT. 2019, 1: 2.
- Wu Y, Schuster M, Chen Z, et al. Google's neural machine translation system: Bridging the gap between human and machine translation[J]. arXiv preprint arXiv:1609.08144, 2016.
- Li J, Jia R, He H, et al. Delete, Retrieve, Generate: a Simple Approach to Sentiment and Style Transfer[C] In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers). 2018: 1865-1874.
- Andreieva, V. and Shvai, N. Generalization of Cross-Entropy Loss Function for Image Classification [J]. Mohyla Mathematical Journal, 2021, 3, pp.3–10.
- Sutskever I, Vinyals O, Le Q V. Sequence to sequence learning with neural networks[J]. Advances in neural information processing systems, 2014, 27.
- Chelba C, Chen M, Bapna A, et al. Faster transformer decoding: N-gram masked self-attention[J]. arXiv preprint arXiv:2001.04589, 2020.
- Wen Z, Li Y. The mechanism of prediction head in non-contrastive self-supervised learning[J]. Advances in Neural Information Processing Systems, 2022, 35: 24794-24809.
- Ahmet A, Abdullah T. Recent trends and advances in deep learning-based sentiment analysis[J]. Deep learning-based approaches for sentiment analysis, 2020: 33-56.
- Radford A, Wu J, Child R, et al. Language models are unsupervised multitask learners[J]. OpenAI blog, 2019, 1(8): 9.
- Liu X, Meng G, Xiang S, et al. Fontgan: A unified generative framework for chinese character stylization and de-stylization[J]. arXiv preprint arXiv:1910.12604, 2019.
- Mao W, Su Z, Luo J, et al. A Unified Acceleration Solution Based on Deformable Network for Image Pixel Processing[J]. IEEE Transactions on Circuits and Systems II: Express Briefs, 2023 (99): 1-1.
- Sarker I H. Deep learning: a comprehensive overview on techniques, taxonomy, applications and research directions[J]. SN Computer Science, 2021, 2(6): 420.