calpt commited on
Commit
aed6047
1 Parent(s): a4ce2cd

Initial version.

Browse files
README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - roberta
4
+ - adapterhub:dp/ud_ewt
5
+ - adapter-transformers
6
+ datasets:
7
+ - universal_dependencies
8
+ language:
9
+ - en
10
+ ---
11
+
12
+ # Adapter `AdapterHub/roberta-base-pf-ud_en_ewt` for roberta-base
13
+
14
+ An [adapter](https://adapterhub.ml) for the `roberta-base` model that was trained on the [dp/ud_ewt](https://adapterhub.ml/explore/dp/ud_ewt/) dataset and includes a prediction head for dependency parsing.
15
+
16
+ This adapter was created for usage with the **[adapter-transformers](https://github.com/Adapter-Hub/adapter-transformers)** library.
17
+
18
+ ## Usage
19
+
20
+ First, install `adapter-transformers`:
21
+
22
+ ```
23
+ pip install -U adapter-transformers
24
+ ```
25
+ _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)_
26
+
27
+ Now, the adapter can be loaded and activated like this:
28
+
29
+ ```python
30
+ from transformers import AutoModelWithHeads
31
+
32
+ model = AutoModelWithHeads.from_pretrained("roberta-base")
33
+ adapter_name = model.load_adapter("AdapterHub/roberta-base-pf-ud_en_ewt", source="hf", set_active=True)
34
+ ```
35
+
36
+ ## Architecture & Training
37
+
38
+ This adapter was trained using adapter-transformer's example script for dependency parsing.
39
+ See https://github.com/Adapter-Hub/adapter-transformers/tree/master/examples/dependency-parsing.
40
+
41
+
42
+ ## Evaluation results
43
+
44
+ Scores achieved by dependency parsing adapters on the test set of UD English EWT after training:
45
+ | | UAS | LAS |
46
+ | --- | --- | --- |
47
+ | `bert-base-uncased` | 91.74 | 89.15 |
48
+ | `roberta-base` | 91.43 | 88.43 |
49
+
50
+
51
+ ## Citation
52
+
53
+ <!-- Add some description here -->
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": "RobertaModelWithHeads",
20
+ "model_name": "roberta-base",
21
+ "model_type": "roberta",
22
+ "name": "ud_en_ewt"
23
+ }
head_config.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "head_type": "dependency_parsing",
4
+ "label2id": {
5
+ "_": 0,
6
+ "acl": 1,
7
+ "advcl": 2,
8
+ "advmod": 3,
9
+ "amod": 4,
10
+ "appos": 5,
11
+ "aux": 6,
12
+ "case": 7,
13
+ "cc": 8,
14
+ "ccomp": 9,
15
+ "clf": 10,
16
+ "compound": 11,
17
+ "conj": 12,
18
+ "cop": 13,
19
+ "csubj": 14,
20
+ "dep": 15,
21
+ "det": 16,
22
+ "discourse": 17,
23
+ "dislocated": 18,
24
+ "expl": 19,
25
+ "fixed": 20,
26
+ "flat": 21,
27
+ "goeswith": 22,
28
+ "iobj": 23,
29
+ "list": 24,
30
+ "mark": 25,
31
+ "nmod": 26,
32
+ "nsubj": 27,
33
+ "nummod": 28,
34
+ "obj": 29,
35
+ "obl": 30,
36
+ "orphan": 31,
37
+ "parataxis": 32,
38
+ "punct": 33,
39
+ "reparandum": 34,
40
+ "root": 35,
41
+ "vocative": 36,
42
+ "xcomp": 37
43
+ },
44
+ "num_labels": 38
45
+ },
46
+ "hidden_size": 768,
47
+ "model_class": "RobertaModelWithHeads",
48
+ "model_name": "roberta-base",
49
+ "model_type": "roberta",
50
+ "name": "ud_en_ewt"
51
+ }
pytorch_adapter.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4228e30acd819a9fcbf48d56d167a49fe8b679e93455bf2a3224c5a0b67a1596
3
+ size 3595375
pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2e7919985e77aad5cb7e93b4d1c717f07373695f3592e5f895f01be64edac0d
3
+ size 92250367