| --- |
| license: mit |
| tags: |
| - toxicity-detection |
| - distillseq |
| - deepseek |
| pipeline_tag: text-classification |
| language: |
| - en |
| library_name: pytorch |
| --- |
| |
| # DISTILLSEQ - DEEPSEEK - Classification (2 classes) |
|
|
| Toxicity prediction model trained on the DEEPSEEK dataset. |
|
|
| | Property | Value | |
| |----------|-------| |
| | Model | DISTILLSEQ | |
| | Task | Classification (2 classes) | |
| | Dataset | deepseek | |
| | Framework | PyTorch / PyTorch Lightning | |
|
|
|
|
| ## Model Information |
|
|
| See the ToxicThesis repository for model class documentation. |
|
|
|
|
|
|
| ## Usage |
|
|
| ```python |
| from huggingface_hub import hf_hub_download |
| import torch |
| |
| checkpoint_path = hf_hub_download( |
| repo_id="simocorbo/toxicthesis-deepseek-distillseq-classification-2", |
| filename="checkpoints/best.pt" |
| ) |
| |
| checkpoint = torch.load(checkpoint_path, map_location='cpu', weights_only=False) |
| print("Checkpoint keys:", checkpoint.keys()) |
| |
| # See ToxicThesis repository for model implementation |
| # git clone https://github.com/simo-corbo/ToxicThesis |
| ``` |
|
|
|
|
|
|
| ## Score Interpretation |
|
|
| | Output | Range | Meaning | |
| |--------|-------|---------| |
| | `probability` | [0, 1] | Probability of being toxic (class 1). | |
| | `class` | 0 or 1 | 0 = non-toxic, 1 = toxic. | |
|
|
| **Decision boundary**: Class 1 if `probability >= 0.5`. |
|
|
|
|
| ## Files |
|
|
| | File | Description | |
| |------|-------------| |
| | `checkpoints/best.pt` | Model checkpoint (best validation loss) | |
| | `hparams.yaml` | Hyperparameters used for training | |
| | `train.csv` | Training metrics per epoch | |
| | `val.csv` | Validation metrics per epoch | |
| | `vocab_stanza_hybrid.pkl` | Vocabulary (for tree-based models) | |
|
|
| ## Installation |
|
|
| ```bash |
| # Clone ToxicThesis for full model implementations |
| git clone https://github.com/simo-corbo/ToxicThesis |
| cd ToxicThesis |
| pip install -r requirements.txt |
| |
| # Or install dependencies directly |
| pip install torch transformers huggingface_hub fasttext-wheel stanza |
| ``` |
|
|
| ## Citation |
|
|
| ```bibtex |
| @software{toxicthesis2025, |
| title={ToxicThesis}, |
| author={Corbo, Simone}, |
| year={2025}, |
| url={https://github.com/simo-corbo/ToxicThesis} |
| } |
| ``` |
|
|