SafwanLjd commited on
Commit
9baedd2
·
unverified ·
1 Parent(s): 375b07d

docs: revise model card and remove misleading base_model field

Browse files

Remove base_model: bert-base-uncased from YAML metadata since the
model was pre-trained from scratch, not fine-tuned from bert-base.

Files changed (1) hide show
  1. README.md +76 -101
README.md CHANGED
@@ -1,109 +1,84 @@
1
  ---
 
 
2
  license: apache-2.0
3
- base_model: bert-base-uncased
4
  tags:
5
- - generated_from_trainer
 
 
 
 
 
6
  datasets:
7
- - nuha-dataset
8
- model-index:
9
- - name: nuha-mlm
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
  # nuha-mlm
17
 
18
- This model is a fine-tuned version of [bert-base-uncased](https://huggingface.co/bert-base-uncased) on the nuha-dataset dataset.
19
- It achieves the following results on the evaluation set:
20
- - Loss: 5.7881
21
-
22
- ## Model description
23
-
24
- More information needed
25
-
26
- ## Intended uses & limitations
27
-
28
- More information needed
29
-
30
- ## Training and evaluation data
31
-
32
- More information needed
33
-
34
- ## Training procedure
35
-
36
- ### Training hyperparameters
37
-
38
- The following hyperparameters were used during training:
39
- - learning_rate: 0.0001
40
- - train_batch_size: 128
41
- - eval_batch_size: 128
42
- - seed: 42
43
- - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
44
- - lr_scheduler_type: linear
45
- - lr_scheduler_warmup_steps: 5000.0
46
- - num_epochs: 25
47
- - label_smoothing_factor: 0.1
48
-
49
- ### Training results
50
-
51
- | Training Loss | Epoch | Step | Validation Loss |
52
- |:-------------:|:-----:|:-----:|:---------------:|
53
- | 9.2913 | 0.5 | 500 | 8.9187 |
54
- | 8.5364 | 1.0 | 1000 | 8.4350 |
55
- | 8.3161 | 1.51 | 1500 | 8.1825 |
56
- | 8.1276 | 2.01 | 2000 | 7.9889 |
57
- | 8.0073 | 2.51 | 2500 | 7.8551 |
58
- | 7.8206 | 3.01 | 3000 | 7.7101 |
59
- | 7.7224 | 3.51 | 3500 | 7.6287 |
60
- | 7.6264 | 4.02 | 4000 | 7.4921 |
61
- | 7.5062 | 4.52 | 4500 | 7.4265 |
62
- | 7.408 | 5.02 | 5000 | 7.2955 |
63
- | 7.2433 | 5.52 | 5500 | 7.1658 |
64
- | 7.1062 | 6.02 | 6000 | 7.0132 |
65
- | 6.9815 | 6.53 | 6500 | 6.9592 |
66
- | 6.9258 | 7.03 | 7000 | 6.8659 |
67
- | 6.801 | 7.53 | 7500 | 6.7687 |
68
- | 6.7334 | 8.03 | 8000 | 6.7175 |
69
- | 6.6422 | 8.53 | 8500 | 6.6583 |
70
- | 6.5958 | 9.04 | 9000 | 6.5778 |
71
- | 6.5044 | 9.54 | 9500 | 6.5266 |
72
- | 6.4488 | 10.04 | 10000 | 6.4990 |
73
- | 6.3713 | 10.54 | 10500 | 6.4321 |
74
- | 6.3531 | 11.04 | 11000 | 6.4003 |
75
- | 6.2718 | 11.55 | 11500 | 6.3708 |
76
- | 6.2478 | 12.05 | 12000 | 6.2975 |
77
- | 6.1886 | 12.55 | 12500 | 6.2802 |
78
- | 6.1405 | 13.05 | 13000 | 6.2521 |
79
- | 6.0967 | 13.55 | 13500 | 6.1969 |
80
- | 6.0378 | 14.06 | 14000 | 6.1440 |
81
- | 5.9893 | 14.56 | 14500 | 6.1456 |
82
- | 5.9551 | 15.06 | 15000 | 6.1178 |
83
- | 5.9215 | 15.56 | 15500 | 6.0791 |
84
- | 5.8603 | 16.06 | 16000 | 6.0696 |
85
- | 5.7924 | 16.57 | 16500 | 6.0288 |
86
- | 5.7764 | 17.07 | 17000 | 6.0061 |
87
- | 5.7545 | 17.57 | 17500 | 5.9600 |
88
- | 5.7025 | 18.07 | 18000 | 5.9287 |
89
- | 5.6703 | 18.57 | 18500 | 5.9549 |
90
- | 5.6887 | 19.08 | 19000 | 5.8808 |
91
- | 5.629 | 19.58 | 19500 | 5.8967 |
92
- | 5.6139 | 20.08 | 20000 | 5.8629 |
93
- | 5.5925 | 20.58 | 20500 | 5.8651 |
94
- | 5.5506 | 21.08 | 21000 | 5.8567 |
95
- | 5.5177 | 21.59 | 21500 | 5.8216 |
96
- | 5.479 | 22.09 | 22000 | 5.8242 |
97
- | 5.468 | 22.59 | 22500 | 5.8100 |
98
- | 5.4426 | 23.09 | 23000 | 5.7828 |
99
- | 5.4648 | 23.59 | 23500 | 5.7881 |
100
- | 5.4199 | 24.1 | 24000 | 5.8162 |
101
- | 5.3976 | 24.6 | 24500 | 5.7881 |
102
-
103
-
104
- ### Framework versions
105
-
106
- - Transformers 4.32.1
107
- - Pytorch 2.0.1+cu117
108
- - Datasets 2.14.4
109
- - Tokenizers 0.13.3
 
1
  ---
2
+ language:
3
+ - ar
4
  license: apache-2.0
 
5
  tags:
6
+ - bert
7
+ - masked-language-modeling
8
+ - arabic
9
+ - social-media
10
+ - fill-mask
11
+ - pilot
12
  datasets:
13
+ - thejosango/nuha-dataset
 
 
 
14
  ---
15
 
 
 
 
16
  # nuha-mlm
17
 
18
+ ## Model Summary
19
+
20
+ `nuha-mlm` is an Arabic BERT model pre-trained from scratch on Jordanian social media text using masked language modelling (MLM). It serves as the domain-adapted base for the NUHA classifier family — [`nuha-binary`](https://huggingface.co/thejosango/nuha-binary) and [`nuha-multiclass`](https://huggingface.co/thejosango/nuha-multiclass) — and was developed as part of a **pilot proof-of-concept** for the NUHA project by the [Jordan Open Source Association (JOSA)](https://josa.ngo).
21
+
22
+ Starting from a fresh vocabulary trained on the NUHA corpus rather than fine-tuning an existing Arabic BERT, the model is adapted to the vocabulary and linguistic patterns of colloquial Jordanian Arabic social media text.
23
+
24
+ ## Uses
25
+
26
+ ### Direct Use
27
+
28
+ `nuha-mlm` can be used for masked token prediction on Arabic social media text, or as a base model for fine-tuning downstream Arabic NLP tasks — particularly those involving informal Jordanian or Levantine Arabic.
29
+
30
+ ```python
31
+ from transformers import pipeline
32
+
33
+ fill_mask = pipeline("fill-mask", model="thejosango/nuha-mlm")
34
+ results = fill_mask("هذه المرأة [MASK] جداً")
35
+ for r in results:
36
+ print(r["token_str"], r["score"])
37
+ ```
38
+
39
+ ### Downstream Use
40
+
41
+ The primary intended downstream use is fine-tuning for hate speech and gender-based violence detection using the NUHA dataset, as demonstrated by [`nuha-binary`](https://huggingface.co/thejosango/nuha-binary) and [`nuha-multiclass`](https://huggingface.co/thejosango/nuha-multiclass).
42
+
43
+ ### Out-of-Scope Use
44
+
45
+ This model was pre-trained on a relatively small, domain-specific corpus of Jordanian social media comments. It is not suitable as a general-purpose Arabic language model and should not be used as a replacement for models trained on broader Arabic corpora (e.g. for MSA tasks, translation, or summarisation).
46
+
47
+ ## Bias, Risks, and Limitations
48
+
49
+ - **Corpus bias**: The pre-training corpus consists entirely of social media comments, many of which contain offensive or harmful language. The model may reflect biases present in that content.
50
+ - **Dialect coverage**: The corpus is primarily Jordanian Arabic. Performance on other Arabic dialects or Modern Standard Arabic is not guaranteed.
51
+ - **Pilot scale**: As part of an initial proof-of-concept effort, the pre-training corpus size and training duration are modest. A larger corpus and longer training would likely yield a stronger base model.
52
+ - **Vocabulary size**: The tokenizer vocabulary (17,513 tokens) was trained specifically on this corpus and is much smaller than general Arabic BERT vocabularies.
53
+
54
+ ## Training Details
55
+
56
+ ### Training Data
57
+
58
+ Pre-trained on the text portion of the [`thejosango/nuha-dataset`](https://huggingface.co/datasets/thejosango/nuha-dataset) — a corpus of Arabic social media comments collected from Jordanian platforms. The `binary` dataset split was used for pre-training (text only, labels ignored).
59
+
60
+ ### Training Procedure
61
+
62
+ - **Architecture**: BERT (`BertForMaskedLM`), 12 layers, 12 attention heads, 768 hidden size
63
+ - **Vocabulary**: Custom BPE tokenizer trained from scratch on the corpus (17,513 tokens), with `[URL]` as an added special token
64
+ - **MLM probability**: 15%
65
+ - **Optimizer**: Adam (β₁=0.9, β₂=0.999, ε=1e-8)
66
+ - **Learning rate**: 1e-4 with linear schedule, 5,000 warmup steps
67
+ - **Batch size**: 128
68
+ - **Epochs**: 25
69
+ - **Framework**: Transformers 4.32.1, PyTorch 2.0.1
70
+
71
+ ### Training Results
72
+
73
+ | Epoch | Validation Loss |
74
+ |---|---|
75
+ | 1 | 8.435 |
76
+ | 5 | 7.296 |
77
+ | 10 | 6.499 |
78
+ | 15 | 6.118 |
79
+ | 20 | 5.863 |
80
+ | 25 | 5.788 |
81
+
82
+ ---
83
+
84
+ *This model was developed as part of an initial pilot study. It is intended as a stepping stone for the downstream NUHA classifiers rather than as a general-purpose Arabic language model.*