Harmanoal/toxicity-detection
0
General Toxicity Meter & Moderation Engine
Executive Summary
The General Toxicity Meter is an end-to-end deep learning content moderation engine designed to identify toxic, abusive, and fraudulent text entries in real-time. Built upon a Bidirectional Long Short-Term Memory (BiLSTM) neural network initialized with 100-dimensional pre-trained GloVe word embeddings, the system effectively resolves extreme class imbalance through targeted minority-class synthetic data augmentation.
Evaluated using a strict out-of-fold (OOF) validation strategy (70/15/15 split executed prior to tokenization to eliminate data leakage), the model demonstrates high precision and recall:
- Out-of-Fold PR-AUC:
0.8950(compared to a random baseline of0.0958) - Out-of-Fold ROC-AUC:
0.9818
Model Training & Loss Visualizations
Technical Architecture & Methodology
- Deep Learning Backbone: The model employs a Bidirectional LSTM architecture, processing textual sequences forwards and backwards to capture subtle contextual cues, negation modifiers, and long-range semantic dependencies.
- Transfer Learning via Embeddings: 100-dimensional GloVe vectors are injected during model initialization to provide semantic domain knowledge, followed by fine-tuning during supervised training.
- Synthetic Data Augmentation: Word-level augmentations (random deletion and random swapping) are applied exclusively to minority-class instances within the training folds to mitigate severe class imbalance without distorting evaluation metrics.
- Out-of-Fold Validation: A strict multi-fold split guarantees zero data leakage across tokenization and embedding steps. Model thresholding is calibrated at
0.65to optimize operational decision boundaries for production moderation workloads.
