Commit
·
88eeea6
1
Parent(s):
eb825ce
Upload model
Browse files- README.md +44 -0
- adapter_config.json +40 -0
- head_config.json +64 -0
- pytorch_adapter.bin +3 -0
- pytorch_model_head.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- bert
|
| 4 |
+
- adapterhub:umls
|
| 5 |
+
- adapter-transformers
|
| 6 |
+
datasets:
|
| 7 |
+
- umls
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Adapter `reginaboateng/compacter_umls_relational_extraction_adapter_BERT` for bert-base-uncased
|
| 11 |
+
|
| 12 |
+
An [adapter](https://adapterhub.ml) for the `bert-base-uncased` model that was trained on the [umls](https://adapterhub.ml/explore/umls/) 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("bert-base-uncased")
|
| 31 |
+
adapter_name = model.load_adapter("reginaboateng/compacter_umls_relational_extraction_adapter_BERT", 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": true,
|
| 17 |
+
"non_linearity": "gelu",
|
| 18 |
+
"original_ln_after": true,
|
| 19 |
+
"original_ln_before": false,
|
| 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": true,
|
| 26 |
+
"phm_rank": 1,
|
| 27 |
+
"reduction_factor": 32,
|
| 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": "bert-base-uncased",
|
| 37 |
+
"model_type": "bert",
|
| 38 |
+
"name": "umls_relation_extraction",
|
| 39 |
+
"version": "3.2.1"
|
| 40 |
+
}
|
head_config.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"config": {
|
| 3 |
+
"activation_function": "tanh",
|
| 4 |
+
"bias": true,
|
| 5 |
+
"head_type": "classification",
|
| 6 |
+
"label2id": {
|
| 7 |
+
"LABEL_0": 0,
|
| 8 |
+
"LABEL_1": 1,
|
| 9 |
+
"LABEL_10": 10,
|
| 10 |
+
"LABEL_11": 11,
|
| 11 |
+
"LABEL_12": 12,
|
| 12 |
+
"LABEL_13": 13,
|
| 13 |
+
"LABEL_14": 14,
|
| 14 |
+
"LABEL_15": 15,
|
| 15 |
+
"LABEL_16": 16,
|
| 16 |
+
"LABEL_17": 17,
|
| 17 |
+
"LABEL_18": 18,
|
| 18 |
+
"LABEL_19": 19,
|
| 19 |
+
"LABEL_2": 2,
|
| 20 |
+
"LABEL_20": 20,
|
| 21 |
+
"LABEL_21": 21,
|
| 22 |
+
"LABEL_22": 22,
|
| 23 |
+
"LABEL_23": 23,
|
| 24 |
+
"LABEL_24": 24,
|
| 25 |
+
"LABEL_25": 25,
|
| 26 |
+
"LABEL_26": 26,
|
| 27 |
+
"LABEL_27": 27,
|
| 28 |
+
"LABEL_28": 28,
|
| 29 |
+
"LABEL_29": 29,
|
| 30 |
+
"LABEL_3": 3,
|
| 31 |
+
"LABEL_30": 30,
|
| 32 |
+
"LABEL_31": 31,
|
| 33 |
+
"LABEL_32": 32,
|
| 34 |
+
"LABEL_33": 33,
|
| 35 |
+
"LABEL_34": 34,
|
| 36 |
+
"LABEL_35": 35,
|
| 37 |
+
"LABEL_36": 36,
|
| 38 |
+
"LABEL_37": 37,
|
| 39 |
+
"LABEL_38": 38,
|
| 40 |
+
"LABEL_39": 39,
|
| 41 |
+
"LABEL_4": 4,
|
| 42 |
+
"LABEL_40": 40,
|
| 43 |
+
"LABEL_41": 41,
|
| 44 |
+
"LABEL_42": 42,
|
| 45 |
+
"LABEL_43": 43,
|
| 46 |
+
"LABEL_44": 44,
|
| 47 |
+
"LABEL_45": 45,
|
| 48 |
+
"LABEL_5": 5,
|
| 49 |
+
"LABEL_6": 6,
|
| 50 |
+
"LABEL_7": 7,
|
| 51 |
+
"LABEL_8": 8,
|
| 52 |
+
"LABEL_9": 9
|
| 53 |
+
},
|
| 54 |
+
"layers": 2,
|
| 55 |
+
"num_labels": 46,
|
| 56 |
+
"use_pooler": false
|
| 57 |
+
},
|
| 58 |
+
"hidden_size": 768,
|
| 59 |
+
"model_class": "BertModelWithHeads",
|
| 60 |
+
"model_name": "bert-base-uncased",
|
| 61 |
+
"model_type": "bert",
|
| 62 |
+
"name": "umls_relation_extraction",
|
| 63 |
+
"version": "3.2.1"
|
| 64 |
+
}
|
pytorch_adapter.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0739be11fb7c9ba84200ee1ed553ebd533b3fc2996dff3335335146364953dc2
|
| 3 |
+
size 280753
|
pytorch_model_head.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20b23a254e130b9a40243462164bb43bd6752270b8098fe1fc58199f9ee8eb77
|
| 3 |
+
size 2505633
|