calpt commited on
Commit
684a2cd
1 Parent(s): 1248913

Initial version.

Browse files
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - roberta
4
+ - adapterhub:ner/mit_movie_trivia
5
+ - adapter-transformers
6
+ language:
7
+ - en
8
+ ---
9
+
10
+ # Adapter `AdapterHub/roberta-base-pf-mit_movie_trivia` for roberta-base
11
+
12
+ An [adapter](https://adapterhub.ml) for the `roberta-base` model that was trained on the [ner/mit_movie_trivia](https://adapterhub.ml/explore/ner/mit_movie_trivia/) 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("roberta-base")
31
+ adapter_name = model.load_adapter("AdapterHub/roberta-base-pf-mit_movie_trivia", 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": "RobertaModelWithHeads",
20
+ "model_name": "roberta-base",
21
+ "model_type": "roberta",
22
+ "name": "mit_movie_trivia"
23
+ }
head_config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "activation_function": "tanh",
4
+ "head_type": "tagging",
5
+ "label2id": {
6
+ "B-Actor": 0,
7
+ "B-Award": 1,
8
+ "B-Character_Name": 2,
9
+ "B-Director": 3,
10
+ "B-Genre": 4,
11
+ "B-Opinion": 5,
12
+ "B-Origin": 6,
13
+ "B-Plot": 7,
14
+ "B-Quote": 8,
15
+ "B-Relationship": 9,
16
+ "B-Soundtrack": 10,
17
+ "B-Year": 11,
18
+ "I-Actor": 12,
19
+ "I-Award": 13,
20
+ "I-Character_Name": 14,
21
+ "I-Director": 15,
22
+ "I-Genre": 16,
23
+ "I-Opinion": 17,
24
+ "I-Origin": 18,
25
+ "I-Plot": 19,
26
+ "I-Quote": 20,
27
+ "I-Relationship": 21,
28
+ "I-Soundtrack": 22,
29
+ "I-Year": 23,
30
+ "O": 24
31
+ },
32
+ "layers": 1,
33
+ "num_labels": 25
34
+ },
35
+ "hidden_size": 768,
36
+ "model_class": "RobertaModelWithHeads",
37
+ "model_name": "roberta-base",
38
+ "model_type": "roberta",
39
+ "name": "mit_movie_trivia"
40
+ }
pytorch_adapter.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cced01be716f9132fdbe9dde37401c0ec23797249596a8c7b32d5315d47a5230
3
+ size 3595311
pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd9d47e378d43326e9bc2ed34ec7e73ca8261b0713622f3bbcaaa69a5e5fdb2b
3
+ size 77943