salohnana2018 commited on
Commit
5c24563
1 Parent(s): 585b501

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-domainAdapt-SemEval-Adapter-pfeiffer_madx-run2
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-domainAdapt-SemEval-Adapter-pfeiffer_madx-run2
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.3666
23
- - Accuracy: 0.8603
24
- - F1: 0.8603
25
- - Precision: 0.8603
26
- - Recall: 0.8603
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: 42
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.5161 | 1.0 | 206 | 0.3972 | 0.8633 | 0.8633 | 0.8633 | 0.8633 |
58
- | 0.3989 | 2.0 | 412 | 0.3739 | 0.8670 | 0.8670 | 0.8670 | 0.8670 |
59
- | 0.3725 | 3.0 | 618 | 0.3870 | 0.8615 | 0.8615 | 0.8615 | 0.8615 |
60
- | 0.3503 | 4.0 | 824 | 0.3892 | 0.8609 | 0.8609 | 0.8609 | 0.8609 |
61
- | 0.3313 | 5.0 | 1030 | 0.3743 | 0.8682 | 0.8682 | 0.8682 | 0.8682 |
62
- | 0.3118 | 6.0 | 1236 | 0.3666 | 0.8603 | 0.8603 | 0.8603 | 0.8603 |
63
- | 0.2982 | 7.0 | 1442 | 0.3972 | 0.8621 | 0.8621 | 0.8621 | 0.8621 |
64
- | 0.2854 | 8.0 | 1648 | 0.4064 | 0.8335 | 0.8335 | 0.8335 | 0.8335 |
65
- | 0.2723 | 9.0 | 1854 | 0.3981 | 0.8505 | 0.8505 | 0.8505 | 0.8505 |
66
- | 0.2641 | 10.0 | 2060 | 0.4067 | 0.8481 | 0.8481 | 0.8481 | 0.8481 |
67
- | 0.2507 | 11.0 | 2266 | 0.4130 | 0.8439 | 0.8439 | 0.8439 | 0.8439 |
68
- | 0.2518 | 12.0 | 2472 | 0.4023 | 0.8499 | 0.8499 | 0.8499 | 0.8499 |
69
- | 0.2387 | 13.0 | 2678 | 0.4123 | 0.8451 | 0.8451 | 0.8451 | 0.8451 |
70
- | 0.2304 | 14.0 | 2884 | 0.4369 | 0.8560 | 0.8560 | 0.8560 | 0.8560 |
71
- | 0.2258 | 15.0 | 3090 | 0.4453 | 0.8384 | 0.8384 | 0.8384 | 0.8384 |
72
- | 0.2258 | 16.0 | 3296 | 0.4272 | 0.8433 | 0.8433 | 0.8433 | 0.8433 |
73
- | 0.2185 | 17.0 | 3502 | 0.4482 | 0.8420 | 0.8420 | 0.8420 | 0.8420 |
74
- | 0.2097 | 18.0 | 3708 | 0.4532 | 0.8414 | 0.8414 | 0.8414 | 0.8414 |
75
- | 0.2069 | 19.0 | 3914 | 0.4580 | 0.8439 | 0.8439 | 0.8439 | 0.8439 |
76
- | 0.2072 | 20.0 | 4120 | 0.4556 | 0.8433 | 0.8433 | 0.8433 | 0.8433 |
77
 
78
-
79
- ### Framework versions
80
-
81
- - Transformers 4.26.1
82
- - Pytorch 2.0.1+cu118
83
- - Datasets 2.13.1
84
- - Tokenizers 0.13.3
 
1
  ---
 
2
  tags:
3
+ - bert
4
+ - adapterhub:Arabic ABSA/SemEvalHotelReview
5
+ - adapter-transformers
6
+ datasets:
7
+ - Hotel
 
 
 
 
8
  ---
9
 
10
+ # Adapter `salohnana2018/ABSA-SentencePair-domainAdapt-SemEval-Adapter-pfeiffer_madx-run2` 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-domainAdapt-SemEval-Adapter-pfeiffer_madx-run2", 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_pfeiffer",
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_pfeiffer",
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:6e48536ebbac71b93040f49ab238974788b0fb9cd89d74d91e933dc04a0fef6c
3
+ size 3596581
pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa195e5ed6c591bf43cc5ff3d601fff605b03d316fde9e10dcff78a63a9096eb
3
+ size 2373409