ViToxReduce is a Python library designed for controlled, span-level reduction of toxic expressions in user-generated comment text. The library provides a modular processing pipeline that combines toxic span identification with localized text rewriting, enabling minimal intervention while preserving the original semantic context of a comment. Instead of modifying entire sentences, ViToxReduce targets only harmful lexical spans embedded within otherwise neutral text. The software supports offline execution and batch processing, making it suitable for comment sanitization, dataset preprocessing, and post-processing in text moderation workflows. Its functionality is demonstrated through an applied Vietnamese social media case study.
Le et al. (Fri,) studied this question.