Add adapter bert-base-uncased_sts_sts-b_houlsby version 1
Browse files- .gitattributes +1 -0
- README.md +70 -0
- adapter_config.json +41 -0
- head_config.json +18 -0
- pytorch_adapter.bin +3 -0
- pytorch_adapter.bin.backup +3 -0
- pytorch_model_head.bin +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
pytorch_adapter.bin.backup filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- bert
|
4 |
+
- adapter-transformers
|
5 |
+
- adapterhub:sts/sts-b
|
6 |
+
- text-classification
|
7 |
+
license: "apache-2.0"
|
8 |
+
---
|
9 |
+
|
10 |
+
# Adapter `bert-base-uncased_sts_sts-b_houlsby` for bert-base-uncased
|
11 |
+
|
12 |
+
Adapter in Houlsby architecture trained on the STS-Benchmark task for 20 epochs with early stopping and a learning rate of 1e-4.
|
13 |
+
See https://arxiv.org/pdf/2007.07779.pdf.
|
14 |
+
|
15 |
+
|
16 |
+
**This adapter was created for usage with the [Adapters](https://github.com/Adapter-Hub/adapters) library.**
|
17 |
+
|
18 |
+
## Usage
|
19 |
+
|
20 |
+
First, install `adapters`:
|
21 |
+
|
22 |
+
```
|
23 |
+
pip install -U adapters
|
24 |
+
```
|
25 |
+
|
26 |
+
Now, the adapter can be loaded and activated like this:
|
27 |
+
|
28 |
+
```python
|
29 |
+
from adapters import AutoAdapterModel
|
30 |
+
|
31 |
+
model = AutoAdapterModel.from_pretrained("bert-base-uncased")
|
32 |
+
adapter_name = model.load_adapter("AdapterHub/bert-base-uncased_sts_sts-b_houlsby")
|
33 |
+
model.set_active_adapters(adapter_name)
|
34 |
+
```
|
35 |
+
|
36 |
+
## Architecture & Training
|
37 |
+
|
38 |
+
- Adapter architecture: houlsby
|
39 |
+
- Prediction head: classification
|
40 |
+
- Dataset: [STS-B](http://ixa2.si.ehu.es/stswiki/index.php/STSbenchmark)
|
41 |
+
|
42 |
+
## Author Information
|
43 |
+
|
44 |
+
- Author name(s): Clifton Poth
|
45 |
+
- Author email: [email protected]
|
46 |
+
- Author links: [Website](https://calpt.github.io), [GitHub](https://github.com/calpt), [Twitter](https://twitter.com/clifapt)
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
## Citation
|
51 |
+
|
52 |
+
```bibtex
|
53 |
+
@article{pfeiffer2020AdapterHub,
|
54 |
+
title={AdapterHub: A Framework for Adapting Transformers},
|
55 |
+
author={Jonas Pfeiffer and
|
56 |
+
Andreas R\"uckl\'{e} and
|
57 |
+
Clifton Poth and
|
58 |
+
Aishwarya Kamath and
|
59 |
+
Ivan Vuli\'{c} and
|
60 |
+
Sebastian Ruder and
|
61 |
+
Kyunghyun Cho and
|
62 |
+
Iryna Gurevych},
|
63 |
+
journal={arXiv preprint},
|
64 |
+
year={2020},
|
65 |
+
url={https://arxiv.org/abs/2007.07779}
|
66 |
+
}
|
67 |
+
|
68 |
+
```
|
69 |
+
|
70 |
+
*This adapter has been auto-imported from https://github.com/Adapter-Hub/Hub/blob/master/adapters/ukp/bert-base-uncased_sts_sts-b_houlsby.yaml*.
|
adapter_config.json
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"adapter_residual_before_ln": false,
|
4 |
+
"cross_adapter": false,
|
5 |
+
"dropout": 0.0,
|
6 |
+
"factorized_phm_W": true,
|
7 |
+
"factorized_phm_rule": false,
|
8 |
+
"hypercomplex_nonlinearity": "glorot-uniform",
|
9 |
+
"init_weights": "bert",
|
10 |
+
"inv_adapter": null,
|
11 |
+
"inv_adapter_reduction_factor": null,
|
12 |
+
"is_parallel": false,
|
13 |
+
"learn_phm": true,
|
14 |
+
"leave_out": [],
|
15 |
+
"ln_after": false,
|
16 |
+
"ln_before": false,
|
17 |
+
"mh_adapter": true,
|
18 |
+
"non_linearity": "swish",
|
19 |
+
"original_ln_after": true,
|
20 |
+
"original_ln_before": false,
|
21 |
+
"output_adapter": true,
|
22 |
+
"phm_bias": true,
|
23 |
+
"phm_c_init": "normal",
|
24 |
+
"phm_dim": 4,
|
25 |
+
"phm_init_range": 0.0001,
|
26 |
+
"phm_layer": false,
|
27 |
+
"phm_rank": 1,
|
28 |
+
"reduction_factor": 16,
|
29 |
+
"residual_before_ln": true,
|
30 |
+
"scaling": 1.0,
|
31 |
+
"shared_W_phm": false,
|
32 |
+
"shared_phm_rule": true,
|
33 |
+
"use_gating": false
|
34 |
+
},
|
35 |
+
"hidden_size": 768,
|
36 |
+
"model_class": "BertAdapterModel",
|
37 |
+
"model_name": "bert-base-uncased",
|
38 |
+
"model_type": "bert",
|
39 |
+
"name": "sts-b",
|
40 |
+
"version": "0.2.0"
|
41 |
+
}
|
head_config.json
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"activation_function": null,
|
4 |
+
"bias": true,
|
5 |
+
"dropout_prob": null,
|
6 |
+
"head_type": "classification",
|
7 |
+
"label2id": {},
|
8 |
+
"layers": 1,
|
9 |
+
"num_labels": 1,
|
10 |
+
"use_pooler": true
|
11 |
+
},
|
12 |
+
"hidden_size": 768,
|
13 |
+
"model_class": "BertAdapterModel",
|
14 |
+
"model_name": "bert-base-uncased",
|
15 |
+
"model_type": "bert",
|
16 |
+
"name": "sts-b",
|
17 |
+
"version": "0.2.0"
|
18 |
+
}
|
pytorch_adapter.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c795080cb0406673e4cac77a005d77c0c577ff6cc8d6e3b77996bdeec011e7c9
|
3 |
+
size 7189846
|
pytorch_adapter.bin.backup
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3aa0cf48704a2944c5ab7583ad73e832613533d8f81da241f8f832b6bd5e96a9
|
3 |
+
size 7175781
|
pytorch_model_head.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aa8355356c66ee7f8b467a6bd3067693bb251f9394d00ed2fe15d9d1e5f4fd97
|
3 |
+
size 4634
|