vishwapatel123 commited on
Commit
1c6be11
1 Parent(s): 0a9391a

Upload 6 files

Browse files
Files changed (6) hide show
  1. README.md +34 -0
  2. config.json +34 -0
  3. pytorch_model.bin +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +1 -0
  6. vocab.txt +0 -0
README.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: afl-3.0
3
+ language:
4
+ - en
5
+ metrics:
6
+ - accuracy
7
+ library_name: transformers
8
+ pipeline_tag: text-classification
9
+ ---
10
+
11
+ ## Model description
12
+ This model is a fine-tuned version of the [bert-base-uncased](https://huggingface.co/transformers/model_doc/bert.html) model to classify toxic comments.
13
+
14
+ ## How to use
15
+
16
+ You can use the model with the following code.
17
+
18
+ ```python
19
+ from transformers import BertForSequenceClassification, BertTokenizer, TextClassificationPipeline
20
+
21
+ model_path = "JungleLee/bert-toxic-comment-classification"
22
+ tokenizer = BertTokenizer.from_pretrained(model_path)
23
+ model = BertForSequenceClassification.from_pretrained(model_path, num_labels=2)
24
+
25
+ pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
26
+ print(pipeline("You're a fucking nerd."))
27
+ ```
28
+
29
+ ## Training data
30
+ The training data comes from this [Kaggle competition](https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/data). We use 90% of the `train.csv` data to train the model.
31
+
32
+ ## Evaluation results
33
+
34
+ The model achieves 0.95 AUC in a 1500 rows held-out test set.
config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "JungleLee/bert-toxic-comment-classification",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "problem_type": "single_label_classification",
22
+ "torch_dtype": "float32",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 30522,
26
+ "id2label": {
27
+ "0": "non-toxic",
28
+ "1": "toxic"
29
+ },
30
+ "label2id": {
31
+ "non-toxic": 0,
32
+ "toxic": 1
33
+ }
34
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:924aff2eb02a6562097e6b09c543b010175abef67534e342baf501428977cc73
3
+ size 438019245
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "model_max_length": 256, "do_lower_case": true}
vocab.txt ADDED
The diff for this file is too large to render. See raw diff