File size: 2,306 Bytes
3617524
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d6e6809
3617524
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d6e6809
3617524
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
library_name: transformers
license: mit
base_model: roberta-base
tags:
- generated_from_trainer
metrics:
- accuracy
model-index:
- name: toxicity-classification-model
  results: []
datasets:
- dirtycomputer/Toxic_Comment_Classification_Challenge
language:
- en
pipeline_tag: text-classification
---

# toxicity-classification-model

This model is a fine-tuned version of [roberta-base](https://huggingface.co/roberta-base) on the dirtycomputer/Toxic_Comment_Classification_Challenge dataset. It achieves the following results on the evaluation set:
- Loss: 0.0511
- Accuracy: 0.9812

## Model description

Fine-tuned roberta-base model for detecting toxicity in comments. It categorizes a comment into different toxicity types, such as "toxic," "obscene," "insult," and "threat."

## Intended uses & limitations

### Intended Uses
- **Content Moderation**: Automatically flagging or removing toxic comments on social media platforms, forums, and customer support.
- **Toxicity Detection**: Classifying comments based on their toxicity level, such as harmful language or insults.

### Limitations
- **False Negatives**: May not always catch subtle toxic behavior.
- **Limited Language Support**: Currently, the model is trained on English-only data.
- **Context Sensitivity**: May struggle with ambiguous language or sarcasm.

## Training and evaluation data

This model was fine-tuned using the **dirtycomputer/Toxic_Comment_Classification_Challenge** dataset, which contains labeled comments for toxicity classification.

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 8
- eval_batch_size: 16
- seed: 42
- optimizer: Use adamw_torch with betas=(0.9, 0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 500
- num_epochs: 3

### Training results

| Training Loss | Epoch | Step  | Validation Loss | Accuracy |
|:-------------:|:-----:|:-----:|:---------------:|:--------:|
| 0.1691        | 1.0   | 17952 | 0.1464          | 0.9617   |
| 0.0892        | 2.0   | 35904 | 0.1456          | 0.9617   |
| 0.0527        | 3.0   | 53856 | 0.0511          | 0.9812   |

### Framework versions

- Transformers 4.47.1
- Pytorch 2.5.1+cu121
- Datasets 3.2.0
- Tokenizers 0.21.0