Instructions to use ArabicNewsAnalyzer/checkpoints with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ArabicNewsAnalyzer/checkpoints with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ArabicNewsAnalyzer/checkpoints")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ArabicNewsAnalyzer/checkpoints") model = AutoModelForSequenceClassification.from_pretrained("ArabicNewsAnalyzer/checkpoints", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ArabicNewsAnalyzer/Marbertv2-Hate-and-Offensive-Speech
Browse files- README.md +83 -0
- config.json +47 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +17 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
base_model: UBC-NLP/MARBERTv2
|
| 4 |
+
tags:
|
| 5 |
+
- generated_from_trainer
|
| 6 |
+
metrics:
|
| 7 |
+
- accuracy
|
| 8 |
+
model-index:
|
| 9 |
+
- name: checkpoints
|
| 10 |
+
results: []
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 14 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 15 |
+
|
| 16 |
+
# checkpoints
|
| 17 |
+
|
| 18 |
+
This model is a fine-tuned version of [UBC-NLP/MARBERTv2](https://huggingface.co/UBC-NLP/MARBERTv2) on an unknown dataset.
|
| 19 |
+
It achieves the following results on the evaluation set:
|
| 20 |
+
- Loss: 1.1854
|
| 21 |
+
- Accuracy: 0.7595
|
| 22 |
+
- Balanced Accuracy: 0.7595
|
| 23 |
+
- Mcc: 0.6402
|
| 24 |
+
- Macro F1: 0.7607
|
| 25 |
+
- Macro Precision: 0.7646
|
| 26 |
+
- Macro Recall: 0.7595
|
| 27 |
+
- Weighted F1: 0.7607
|
| 28 |
+
- Weighted Precision: 0.7646
|
| 29 |
+
- Weighted Recall: 0.7595
|
| 30 |
+
- Class 0 F1: 0.8113
|
| 31 |
+
- Class 0 Precision: 0.86
|
| 32 |
+
- Class 0 Recall: 0.7679
|
| 33 |
+
- Class 1 F1: 0.7235
|
| 34 |
+
- Class 1 Precision: 0.7177
|
| 35 |
+
- Class 1 Recall: 0.7293
|
| 36 |
+
- Class 2 F1: 0.7473
|
| 37 |
+
- Class 2 Precision: 0.7162
|
| 38 |
+
- Class 2 Recall: 0.7812
|
| 39 |
+
|
| 40 |
+
## Model description
|
| 41 |
+
|
| 42 |
+
More information needed
|
| 43 |
+
|
| 44 |
+
## Intended uses & limitations
|
| 45 |
+
|
| 46 |
+
More information needed
|
| 47 |
+
|
| 48 |
+
## Training and evaluation data
|
| 49 |
+
|
| 50 |
+
More information needed
|
| 51 |
+
|
| 52 |
+
## Training procedure
|
| 53 |
+
|
| 54 |
+
### Training hyperparameters
|
| 55 |
+
|
| 56 |
+
The following hyperparameters were used during training:
|
| 57 |
+
- learning_rate: 2e-05
|
| 58 |
+
- train_batch_size: 16
|
| 59 |
+
- eval_batch_size: 32
|
| 60 |
+
- seed: 42
|
| 61 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 62 |
+
- lr_scheduler_type: linear
|
| 63 |
+
- lr_scheduler_warmup_steps: 0.1
|
| 64 |
+
- num_epochs: 5
|
| 65 |
+
- mixed_precision_training: Native AMP
|
| 66 |
+
|
| 67 |
+
### Training results
|
| 68 |
+
|
| 69 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy | Balanced Accuracy | Mcc | Macro F1 | Macro Precision | Macro Recall | Weighted F1 | Weighted Precision | Weighted Recall | Class 0 F1 | Class 0 Precision | Class 0 Recall | Class 1 F1 | Class 1 Precision | Class 1 Recall | Class 2 F1 | Class 2 Precision | Class 2 Recall |
|
| 70 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|:-----------------:|:------:|:--------:|:---------------:|:------------:|:-----------:|:------------------:|:---------------:|:----------:|:-----------------:|:--------------:|:----------:|:-----------------:|:--------------:|:----------:|:-----------------:|:--------------:|
|
| 71 |
+
| 0.5611 | 1.0 | 925 | 0.5775 | 0.7714 | 0.7714 | 0.6584 | 0.7699 | 0.7716 | 0.7714 | 0.7699 | 0.7716 | 0.7714 | 0.8281 | 0.8052 | 0.8523 | 0.7215 | 0.7737 | 0.6759 | 0.7602 | 0.7360 | 0.7861 |
|
| 72 |
+
| 0.4367 | 2.0 | 1850 | 0.6233 | 0.7757 | 0.7757 | 0.6641 | 0.7759 | 0.7774 | 0.7757 | 0.7759 | 0.7774 | 0.7757 | 0.8223 | 0.8418 | 0.8036 | 0.7355 | 0.7504 | 0.7212 | 0.7698 | 0.7399 | 0.8023 |
|
| 73 |
+
| 0.2949 | 3.0 | 2775 | 0.7892 | 0.7703 | 0.7703 | 0.6573 | 0.7717 | 0.7778 | 0.7703 | 0.7717 | 0.7777 | 0.7703 | 0.8132 | 0.8748 | 0.7597 | 0.7473 | 0.7044 | 0.7958 | 0.7547 | 0.7540 | 0.7553 |
|
| 74 |
+
| 0.2141 | 4.0 | 3700 | 1.0209 | 0.7584 | 0.7584 | 0.6389 | 0.7599 | 0.7646 | 0.7584 | 0.7599 | 0.7645 | 0.7584 | 0.8093 | 0.8595 | 0.7646 | 0.7281 | 0.6920 | 0.7682 | 0.7423 | 0.7423 | 0.7423 |
|
| 75 |
+
| 0.1405 | 5.0 | 4625 | 1.1854 | 0.7595 | 0.7595 | 0.6402 | 0.7607 | 0.7646 | 0.7595 | 0.7607 | 0.7646 | 0.7595 | 0.8113 | 0.86 | 0.7679 | 0.7235 | 0.7177 | 0.7293 | 0.7473 | 0.7162 | 0.7812 |
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
### Framework versions
|
| 79 |
+
|
| 80 |
+
- Transformers 5.13.1
|
| 81 |
+
- Pytorch 2.11.0+cu128
|
| 82 |
+
- Datasets 4.0.0
|
| 83 |
+
- Tokenizers 0.22.2
|
config.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"directionality": "bidi",
|
| 10 |
+
"dtype": "float32",
|
| 11 |
+
"eos_token_id": null,
|
| 12 |
+
"gradient_checkpointing": false,
|
| 13 |
+
"hidden_act": "gelu",
|
| 14 |
+
"hidden_dropout_prob": 0.1,
|
| 15 |
+
"hidden_size": 768,
|
| 16 |
+
"id2label": {
|
| 17 |
+
"0": "Normal",
|
| 18 |
+
"1": "Offensive",
|
| 19 |
+
"2": "Hate Speech"
|
| 20 |
+
},
|
| 21 |
+
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": 3072,
|
| 23 |
+
"is_decoder": false,
|
| 24 |
+
"label2id": {
|
| 25 |
+
"Hate Speech": 2,
|
| 26 |
+
"Normal": 0,
|
| 27 |
+
"Offensive": 1
|
| 28 |
+
},
|
| 29 |
+
"layer_norm_eps": 1e-12,
|
| 30 |
+
"max_position_embeddings": 512,
|
| 31 |
+
"model_type": "bert",
|
| 32 |
+
"num_attention_heads": 12,
|
| 33 |
+
"num_hidden_layers": 12,
|
| 34 |
+
"pad_token_id": 0,
|
| 35 |
+
"pooler_fc_size": 768,
|
| 36 |
+
"pooler_num_attention_heads": 12,
|
| 37 |
+
"pooler_num_fc_layers": 3,
|
| 38 |
+
"pooler_size_per_head": 128,
|
| 39 |
+
"pooler_type": "first_token_transform",
|
| 40 |
+
"position_embedding_type": "absolute",
|
| 41 |
+
"problem_type": "single_label_classification",
|
| 42 |
+
"tie_word_embeddings": true,
|
| 43 |
+
"transformers_version": "5.13.1",
|
| 44 |
+
"type_vocab_size": 2,
|
| 45 |
+
"use_cache": false,
|
| 46 |
+
"vocab_size": 100000
|
| 47 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6a48fca801a6f250123de33ca8fb681f640a9fe4b8000fc7b61f7e99d56cf8a3
|
| 3 |
+
size 651398148
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_basic_tokenize": true,
|
| 5 |
+
"do_lower_case": true,
|
| 6 |
+
"is_local": false,
|
| 7 |
+
"local_files_only": false,
|
| 8 |
+
"mask_token": "[MASK]",
|
| 9 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 10 |
+
"never_split": null,
|
| 11 |
+
"pad_token": "[PAD]",
|
| 12 |
+
"sep_token": "[SEP]",
|
| 13 |
+
"strip_accents": null,
|
| 14 |
+
"tokenize_chinese_chars": true,
|
| 15 |
+
"tokenizer_class": "BertTokenizer",
|
| 16 |
+
"unk_token": "[UNK]"
|
| 17 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ff9f61d25f86f77c1ae942b6812618cad3aab3f5d4b34880b9fd2a2b6e72661e
|
| 3 |
+
size 5265
|