salohnana2018
commited on
Commit
•
6c6319b
1
Parent(s):
4d32c94
Upload model
Browse files- README.md +26 -66
- adapter_config.json +40 -0
- head_config.json +21 -0
- pytorch_adapter.bin +3 -0
- pytorch_model_head.bin +3 -0
README.md
CHANGED
@@ -1,84 +1,44 @@
|
|
1 |
---
|
2 |
-
license: apache-2.0
|
3 |
tags:
|
4 |
-
-
|
5 |
-
|
6 |
-
-
|
7 |
-
|
8 |
-
-
|
9 |
-
- recall
|
10 |
-
model-index:
|
11 |
-
- name: ABSA-SentencePair-corrected-domainAdapt-Stack-Semeval-Adapter-pfeiffer-run2
|
12 |
-
results: []
|
13 |
---
|
14 |
|
15 |
-
|
16 |
-
should probably proofread and complete it, then remove this comment. -->
|
17 |
|
18 |
-
|
19 |
|
20 |
-
This
|
21 |
-
It achieves the following results on the evaluation set:
|
22 |
-
- Loss: 0.3158
|
23 |
-
- Accuracy: 0.8814
|
24 |
-
- F1: 0.8814
|
25 |
-
- Precision: 0.8814
|
26 |
-
- Recall: 0.8814
|
27 |
|
28 |
-
##
|
29 |
|
30 |
-
|
31 |
|
32 |
-
|
|
|
|
|
|
|
33 |
|
34 |
-
|
35 |
|
36 |
-
|
|
|
37 |
|
38 |
-
|
|
|
|
|
39 |
|
40 |
-
## Training
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
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 |
-
|
54 |
|
55 |
-
|
56 |
-
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
|
57 |
-
| 0.4959 | 1.0 | 265 | 0.3710 | 0.8691 | 0.8691 | 0.8691 | 0.8691 |
|
58 |
-
| 0.3836 | 2.0 | 530 | 0.3438 | 0.8715 | 0.8715 | 0.8715 | 0.8715 |
|
59 |
-
| 0.3546 | 3.0 | 795 | 0.3425 | 0.8757 | 0.8757 | 0.8757 | 0.8757 |
|
60 |
-
| 0.3355 | 4.0 | 1060 | 0.3319 | 0.8767 | 0.8767 | 0.8767 | 0.8767 |
|
61 |
-
| 0.3176 | 5.0 | 1325 | 0.3386 | 0.8644 | 0.8644 | 0.8644 | 0.8644 |
|
62 |
-
| 0.3004 | 6.0 | 1590 | 0.3320 | 0.8757 | 0.8757 | 0.8757 | 0.8757 |
|
63 |
-
| 0.2853 | 7.0 | 1855 | 0.3158 | 0.8814 | 0.8814 | 0.8814 | 0.8814 |
|
64 |
-
| 0.2825 | 8.0 | 2120 | 0.3247 | 0.8767 | 0.8767 | 0.8767 | 0.8767 |
|
65 |
-
| 0.2625 | 9.0 | 2385 | 0.3330 | 0.8781 | 0.8781 | 0.8781 | 0.8781 |
|
66 |
-
| 0.249 | 10.0 | 2650 | 0.3245 | 0.8771 | 0.8771 | 0.8771 | 0.8771 |
|
67 |
-
| 0.2446 | 11.0 | 2915 | 0.3381 | 0.8809 | 0.8809 | 0.8809 | 0.8809 |
|
68 |
-
| 0.2344 | 12.0 | 3180 | 0.3733 | 0.8790 | 0.8790 | 0.8790 | 0.8790 |
|
69 |
-
| 0.2234 | 13.0 | 3445 | 0.3467 | 0.8814 | 0.8814 | 0.8814 | 0.8814 |
|
70 |
-
| 0.2212 | 14.0 | 3710 | 0.3575 | 0.8677 | 0.8677 | 0.8677 | 0.8677 |
|
71 |
-
| 0.2085 | 15.0 | 3975 | 0.3424 | 0.8752 | 0.8752 | 0.8752 | 0.8752 |
|
72 |
-
| 0.205 | 16.0 | 4240 | 0.3553 | 0.8771 | 0.8771 | 0.8771 | 0.8771 |
|
73 |
-
| 0.2032 | 17.0 | 4505 | 0.3588 | 0.8738 | 0.8738 | 0.8738 | 0.8738 |
|
74 |
-
| 0.197 | 18.0 | 4770 | 0.3627 | 0.8762 | 0.8762 | 0.8762 | 0.8762 |
|
75 |
-
| 0.1867 | 19.0 | 5035 | 0.3693 | 0.8790 | 0.8790 | 0.8790 | 0.8790 |
|
76 |
-
| 0.1911 | 20.0 | 5300 | 0.3671 | 0.8767 | 0.8767 | 0.8767 | 0.8767 |
|
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-Semeval-Adapter-pfeiffer-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-corrected-domainAdapt-Stack-Semeval-Adapter-pfeiffer-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_Semeval_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_Semeval_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:917ee70da61b19e024f17ce2c58560c41f6ae8d7936aecce76db1af4a11df252
|
3 |
+
size 3597221
|
pytorch_model_head.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0320d7550a584300cd0506f369d73745abb941089d453e0d8cdd68d7c7300aa1
|
3 |
+
size 2373473
|