Add adapter roberta-base_qa_squad2_pfeiffer version 1
Browse files- README.md +57 -0
- adapter_config.json +41 -0
- head_config.json +19 -0
- pytorch_adapter.bin +3 -0
- pytorch_model_head.bin +3 -0
README.md
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- question-answering
|
4 |
+
- adapter-transformers
|
5 |
+
- adapterhub:qa/squad2
|
6 |
+
- roberta
|
7 |
+
datasets:
|
8 |
+
- squad_v2
|
9 |
+
license: "apache-2.0"
|
10 |
+
---
|
11 |
+
|
12 |
+
# Adapter `roberta-base_qa_squad2_pfeiffer` for roberta-base
|
13 |
+
|
14 |
+
Adapter for roberta-base in Pfeiffer architecture trained on the SQuAD 2.0 dataset for 15 epochs with early stopping and a learning rate of 1e-4.
|
15 |
+
|
16 |
+
|
17 |
+
**This adapter was created for usage with the [Adapters](https://github.com/Adapter-Hub/adapters) library.**
|
18 |
+
|
19 |
+
## Usage
|
20 |
+
|
21 |
+
First, install `adapters`:
|
22 |
+
|
23 |
+
```
|
24 |
+
pip install -U adapters
|
25 |
+
```
|
26 |
+
|
27 |
+
Now, the adapter can be loaded and activated like this:
|
28 |
+
|
29 |
+
```python
|
30 |
+
from adapters import AutoAdapterModel
|
31 |
+
|
32 |
+
model = AutoAdapterModel.from_pretrained("roberta-base")
|
33 |
+
adapter_name = model.load_adapter("AdapterHub/roberta-base_qa_squad2_pfeiffer")
|
34 |
+
model.set_active_adapters(adapter_name)
|
35 |
+
```
|
36 |
+
|
37 |
+
## Architecture & Training
|
38 |
+
|
39 |
+
- Adapter architecture: pfeiffer
|
40 |
+
- Prediction head: question answering
|
41 |
+
- Dataset: [SQuAD 2.0](https://rajpurkar.github.io/SQuAD-explorer/)
|
42 |
+
|
43 |
+
## Author Information
|
44 |
+
|
45 |
+
- Author name(s): Clifton Poth
|
46 |
+
- Author email: calpt@mail.de
|
47 |
+
- Author links: [Website](https://calpt.github.io), [GitHub](https://github.com/calpt), [Twitter](https://twitter.com/@clifapt)
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
## Citation
|
52 |
+
|
53 |
+
```bibtex
|
54 |
+
|
55 |
+
```
|
56 |
+
|
57 |
+
*This adapter has been auto-imported from https://github.com/Adapter-Hub/Hub/blob/master/adapters/ukp/roberta-base_qa_squad2_pfeiffer.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": false,
|
18 |
+
"non_linearity": "relu",
|
19 |
+
"original_ln_after": true,
|
20 |
+
"original_ln_before": true,
|
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": "RobertaAdapterModel",
|
37 |
+
"model_name": "roberta-base",
|
38 |
+
"model_type": "roberta",
|
39 |
+
"name": "squad",
|
40 |
+
"version": "0.2.0"
|
41 |
+
}
|
head_config.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"activation_function": "tanh",
|
4 |
+
"dropout_prob": null,
|
5 |
+
"head_type": "question_answering",
|
6 |
+
"label2id": {
|
7 |
+
"LABEL_0": 0,
|
8 |
+
"LABEL_1": 1
|
9 |
+
},
|
10 |
+
"layers": 1,
|
11 |
+
"num_labels": 2
|
12 |
+
},
|
13 |
+
"hidden_size": 768,
|
14 |
+
"model_class": "RobertaAdapterModel",
|
15 |
+
"model_name": "roberta-base",
|
16 |
+
"model_type": "roberta",
|
17 |
+
"name": "squad",
|
18 |
+
"version": "0.2.0"
|
19 |
+
}
|
pytorch_adapter.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f8c5e00719f3ebf4083207373541c42f2125390ad034b83683b992e7baa84999
|
3 |
+
size 3594918
|
pytorch_model_head.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:12687c4e72701a2b2f5cac0f00553ba9d52efe867eb4a895adfc969f22709580
|
3 |
+
size 7706
|