harIs8 commited on
Commit
f042c5b
·
verified ·
1 Parent(s): bc42a0b

Upload 8 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ language: multilingual
4
+ license: apache-2.0
5
+ tags:
6
+ - text-classification
7
+ - cyberbullying
8
+ - offensive-language
9
+ - multi-label
10
+ ---
11
+
12
+ # Advanced Cyberbullying & Offensive Language Detector
13
+
14
+ This is a multilingual, multi-label text classification model fine-tuned on a combined dataset of `cyberbullying_tweets` and the OLID (Offensive Language Identification Dataset). It is designed to detect both general offensive language and specific, targeted types of cyberbullying.
15
+
16
+ This model was trained using the `xlm-roberta-base` architecture.
17
+
18
+ ## Model Labels
19
+
20
+ The model predicts six independent labels for any given text. A `1` indicates the presence of the category, and a `0` indicates its absence.
21
+
22
+ 1. **`is_offensive`**: The text contains generally offensive, toxic, or profane language.
23
+ 2. **`is_gender_harassment`**: The text contains attacks based on gender, sexism, or sexual orientation.
24
+ 3. **`is_religious_harassment`**: The text contains attacks targeting religious beliefs.
25
+ 4. **`is_ethnic_harassment`**: The text contains attacks based on race or ethnicity.
26
+ 5. **`is_age_harassment`**: The text contains attacks targeting a person's age (ageism).
27
+ 6. **`is_other_cyberbullying`**: The text contains general insults or bullying that doesn't fit the other specific categories.
28
+
29
+ A text is considered **"Not Cyberbullying"** when all labels are predicted as `0`.
30
+
31
+ ## Performance
32
+
33
+ The model achieved the following performance on its validation set after two epochs of training:
34
+
35
+ - **F1 Score (Weighted):** 0.908
36
+ - **ROC AUC (Weighted):** 0.961
37
+
38
+ ## How to Use
39
+
40
+ Once you upload this model to your Hugging Face account, you can use it directly with a `pipeline`:
41
+
42
+ ```python
43
+ from transformers import pipeline
44
+
45
+ # Replace "your-username/your-repo-name" with your actual model name on the Hub
46
+ pipe = pipeline("text-classification", model="your-username/your-repo-name", return_all_scores=True)
47
+
48
+ # Example usage
49
+ text = "You are such an idiot, I can't believe you said that."
50
+ results = pipe(text)
51
+ print(results)```
config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "xlm-roberta-base",
3
+ "architectures": [
4
+ "XLMRobertaForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 2,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "id2label": {
14
+ "0": "LABEL_0",
15
+ "1": "LABEL_1",
16
+ "2": "LABEL_2",
17
+ "3": "LABEL_3",
18
+ "4": "LABEL_4",
19
+ "5": "LABEL_5"
20
+ },
21
+ "initializer_range": 0.02,
22
+ "intermediate_size": 3072,
23
+ "label2id": {
24
+ "LABEL_0": 0,
25
+ "LABEL_1": 1,
26
+ "LABEL_2": 2,
27
+ "LABEL_3": 3,
28
+ "LABEL_4": 4,
29
+ "LABEL_5": 5
30
+ },
31
+ "layer_norm_eps": 1e-05,
32
+ "max_position_embeddings": 514,
33
+ "model_type": "xlm-roberta",
34
+ "num_attention_heads": 12,
35
+ "num_hidden_layers": 12,
36
+ "output_past": true,
37
+ "pad_token_id": 1,
38
+ "position_embedding_type": "absolute",
39
+ "problem_type": "multi_label_classification",
40
+ "torch_dtype": "float32",
41
+ "transformers_version": "4.30.2",
42
+ "type_vocab_size": 1,
43
+ "use_cache": true,
44
+ "vocab_size": 250002
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:241613ff9edffcbd8f1580ac2fdf9a3ce9c204a636f6119d4da813ee3759f56c
3
+ size 1112266930
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "mask_token": {
6
+ "content": "<mask>",
7
+ "lstrip": true,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "pad_token": "<pad>",
13
+ "sep_token": "</s>",
14
+ "unk_token": "<unk>"
15
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c08c80d1df11b82ada2fd707562f86a9ebd5b7de04f51ebd2b49f2cd5906d00
3
+ size 17082925
tokenizer_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "clean_up_tokenization_spaces": true,
4
+ "cls_token": "<s>",
5
+ "eos_token": "</s>",
6
+ "mask_token": {
7
+ "__type": "AddedToken",
8
+ "content": "<mask>",
9
+ "lstrip": true,
10
+ "normalized": true,
11
+ "rstrip": false,
12
+ "single_word": false
13
+ },
14
+ "model_max_length": 512,
15
+ "pad_token": "<pad>",
16
+ "sep_token": "</s>",
17
+ "tokenizer_class": "XLMRobertaTokenizer",
18
+ "unk_token": "<unk>"
19
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d539438cc429e0c981984f2d41586273073ab249d4372731448ab2366f2dc8a7
3
+ size 4344