salohnana2018 commited on
Commit
6aaae4c
1 Parent(s): 5c7fcbd

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-Semeval-Adapter-houlsby-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-Semeval-Adapter-houlsby-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.3204
23
- - Accuracy: 0.8752
24
- - F1: 0.8752
25
- - Precision: 0.8752
26
- - Recall: 0.8752
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.4834 | 1.0 | 265 | 0.3768 | 0.8677 | 0.8677 | 0.8677 | 0.8677 |
58
- | 0.3888 | 2.0 | 530 | 0.3437 | 0.8719 | 0.8719 | 0.8719 | 0.8719 |
59
- | 0.3592 | 3.0 | 795 | 0.3512 | 0.8738 | 0.8738 | 0.8738 | 0.8738 |
60
- | 0.3312 | 4.0 | 1060 | 0.3288 | 0.8677 | 0.8677 | 0.8677 | 0.8677 |
61
- | 0.322 | 5.0 | 1325 | 0.3393 | 0.8677 | 0.8677 | 0.8677 | 0.8677 |
62
- | 0.3052 | 6.0 | 1590 | 0.3245 | 0.8790 | 0.8790 | 0.8790 | 0.8790 |
63
- | 0.2962 | 7.0 | 1855 | 0.3204 | 0.8752 | 0.8752 | 0.8752 | 0.8752 |
64
- | 0.2834 | 8.0 | 2120 | 0.3324 | 0.8828 | 0.8828 | 0.8828 | 0.8828 |
65
- | 0.2687 | 9.0 | 2385 | 0.3211 | 0.8743 | 0.8743 | 0.8743 | 0.8743 |
66
- | 0.2647 | 10.0 | 2650 | 0.3453 | 0.8648 | 0.8648 | 0.8648 | 0.8648 |
67
- | 0.2502 | 11.0 | 2915 | 0.3282 | 0.8743 | 0.8743 | 0.8743 | 0.8743 |
68
- | 0.2441 | 12.0 | 3180 | 0.3430 | 0.8700 | 0.8700 | 0.8700 | 0.8700 |
69
- | 0.2353 | 13.0 | 3445 | 0.3519 | 0.8767 | 0.8767 | 0.8767 | 0.8767 |
70
- | 0.2286 | 14.0 | 3710 | 0.3481 | 0.8738 | 0.8738 | 0.8738 | 0.8738 |
71
- | 0.2197 | 15.0 | 3975 | 0.3649 | 0.8771 | 0.8771 | 0.8771 | 0.8771 |
72
- | 0.2191 | 16.0 | 4240 | 0.3608 | 0.8729 | 0.8729 | 0.8729 | 0.8729 |
73
- | 0.2145 | 17.0 | 4505 | 0.3587 | 0.8724 | 0.8724 | 0.8724 | 0.8724 |
74
- | 0.2075 | 18.0 | 4770 | 0.3577 | 0.8762 | 0.8762 | 0.8762 | 0.8762 |
75
- | 0.2032 | 19.0 | 5035 | 0.3630 | 0.8724 | 0.8724 | 0.8724 | 0.8724 |
76
- | 0.1975 | 20.0 | 5300 | 0.3636 | 0.8719 | 0.8719 | 0.8719 | 0.8719 |
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
+ - bert
4
+ - adapter-transformers
5
+ - adapterhub:Arabic ABSA/SemEvalHotelReview
6
+ datasets:
7
+ - Hotel
 
 
 
 
8
  ---
9
 
10
+ # Adapter `salohnana2018/ABSA-SentencePair-corrected-domainAdapt-Stack-Semeval-Adapter-houlsby-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-Semeval-Adapter-houlsby-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": true,
17
+ "non_linearity": "swish",
18
+ "original_ln_after": true,
19
+ "original_ln_before": false,
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_Semeval_houlsby_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_Semeval_houlsby_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:f79377baabfcd1d415e6f609b64788c3f198e02f6b0f3dc0bbd39b783358bba7
3
+ size 7195157
pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5555442a44cf2f5e663f830f9f90334ea2c5f961e6317a3888b05a5bf6180ad
3
+ size 2373473