salohnana2018 commited on
Commit
e268d81
1 Parent(s): a24eb5e

Upload model

Browse files
README.md CHANGED
@@ -1,84 +1,44 @@
1
  ---
2
- license: apache-2.0
3
  tags:
4
- - generated_from_trainer
5
- metrics:
6
- - accuracy
7
- - f1
8
- - precision
9
- - recall
10
- model-index:
11
- - name: ABSA-SentencePair-corrected-domainAdapt-Stack-HARD50-Adapter-pfeiffer-run3
12
- results: []
13
  ---
14
 
15
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
16
- should probably proofread and complete it, then remove this comment. -->
17
 
18
- # ABSA-SentencePair-corrected-domainAdapt-Stack-HARD50-Adapter-pfeiffer-run3
19
 
20
- This model is a fine-tuned version of [CAMeL-Lab/bert-base-arabic-camelbert-msa](https://huggingface.co/CAMeL-Lab/bert-base-arabic-camelbert-msa) on the None dataset.
21
- It achieves the following results on the evaluation set:
22
- - Loss: 0.3168
23
- - Accuracy: 0.8800
24
- - F1: 0.8800
25
- - Precision: 0.8800
26
- - Recall: 0.8800
27
 
28
- ## Model description
29
 
30
- More information needed
31
 
32
- ## Intended uses & limitations
 
 
 
33
 
34
- More information needed
35
 
36
- ## Training and evaluation data
 
37
 
38
- More information needed
 
 
39
 
40
- ## Training procedure
41
 
42
- ### Training hyperparameters
43
 
44
- The following hyperparameters were used during training:
45
- - learning_rate: 0.0001
46
- - train_batch_size: 32
47
- - eval_batch_size: 32
48
- - seed: 23
49
- - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
50
- - lr_scheduler_type: linear
51
- - num_epochs: 20
52
 
53
- ### Training results
54
 
55
- | Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Precision | Recall |
56
- |:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
57
- | 0.4639 | 1.0 | 265 | 0.3549 | 0.8729 | 0.8729 | 0.8729 | 0.8729 |
58
- | 0.3677 | 2.0 | 530 | 0.3528 | 0.8634 | 0.8634 | 0.8634 | 0.8634 |
59
- | 0.3436 | 3.0 | 795 | 0.3237 | 0.8767 | 0.8767 | 0.8767 | 0.8767 |
60
- | 0.3254 | 4.0 | 1060 | 0.3168 | 0.8800 | 0.8800 | 0.8800 | 0.8800 |
61
- | 0.3074 | 5.0 | 1325 | 0.3221 | 0.8795 | 0.8795 | 0.8795 | 0.8795 |
62
- | 0.2954 | 6.0 | 1590 | 0.3295 | 0.8795 | 0.8795 | 0.8795 | 0.8795 |
63
- | 0.2899 | 7.0 | 1855 | 0.3408 | 0.8748 | 0.8748 | 0.8748 | 0.8748 |
64
- | 0.2703 | 8.0 | 2120 | 0.3304 | 0.8738 | 0.8738 | 0.8738 | 0.8738 |
65
- | 0.2543 | 9.0 | 2385 | 0.3327 | 0.8677 | 0.8677 | 0.8677 | 0.8677 |
66
- | 0.2522 | 10.0 | 2650 | 0.3285 | 0.8757 | 0.8757 | 0.8757 | 0.8757 |
67
- | 0.2375 | 11.0 | 2915 | 0.3261 | 0.8738 | 0.8738 | 0.8738 | 0.8738 |
68
- | 0.2313 | 12.0 | 3180 | 0.3363 | 0.8700 | 0.8700 | 0.8700 | 0.8700 |
69
- | 0.223 | 13.0 | 3445 | 0.3372 | 0.8762 | 0.8762 | 0.8762 | 0.8762 |
70
- | 0.2176 | 14.0 | 3710 | 0.3591 | 0.8653 | 0.8653 | 0.8653 | 0.8653 |
71
- | 0.2046 | 15.0 | 3975 | 0.3594 | 0.8715 | 0.8715 | 0.8715 | 0.8715 |
72
- | 0.205 | 16.0 | 4240 | 0.3686 | 0.8710 | 0.8710 | 0.8710 | 0.8710 |
73
- | 0.1951 | 17.0 | 4505 | 0.3747 | 0.8729 | 0.8729 | 0.8729 | 0.8729 |
74
- | 0.1856 | 18.0 | 4770 | 0.3703 | 0.8767 | 0.8767 | 0.8767 | 0.8767 |
75
- | 0.1947 | 19.0 | 5035 | 0.3767 | 0.8748 | 0.8748 | 0.8748 | 0.8748 |
76
- | 0.187 | 20.0 | 5300 | 0.3754 | 0.8757 | 0.8757 | 0.8757 | 0.8757 |
77
 
78
-
79
- ### Framework versions
80
-
81
- - Transformers 4.26.1
82
- - Pytorch 2.0.1+cu118
83
- - Datasets 2.14.3
84
- - Tokenizers 0.13.3
 
1
  ---
 
2
  tags:
3
+ - adapter-transformers
4
+ - adapterhub:Arabic ABSA/SemEvalHotelReview
5
+ - bert
6
+ datasets:
7
+ - Hotel
 
 
 
 
8
  ---
9
 
10
+ # Adapter `salohnana2018/ABSA-SentencePair-corrected-domainAdapt-Stack-HARD50-Adapter-pfeiffer-run3` for CAMeL-Lab/bert-base-arabic-camelbert-msa
 
11
 
12
+ An [adapter](https://adapterhub.ml) for the `CAMeL-Lab/bert-base-arabic-camelbert-msa` model that was trained on the [Arabic ABSA/SemEvalHotelReview](https://adapterhub.ml/explore/Arabic ABSA/SemEvalHotelReview/) dataset and includes a prediction head for classification.
13
 
14
+ This adapter was created for usage with the **[adapter-transformers](https://github.com/Adapter-Hub/adapter-transformers)** library.
 
 
 
 
 
 
15
 
16
+ ## Usage
17
 
18
+ First, install `adapter-transformers`:
19
 
20
+ ```
21
+ pip install -U adapter-transformers
22
+ ```
23
+ _Note: adapter-transformers is a fork of transformers that acts as a drop-in replacement with adapter support. [More](https://docs.adapterhub.ml/installation.html)_
24
 
25
+ Now, the adapter can be loaded and activated like this:
26
 
27
+ ```python
28
+ from transformers import AutoAdapterModel
29
 
30
+ model = AutoAdapterModel.from_pretrained("CAMeL-Lab/bert-base-arabic-camelbert-msa")
31
+ adapter_name = model.load_adapter("salohnana2018/ABSA-SentencePair-corrected-domainAdapt-Stack-HARD50-Adapter-pfeiffer-run3", source="hf", set_active=True)
32
+ ```
33
 
34
+ ## Architecture & Training
35
 
36
+ <!-- Add some description here -->
37
 
38
+ ## Evaluation results
 
 
 
 
 
 
 
39
 
40
+ <!-- Add some description here -->
41
 
42
+ ## Citation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
+ <!-- Add some description here -->
 
 
 
 
 
 
adapter_config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "adapter_residual_before_ln": false,
4
+ "cross_adapter": false,
5
+ "factorized_phm_W": true,
6
+ "factorized_phm_rule": false,
7
+ "hypercomplex_nonlinearity": "glorot-uniform",
8
+ "init_weights": "bert",
9
+ "inv_adapter": null,
10
+ "inv_adapter_reduction_factor": null,
11
+ "is_parallel": false,
12
+ "learn_phm": true,
13
+ "leave_out": [],
14
+ "ln_after": false,
15
+ "ln_before": false,
16
+ "mh_adapter": false,
17
+ "non_linearity": "relu",
18
+ "original_ln_after": true,
19
+ "original_ln_before": true,
20
+ "output_adapter": true,
21
+ "phm_bias": true,
22
+ "phm_c_init": "normal",
23
+ "phm_dim": 4,
24
+ "phm_init_range": 0.0001,
25
+ "phm_layer": false,
26
+ "phm_rank": 1,
27
+ "reduction_factor": 16,
28
+ "residual_before_ln": true,
29
+ "scaling": 1.0,
30
+ "shared_W_phm": false,
31
+ "shared_phm_rule": true,
32
+ "use_gating": false
33
+ },
34
+ "hidden_size": 768,
35
+ "model_class": "BertModelWithHeads",
36
+ "model_name": "CAMeL-Lab/bert-base-arabic-camelbert-msa",
37
+ "model_type": "bert",
38
+ "name": "ABSA_Sentiment_classification_HARD50_pfeiffer_Stack",
39
+ "version": "3.2.1"
40
+ }
head_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "activation_function": "tanh",
4
+ "bias": true,
5
+ "head_type": "classification",
6
+ "label2id": {
7
+ "negative": 0,
8
+ "neutral": 2,
9
+ "positive": 1
10
+ },
11
+ "layers": 2,
12
+ "num_labels": 3,
13
+ "use_pooler": false
14
+ },
15
+ "hidden_size": 768,
16
+ "model_class": "BertModelWithHeads",
17
+ "model_name": "CAMeL-Lab/bert-base-arabic-camelbert-msa",
18
+ "model_type": "bert",
19
+ "name": "ABSA_Sentiment_classification_HARD50_pfeiffer_Stack",
20
+ "version": "3.2.1"
21
+ }
pytorch_adapter.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42369e60274f1a2d06a6cab4840348aad0706527509c3dc23a6f92278f9b3c4e
3
+ size 3597221
pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:590cdc2ba865dda22b3abc7a122b382a1f1536d5b46f299fcec297a9fbb834aa
3
+ size 2373473