Commit
路
bf8ca5f
1
Parent(s):
6506aa0
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- mrqa
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
metrics:
|
| 8 |
+
- squad
|
| 9 |
+
library_name: adapter-transformers
|
| 10 |
+
pipeline_tag: question-answering
|
| 11 |
---
|
| 12 |
+
|
| 13 |
+
# Description
|
| 14 |
+
This is the single-dataset adapter for the NaturalQuestions partition of the MRQA 2019 Shared Task Dataset. The adapter was created by Friedman et al. (2021) and should be used with the `roberta-base` encoder.
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
The UKP-SQuARE team created this model repository to simplify the deployment of this model on the UKP-SQuARE platform. The GitHub repository of the original authors is https://github.com/princeton-nlp/MADE
|
| 19 |
+
|
| 20 |
+
# Usage
|
| 21 |
+
This model contains the same weights as https://huggingface.co/princeton-nlp/MADE/resolve/main/single_dataset_adapters/NaturalQuestions/model.pt. The only difference is that our repository follows the standard format of AdapterHub. Therefore, you could load this model as follows:
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
from transformers import RobertaForQuestionAnswering, RobertaTokenizerFast
|
| 25 |
+
|
| 26 |
+
model = RobertaForQuestionAnswering.from_pretrained("roberta-base")
|
| 27 |
+
model.load_adapter("UKP-SQuARE/NaturalQuestions_Adapter_RoBERTa", source="hf")
|
| 28 |
+
model.set_active_adapters("NaturalQuestions")
|
| 29 |
+
|
| 30 |
+
tokenizer = RobertaTokenizerFast.from_pretrained('roberta-base')
|
| 31 |
+
|
| 32 |
+
pipe = pipeline("question-answering", model=model, tokenizer=tokenizer)
|
| 33 |
+
pipe({"question": "What is the capital of Germany?", "context": "The capital of Germany is Berlin."})
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
Note you need the adapter-transformers library https://adapterhub.ml
|
| 37 |
+
|
| 38 |
+
# Evaluation
|
| 39 |
+
Friedman et al. report an F1 score of **79.2 on NaturalQuestions**.
|
| 40 |
+
|
| 41 |
+
Please refer to the original publication for more information.
|
| 42 |
+
|
| 43 |
+
# Citation
|
| 44 |
+
Single-dataset Experts for Multi-dataset Question Answering (Friedman et al., EMNLP 2021)
|