lenglaender
commited on
Commit
•
d8d9122
1
Parent(s):
029fce6
Upload model
Browse files
README.md
CHANGED
@@ -6,69 +6,55 @@ datasets:
|
|
6 |
- UKPLab/m2qa
|
7 |
---
|
8 |
|
9 |
-
#
|
10 |
-
This adapter is part of the M2QA publication to achieve language and domain transfer via adapters.
|
11 |
-
📃 Paper: [TODO](TODO)
|
12 |
-
🏗️ GitHub repo: [https://github.com/UKPLab/m2qa](https://github.com/UKPLab/m2qa)
|
13 |
-
💾 Hugging Face Dataset: [https://huggingface.co/UKPLab/m2qa](https://huggingface.co/UKPLab/m2qa)
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
This [adapter](https://adapterhub.ml) for the `xlm-roberta-base` model that was trained using the **[Adapters](https://github.com/Adapter-Hub/adapters)** library. For detailed training details see our paper or GitHub repository: [https://github.com/UKPLab/m2qa](https://github.com/UKPLab/m2qa). You can find the evaluation results for this adapter on the M2QA dataset in the GitHub repo and in the paper.
|
18 |
|
|
|
19 |
|
20 |
## Usage
|
21 |
|
22 |
-
First, install `
|
23 |
|
24 |
```
|
25 |
-
pip install -U
|
26 |
```
|
|
|
27 |
|
28 |
Now, the adapter can be loaded and activated like this:
|
29 |
|
30 |
```python
|
31 |
-
from
|
32 |
-
from adapters.composition import Stack
|
33 |
|
34 |
model = AutoAdapterModel.from_pretrained("xlm-roberta-base")
|
35 |
-
|
36 |
-
# 1. Load language adapter
|
37 |
-
language_adapter_name = model.load_adapter("de/wiki@ukp") # MAD-X+Domain uses the MAD-X language adapter
|
38 |
-
|
39 |
-
# 2. Load domain adapter
|
40 |
-
domain_adapter_name = model.load_adapter("AdapterHub/m2qa-xlm-roberta-base-mad-x-domain-wiki")
|
41 |
-
|
42 |
-
# 3. Load QA head adapter
|
43 |
-
qa_adapter_name = model.load_adapter("AdapterHub/m2qa-xlm-roberta-base-mad-x-domain-qa-head")
|
44 |
-
|
45 |
-
# 4. Activate them via the adapter stack
|
46 |
-
model.active_adapters = Stack(language_adapter_name, domain_adapter_name, qa_adapter_name)
|
47 |
```
|
48 |
|
|
|
|
|
49 |
|
50 |
See our repository for more information: See https://github.com/UKPLab/m2qa/tree/main/Experiments/mad-x-domain
|
51 |
|
52 |
|
53 |
-
##
|
54 |
-
|
55 |
-
|
56 |
-
- [GitHub](https://github.com/lenglaender)
|
57 |
-
- [Twitter](https://x.com/LeonEnglaender)
|
58 |
|
59 |
## Citation
|
60 |
|
|
|
61 |
```
|
62 |
@article{englaender-etal-2024-m2qa,
|
63 |
title="M2QA: Multi-domain Multilingual Question Answering",
|
64 |
-
author={Engl{"a}nder, Leon and
|
65 |
Sterz, Hannah and
|
66 |
Poth, Clifton and
|
67 |
Pfeiffer, Jonas and
|
68 |
Kuznetsov, Ilia and
|
69 |
Gurevych, Iryna},
|
70 |
journal={arXiv preprint},
|
71 |
-
url=
|
|
|
72 |
year="2024"
|
73 |
}
|
74 |
```
|
|
|
6 |
- UKPLab/m2qa
|
7 |
---
|
8 |
|
9 |
+
# Adapter `AdapterHub/m2qa-xlm-roberta-base-mad-x-domain-wiki` for xlm-roberta-base
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
An [adapter](https://adapterhub.ml) for the `xlm-roberta-base` model that was trained on the [UKPLab/m2qa](https://huggingface.co/datasets/UKPLab/m2qa/) dataset.
|
|
|
|
|
12 |
|
13 |
+
This adapter was created for usage with the **[adapter-transformers](https://github.com/Adapter-Hub/adapter-transformers)** library.
|
14 |
|
15 |
## Usage
|
16 |
|
17 |
+
First, install `adapter-transformers`:
|
18 |
|
19 |
```
|
20 |
+
pip install -U adapter-transformers
|
21 |
```
|
22 |
+
_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)_
|
23 |
|
24 |
Now, the adapter can be loaded and activated like this:
|
25 |
|
26 |
```python
|
27 |
+
from transformers import AutoAdapterModel
|
|
|
28 |
|
29 |
model = AutoAdapterModel.from_pretrained("xlm-roberta-base")
|
30 |
+
adapter_name = model.load_adapter("AdapterHub/m2qa-xlm-roberta-base-mad-x-domain-wiki", source="hf", set_active=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
```
|
32 |
|
33 |
+
## Architecture & Training
|
34 |
+
|
35 |
|
36 |
See our repository for more information: See https://github.com/UKPLab/m2qa/tree/main/Experiments/mad-x-domain
|
37 |
|
38 |
|
39 |
+
## Evaluation results
|
40 |
+
|
41 |
+
<!-- Add some description here -->
|
|
|
|
|
42 |
|
43 |
## Citation
|
44 |
|
45 |
+
|
46 |
```
|
47 |
@article{englaender-etal-2024-m2qa,
|
48 |
title="M2QA: Multi-domain Multilingual Question Answering",
|
49 |
+
author={Engl{\"a}nder, Leon and
|
50 |
Sterz, Hannah and
|
51 |
Poth, Clifton and
|
52 |
Pfeiffer, Jonas and
|
53 |
Kuznetsov, Ilia and
|
54 |
Gurevych, Iryna},
|
55 |
journal={arXiv preprint},
|
56 |
+
url="https://arxiv.org/abs/2407.01091",
|
57 |
+
month = jul,
|
58 |
year="2024"
|
59 |
}
|
60 |
```
|