Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
---
|
5 |
+
|
6 |
+
# Text Classification Toxicity
|
7 |
+
|
8 |
+
This model is a fined-tuned version of [nreimers/MiniLMv2-L6-H384-distilled-from-BERT-Large](https://huggingface.co/nreimers/MiniLMv2-L6-H384-distilled-from-BERT-Large) on the on the [Jigsaw 1st Kaggle competition](https://www.kaggle.com/competitions/jigsaw-toxic-comment-classification-challenge) dataset using [unitary/toxic-bert](https://huggingface.co/unitary/toxic-bert) as teacher model.
|
9 |
+
The quantized version in ONNX format can be found [here](https://huggingface.co/minuva/MiniLMv2-toxic-jigaw-lite-onnx).
|
10 |
+
|
11 |
+
The model contains two labels only (toxicity and severe toxicity). For the model with all labels refer to this [page]()
|
12 |
+
|
13 |
+
# Load the Model
|
14 |
+
|
15 |
+
```py
|
16 |
+
from transformers import pipeline
|
17 |
+
|
18 |
+
pipe = pipeline(model='minuva/MiniLMv2-toxic-jijgsaw-lite', task='text-classification')
|
19 |
+
pipe("This is pure trash")
|
20 |
+
# [{'label': 'toxic', 'score': 0.9383478164672852}]
|
21 |
+
```
|
22 |
+
|
23 |
+
# Training hyperparameters
|
24 |
+
|
25 |
+
The following hyperparameters were used during training:
|
26 |
+
- learning_rate: 6e-05
|
27 |
+
- train_batch_size: 48
|
28 |
+
- eval_batch_size: 48
|
29 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
30 |
+
- lr_scheduler_type: linear
|
31 |
+
- num_epochs: 10
|
32 |
+
- warmup_ratio: 0.1
|
33 |
+
|
34 |
+
|
35 |
+
# Metrics (comparison with teacher model)
|
36 |
+
|
37 |
+
| Teacher (params) | Student (params) | Set (metric) | Score (teacher) | Score (student) |
|
38 |
+
|--------------------|-------------|----------|--------| --------|
|
39 |
+
| unitary/toxic-bert (110M) | MiniLMv2-toxic-jijgsaw-lite (23M) | Test (ROC_AUC) | 0.982677 | 0.9815 |
|
40 |
+
|
41 |
+
# Deployment
|
42 |
+
|
43 |
+
Check this [repository](https://github.com/minuva/toxicity-prediction-serverless) to see how to easily deploy this model in a serverless environment with fast CPU inference and light resource utilization.
|
44 |
+
|