CoolFace
Apppublic

Harmanoal/toxicity-detection

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
App README

General Toxicity Meter & Moderation Engine

Python TensorFlow FastAPI PR-AUC ROC-AUC

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 of 0.0958)
  • —Out-of-Fold ROC-AUC: 0.9818

Model Training & Loss Visualizations

[image]


Technical Architecture & Methodology

  1. 1.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.
  2. 2.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.
  3. 3.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.
  4. 4.Out-of-Fold Validation: A strict multi-fold split guarantees zero data leakage across tokenization and embedding steps. Model thresholding is calibrated at 0.65 to optimize operational decision boundaries for production moderation workloads.