Initial version.
Browse files- README.md +61 -0
- adapter_config.json +23 -0
- head_config.json +94 -0
- pytorch_adapter.bin +3 -0
- pytorch_model_head.bin +3 -0
README.md
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- bert
|
4 |
+
- adapterhub:semtag/pmb
|
5 |
+
- adapter-transformers
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
---
|
9 |
+
|
10 |
+
# Adapter `AdapterHub/bert-base-uncased-pf-pmb_sem_tagging` for bert-base-uncased
|
11 |
+
|
12 |
+
An [adapter](https://adapterhub.ml) for the `bert-base-uncased` model that was trained on the [semtag/pmb](https://adapterhub.ml/explore/semtag/pmb/) dataset and includes a prediction head for tagging.
|
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 AutoModelWithHeads
|
29 |
+
|
30 |
+
model = AutoModelWithHeads.from_pretrained("bert-base-uncased")
|
31 |
+
adapter_name = model.load_adapter("AdapterHub/bert-base-uncased-pf-pmb_sem_tagging", source="hf")
|
32 |
+
model.active_adapters = adapter_name
|
33 |
+
```
|
34 |
+
|
35 |
+
## Architecture & Training
|
36 |
+
|
37 |
+
The training code for this adapter is available at https://github.com/adapter-hub/efficient-task-transfer.
|
38 |
+
In particular, training configurations for all tasks can be found [here](https://github.com/adapter-hub/efficient-task-transfer/tree/master/run_configs).
|
39 |
+
|
40 |
+
|
41 |
+
## Evaluation results
|
42 |
+
|
43 |
+
Refer to [the paper](https://arxiv.org/pdf/2104.08247) for more information on results.
|
44 |
+
|
45 |
+
## Citation
|
46 |
+
|
47 |
+
If you use this adapter, please cite our paper ["What to Pre-Train on? Efficient Intermediate Task Selection"](https://arxiv.org/pdf/2104.08247):
|
48 |
+
|
49 |
+
```bibtex
|
50 |
+
@inproceedings{poth-etal-2021-what-to-pre-train-on,
|
51 |
+
title={What to Pre-Train on? Efficient Intermediate Task Selection},
|
52 |
+
author={Clifton Poth and Jonas Pfeiffer and Andreas Rücklé and Iryna Gurevych},
|
53 |
+
booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
|
54 |
+
month = nov,
|
55 |
+
year = "2021",
|
56 |
+
address = "Online",
|
57 |
+
publisher = "Association for Computational Linguistics",
|
58 |
+
url = "https://arxiv.org/abs/2104.08247",
|
59 |
+
pages = "to appear",
|
60 |
+
}
|
61 |
+
```
|
adapter_config.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"adapter_residual_before_ln": false,
|
4 |
+
"cross_adapter": false,
|
5 |
+
"inv_adapter": null,
|
6 |
+
"inv_adapter_reduction_factor": null,
|
7 |
+
"leave_out": [],
|
8 |
+
"ln_after": false,
|
9 |
+
"ln_before": false,
|
10 |
+
"mh_adapter": false,
|
11 |
+
"non_linearity": "relu",
|
12 |
+
"original_ln_after": true,
|
13 |
+
"original_ln_before": true,
|
14 |
+
"output_adapter": true,
|
15 |
+
"reduction_factor": 16,
|
16 |
+
"residual_before_ln": true
|
17 |
+
},
|
18 |
+
"hidden_size": 768,
|
19 |
+
"model_class": "BertModelWithHeads",
|
20 |
+
"model_name": "bert-base-uncased",
|
21 |
+
"model_type": "bert",
|
22 |
+
"name": "pmb_sem_tagging"
|
23 |
+
}
|
head_config.json
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"activation_function": "tanh",
|
4 |
+
"head_type": "tagging",
|
5 |
+
"label2id": {
|
6 |
+
"ALT": 0,
|
7 |
+
"AND": 1,
|
8 |
+
"APX": 2,
|
9 |
+
"ART": 3,
|
10 |
+
"BOT": 4,
|
11 |
+
"BUT": 5,
|
12 |
+
"CLO": 6,
|
13 |
+
"COL": 7,
|
14 |
+
"COM": 8,
|
15 |
+
"CON": 9,
|
16 |
+
"COO": 10,
|
17 |
+
"CTC": 11,
|
18 |
+
"DEC": 12,
|
19 |
+
"DEF": 13,
|
20 |
+
"DEG": 14,
|
21 |
+
"DIS": 15,
|
22 |
+
"DOM": 16,
|
23 |
+
"DOW": 17,
|
24 |
+
"DST": 18,
|
25 |
+
"DXP": 19,
|
26 |
+
"DXT": 20,
|
27 |
+
"EFS": 21,
|
28 |
+
"EMP": 22,
|
29 |
+
"ENS": 23,
|
30 |
+
"EPS": 24,
|
31 |
+
"EQU": 25,
|
32 |
+
"EVE": 26,
|
33 |
+
"EXG": 27,
|
34 |
+
"EXS": 28,
|
35 |
+
"EXT": 29,
|
36 |
+
"FUT": 30,
|
37 |
+
"GEO": 31,
|
38 |
+
"GPE": 32,
|
39 |
+
"GPO": 33,
|
40 |
+
"GRE": 34,
|
41 |
+
"GRP": 35,
|
42 |
+
"HAP": 36,
|
43 |
+
"HAS": 37,
|
44 |
+
"HES": 38,
|
45 |
+
"IMP": 39,
|
46 |
+
"INT": 40,
|
47 |
+
"IST": 41,
|
48 |
+
"ITJ": 42,
|
49 |
+
"LES": 43,
|
50 |
+
"LIT": 44,
|
51 |
+
"MOR": 45,
|
52 |
+
"MOY": 46,
|
53 |
+
"NAM": 47,
|
54 |
+
"NEC": 48,
|
55 |
+
"NIL": 49,
|
56 |
+
"NOT": 50,
|
57 |
+
"NOW": 51,
|
58 |
+
"NTH": 52,
|
59 |
+
"ORD": 53,
|
60 |
+
"ORG": 54,
|
61 |
+
"PER": 55,
|
62 |
+
"PFT": 56,
|
63 |
+
"POS": 57,
|
64 |
+
"PRG": 58,
|
65 |
+
"PRI": 59,
|
66 |
+
"PRO": 60,
|
67 |
+
"PRX": 61,
|
68 |
+
"PST": 62,
|
69 |
+
"QUC": 63,
|
70 |
+
"QUE": 64,
|
71 |
+
"QUV": 65,
|
72 |
+
"REF": 66,
|
73 |
+
"REL": 67,
|
74 |
+
"ROL": 68,
|
75 |
+
"SCO": 69,
|
76 |
+
"SST": 70,
|
77 |
+
"SUB": 71,
|
78 |
+
"TIM": 72,
|
79 |
+
"TNS": 73,
|
80 |
+
"TOP": 74,
|
81 |
+
"UNK": 75,
|
82 |
+
"UOM": 76,
|
83 |
+
"XCL": 77,
|
84 |
+
"YOC": 78
|
85 |
+
},
|
86 |
+
"layers": 1,
|
87 |
+
"num_labels": 79
|
88 |
+
},
|
89 |
+
"hidden_size": 768,
|
90 |
+
"model_class": "BertModelWithHeads",
|
91 |
+
"model_name": "bert-base-uncased",
|
92 |
+
"model_type": "bert",
|
93 |
+
"name": "pmb_sem_tagging"
|
94 |
+
}
|
pytorch_adapter.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4a2d2049915b93074f4f3523a6db1edac3c1c79bdd2cd6cc9f48d9e8b9ea4d3e
|
3 |
+
size 3595119
|
pytorch_model_head.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0865ac8cd361fea0da3a3c82f8fccede95f2203da8e0ea919f9ea3b23870a61a
|
3 |
+
size 244023
|