Datasets:
Tasks:
Text Classification
Formats:
parquet
Sub-tasks:
multi-label-classification
Languages:
English
Size:
1M - 10M
License:
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,50 +1,174 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
configs:
|
| 4 |
-
- config_name: default
|
| 5 |
-
data_files:
|
| 6 |
-
- split: train
|
| 7 |
-
path: data/train-*
|
| 8 |
-
- split: validation
|
| 9 |
-
path: data/validation-*
|
| 10 |
-
- split: test
|
| 11 |
-
path: data/test-*
|
| 12 |
-
dataset_info:
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
- name:
|
| 27 |
-
dtype:
|
| 28 |
-
- name:
|
| 29 |
-
dtype: float32
|
| 30 |
-
- name:
|
| 31 |
-
|
| 32 |
-
- name:
|
| 33 |
-
|
| 34 |
-
- name:
|
| 35 |
-
|
| 36 |
-
- name:
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
- name:
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
configs:
|
| 4 |
+
- config_name: default
|
| 5 |
+
data_files:
|
| 6 |
+
- split: train
|
| 7 |
+
path: data/train-*
|
| 8 |
+
- split: validation
|
| 9 |
+
path: data/validation-*
|
| 10 |
+
- split: test
|
| 11 |
+
path: data/test-*
|
| 12 |
+
dataset_info:
|
| 13 |
+
source_dataset: jigsaw-toxic-comment-classification-challenge
|
| 14 |
+
processed_by: Koushik (https://huggingface.co/datasets/Koushim)
|
| 15 |
+
tokenizer: bert-base-uncased
|
| 16 |
+
label_format: float multi-label binary vector
|
| 17 |
+
label_columns:
|
| 18 |
+
- toxicity
|
| 19 |
+
- severe_toxicity
|
| 20 |
+
- obscene
|
| 21 |
+
- threat
|
| 22 |
+
- insult
|
| 23 |
+
- identity_attack
|
| 24 |
+
- sexual_explicit
|
| 25 |
+
features:
|
| 26 |
+
- name: text
|
| 27 |
+
dtype: string
|
| 28 |
+
- name: toxicity
|
| 29 |
+
dtype: float32
|
| 30 |
+
- name: severe_toxicity
|
| 31 |
+
dtype: float32
|
| 32 |
+
- name: obscene
|
| 33 |
+
dtype: float32
|
| 34 |
+
- name: threat
|
| 35 |
+
dtype: float32
|
| 36 |
+
- name: insult
|
| 37 |
+
dtype: float32
|
| 38 |
+
- name: identity_attack
|
| 39 |
+
dtype: float32
|
| 40 |
+
- name: sexual_explicit
|
| 41 |
+
dtype: float32
|
| 42 |
+
- name: labels
|
| 43 |
+
sequence: float64
|
| 44 |
+
- name: input_ids
|
| 45 |
+
sequence: int32
|
| 46 |
+
- name: token_type_ids
|
| 47 |
+
sequence: int8
|
| 48 |
+
- name: attention_mask
|
| 49 |
+
sequence: int8
|
| 50 |
+
splits:
|
| 51 |
+
- name: train
|
| 52 |
+
num_bytes: 2110899324
|
| 53 |
+
num_examples: 1804874
|
| 54 |
+
- name: validation
|
| 55 |
+
num_bytes: 113965680
|
| 56 |
+
num_examples: 97320
|
| 57 |
+
- name: test
|
| 58 |
+
num_bytes: 113712324
|
| 59 |
+
num_examples: 97320
|
| 60 |
+
download_size: 693905946
|
| 61 |
+
dataset_size: 2338577328
|
| 62 |
+
annotations_creators:
|
| 63 |
+
- crowdsourced
|
| 64 |
+
language_creators:
|
| 65 |
+
- found
|
| 66 |
+
language:
|
| 67 |
+
- en
|
| 68 |
+
multilinguality:
|
| 69 |
+
- monolingual
|
| 70 |
+
pretty_name: Processed Jigsaw Toxic Comment Classification
|
| 71 |
+
tags:
|
| 72 |
+
- toxicity
|
| 73 |
+
- multi-label classification
|
| 74 |
+
- text classification
|
| 75 |
+
- NLP
|
| 76 |
+
- BERT
|
| 77 |
+
- hate speech
|
| 78 |
+
size_categories:
|
| 79 |
+
- 1M<n<10M
|
| 80 |
+
task_categories:
|
| 81 |
+
- text-classification
|
| 82 |
+
task_ids:
|
| 83 |
+
- multi-label-classification
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
# Processed Jigsaw Toxic Comments Dataset
|
| 87 |
+
|
| 88 |
+
This is a **preprocessed and tokenized** version of the original [Jigsaw Toxic Comment Classification Challenge](https://www.kaggle.com/competitions/jigsaw-toxic-comment-classification-challenge) dataset, prepared for **multi-label toxicity classification** using transformer-based models like BERT.
|
| 89 |
+
|
| 90 |
+
⚠️ **Important Note**: I am **not the original creator** of the dataset. This dataset is a cleaned and restructured version made for quick use in PyTorch deep learning models.
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## 📦 Dataset Features
|
| 95 |
+
|
| 96 |
+
Each example contains:
|
| 97 |
+
|
| 98 |
+
- `text`: The original user comment
|
| 99 |
+
- `labels`: A list of 7 binary float values indicating presence of toxicity categories
|
| 100 |
+
- `input_ids`, `attention_mask`: Tokenized fields using `bert-base-uncased` (max length 128)
|
| 101 |
+
|
| 102 |
+
### Toxicity Categories:
|
| 103 |
+
|
| 104 |
+
1. `toxicity`
|
| 105 |
+
2. `severe_toxicity`
|
| 106 |
+
3. `obscene`
|
| 107 |
+
4. `threat`
|
| 108 |
+
5. `insult`
|
| 109 |
+
6. `identity_attack`
|
| 110 |
+
7. `sexual_explicit`
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## 🧪 Dataset Splits
|
| 115 |
+
|
| 116 |
+
| Split | # Examples |
|
| 117 |
+
|-------------|-------------|
|
| 118 |
+
| Train | ~1.8M |
|
| 119 |
+
| Validation | ~97K |
|
| 120 |
+
| Test | ~97K |
|
| 121 |
+
|
| 122 |
+
---
|
| 123 |
+
|
| 124 |
+
## 🔧 Processing Details
|
| 125 |
+
|
| 126 |
+
1. **Original Source**: Manually downloaded from [Kaggle](https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge)
|
| 127 |
+
2. **Preprocessing**:
|
| 128 |
+
- Combined multiple toxicity columns into a single `labels` vector
|
| 129 |
+
- Converted label values to floats (0.0 or 1.0)
|
| 130 |
+
3. **Tokenization**:
|
| 131 |
+
- Used Hugging Face `bert-base-uncased` tokenizer
|
| 132 |
+
- Applied padding and truncation to max length of 128
|
| 133 |
+
4. **Formatting**:
|
| 134 |
+
- Final dataset set to return PyTorch `input_ids`, `attention_mask`, and `labels`
|
| 135 |
+
|
| 136 |
+
---
|
| 137 |
+
|
| 138 |
+
## 💡 Usage Example
|
| 139 |
+
|
| 140 |
+
```python
|
| 141 |
+
from datasets import load_dataset
|
| 142 |
+
|
| 143 |
+
dataset = load_dataset("Koushim/processed-jigsaw-toxic-comments")
|
| 144 |
+
|
| 145 |
+
from torch.utils.data import DataLoader
|
| 146 |
+
|
| 147 |
+
train_loader = DataLoader(dataset["train"], batch_size=32, shuffle=True)
|
| 148 |
+
|
| 149 |
+
batch = next(iter(train_loader))
|
| 150 |
+
print(batch['input_ids'].shape) # torch.Size([32, 128])
|
| 151 |
+
print(batch['labels'].shape) # torch.Size([32, 7])
|
| 152 |
+
````
|
| 153 |
+
|
| 154 |
+
---
|
| 155 |
+
|
| 156 |
+
## 📚 Citation
|
| 157 |
+
|
| 158 |
+
If you use this dataset, please cite the original Jigsaw authors:
|
| 159 |
+
|
| 160 |
+
```bibtex
|
| 161 |
+
@misc{jigsawtoxic,
|
| 162 |
+
title={Toxic Comment Classification Challenge},
|
| 163 |
+
author={Jigsaw and Google},
|
| 164 |
+
year={2018},
|
| 165 |
+
url={https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge}
|
| 166 |
+
}
|
| 167 |
+
```
|
| 168 |
+
|
| 169 |
+
---
|
| 170 |
+
|
| 171 |
+
## 🙏 Acknowledgements
|
| 172 |
+
|
| 173 |
+
* Original dataset by **Jigsaw/Google**
|
| 174 |
+
* Processing, formatting, and tokenization by [Koushik](https://huggingface.co/koushik)
|