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antization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
roberta-large-squad2 - bnb 8bits
|
11 |
+
- Model creator: https://huggingface.co/deepset/
|
12 |
+
- Original model: https://huggingface.co/deepset/roberta-large-squad2/
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
Original model description:
|
18 |
+
---
|
19 |
+
language: en
|
20 |
+
license: cc-by-4.0
|
21 |
+
datasets:
|
22 |
+
- squad_v2
|
23 |
+
base_model: roberta-large
|
24 |
+
model-index:
|
25 |
+
- name: deepset/roberta-large-squad2
|
26 |
+
results:
|
27 |
+
- task:
|
28 |
+
type: question-answering
|
29 |
+
name: Question Answering
|
30 |
+
dataset:
|
31 |
+
name: squad_v2
|
32 |
+
type: squad_v2
|
33 |
+
config: squad_v2
|
34 |
+
split: validation
|
35 |
+
metrics:
|
36 |
+
- type: exact_match
|
37 |
+
value: 85.168
|
38 |
+
name: Exact Match
|
39 |
+
- type: f1
|
40 |
+
value: 88.349
|
41 |
+
name: F1
|
42 |
+
- task:
|
43 |
+
type: question-answering
|
44 |
+
name: Question Answering
|
45 |
+
dataset:
|
46 |
+
name: squad
|
47 |
+
type: squad
|
48 |
+
config: plain_text
|
49 |
+
split: validation
|
50 |
+
metrics:
|
51 |
+
- type: exact_match
|
52 |
+
value: 87.162
|
53 |
+
name: Exact Match
|
54 |
+
- type: f1
|
55 |
+
value: 93.603
|
56 |
+
name: F1
|
57 |
+
- task:
|
58 |
+
type: question-answering
|
59 |
+
name: Question Answering
|
60 |
+
dataset:
|
61 |
+
name: adversarial_qa
|
62 |
+
type: adversarial_qa
|
63 |
+
config: adversarialQA
|
64 |
+
split: validation
|
65 |
+
metrics:
|
66 |
+
- type: exact_match
|
67 |
+
value: 35.900
|
68 |
+
name: Exact Match
|
69 |
+
- type: f1
|
70 |
+
value: 48.923
|
71 |
+
name: F1
|
72 |
+
- task:
|
73 |
+
type: question-answering
|
74 |
+
name: Question Answering
|
75 |
+
dataset:
|
76 |
+
name: squad_adversarial
|
77 |
+
type: squad_adversarial
|
78 |
+
config: AddOneSent
|
79 |
+
split: validation
|
80 |
+
metrics:
|
81 |
+
- type: exact_match
|
82 |
+
value: 81.142
|
83 |
+
name: Exact Match
|
84 |
+
- type: f1
|
85 |
+
value: 87.099
|
86 |
+
name: F1
|
87 |
+
- task:
|
88 |
+
type: question-answering
|
89 |
+
name: Question Answering
|
90 |
+
dataset:
|
91 |
+
name: squadshifts amazon
|
92 |
+
type: squadshifts
|
93 |
+
config: amazon
|
94 |
+
split: test
|
95 |
+
metrics:
|
96 |
+
- type: exact_match
|
97 |
+
value: 72.453
|
98 |
+
name: Exact Match
|
99 |
+
- type: f1
|
100 |
+
value: 86.325
|
101 |
+
name: F1
|
102 |
+
- task:
|
103 |
+
type: question-answering
|
104 |
+
name: Question Answering
|
105 |
+
dataset:
|
106 |
+
name: squadshifts new_wiki
|
107 |
+
type: squadshifts
|
108 |
+
config: new_wiki
|
109 |
+
split: test
|
110 |
+
metrics:
|
111 |
+
- type: exact_match
|
112 |
+
value: 82.338
|
113 |
+
name: Exact Match
|
114 |
+
- type: f1
|
115 |
+
value: 91.974
|
116 |
+
name: F1
|
117 |
+
- task:
|
118 |
+
type: question-answering
|
119 |
+
name: Question Answering
|
120 |
+
dataset:
|
121 |
+
name: squadshifts nyt
|
122 |
+
type: squadshifts
|
123 |
+
config: nyt
|
124 |
+
split: test
|
125 |
+
metrics:
|
126 |
+
- type: exact_match
|
127 |
+
value: 84.352
|
128 |
+
name: Exact Match
|
129 |
+
- type: f1
|
130 |
+
value: 92.645
|
131 |
+
name: F1
|
132 |
+
- task:
|
133 |
+
type: question-answering
|
134 |
+
name: Question Answering
|
135 |
+
dataset:
|
136 |
+
name: squadshifts reddit
|
137 |
+
type: squadshifts
|
138 |
+
config: reddit
|
139 |
+
split: test
|
140 |
+
metrics:
|
141 |
+
- type: exact_match
|
142 |
+
value: 74.722
|
143 |
+
name: Exact Match
|
144 |
+
- type: f1
|
145 |
+
value: 86.860
|
146 |
+
name: F1
|
147 |
+
---
|
148 |
+
|
149 |
+
# roberta-large for QA
|
150 |
+
|
151 |
+
This is the [roberta-large](https://huggingface.co/roberta-large) model, fine-tuned using the [SQuAD2.0](https://huggingface.co/datasets/squad_v2) dataset. It's been trained on question-answer pairs, including unanswerable questions, for the task of Question Answering.
|
152 |
+
|
153 |
+
|
154 |
+
## Overview
|
155 |
+
**Language model:** roberta-large
|
156 |
+
**Language:** English
|
157 |
+
**Downstream-task:** Extractive QA
|
158 |
+
**Training data:** SQuAD 2.0
|
159 |
+
**Eval data:** SQuAD 2.0
|
160 |
+
**Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/first-qa-system)
|
161 |
+
**Infrastructure**: 4x Tesla v100
|
162 |
+
|
163 |
+
## Hyperparameters
|
164 |
+
|
165 |
+
```
|
166 |
+
base_LM_model = "roberta-large"
|
167 |
+
```
|
168 |
+
|
169 |
+
## Using a distilled model instead
|
170 |
+
Please note that we have also released a distilled version of this model called [deepset/roberta-base-squad2-distilled](https://huggingface.co/deepset/roberta-base-squad2-distilled). The distilled model has a comparable prediction quality and runs at twice the speed of the large model.
|
171 |
+
|
172 |
+
## Usage
|
173 |
+
|
174 |
+
### In Haystack
|
175 |
+
Haystack is an NLP framework by deepset. You can use this model in a Haystack pipeline to do question answering at scale (over many documents). To load the model in [Haystack](https://github.com/deepset-ai/haystack/):
|
176 |
+
```python
|
177 |
+
reader = FARMReader(model_name_or_path="deepset/roberta-large-squad2")
|
178 |
+
# or
|
179 |
+
reader = TransformersReader(model_name_or_path="deepset/roberta-large-squad2",tokenizer="deepset/roberta-large-squad2")
|
180 |
+
```
|
181 |
+
For a complete example of ``roberta-large-squad2`` being used for Question Answering, check out the [Tutorials in Haystack Documentation](https://haystack.deepset.ai/tutorials/first-qa-system)
|
182 |
+
|
183 |
+
### In Transformers
|
184 |
+
```python
|
185 |
+
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
186 |
+
|
187 |
+
model_name = "deepset/roberta-large-squad2"
|
188 |
+
|
189 |
+
# a) Get predictions
|
190 |
+
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
|
191 |
+
QA_input = {
|
192 |
+
'question': 'Why is model conversion important?',
|
193 |
+
'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.'
|
194 |
+
}
|
195 |
+
res = nlp(QA_input)
|
196 |
+
|
197 |
+
# b) Load model & tokenizer
|
198 |
+
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
|
199 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
200 |
+
```
|
201 |
+
|
202 |
+
## Authors
|
203 |
+
**Branden Chan:** branden.chan@deepset.ai
|
204 |
+
**Timo Möller:** timo.moeller@deepset.ai
|
205 |
+
**Malte Pietsch:** malte.pietsch@deepset.ai
|
206 |
+
**Tanay Soni:** tanay.soni@deepset.ai
|
207 |
+
|
208 |
+
## About us
|
209 |
+
|
210 |
+
<div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
|
211 |
+
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
212 |
+
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
|
213 |
+
</div>
|
214 |
+
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
215 |
+
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/haystack-logo-colored.png" class="w-40"/>
|
216 |
+
</div>
|
217 |
+
</div>
|
218 |
+
|
219 |
+
[deepset](http://deepset.ai/) is the company behind the open-source NLP framework [Haystack](https://haystack.deepset.ai/) which is designed to help you build production ready NLP systems that use: Question answering, summarization, ranking etc.
|
220 |
+
|
221 |
+
|
222 |
+
Some of our other work:
|
223 |
+
- [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")]([https://huggingface.co/deepset/tinyroberta-squad2)
|
224 |
+
- [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
|
225 |
+
- [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
|
226 |
+
|
227 |
+
## Get in touch and join the Haystack community
|
228 |
+
|
229 |
+
<p>For more info on Haystack, visit our <strong><a href="https://github.com/deepset-ai/haystack">GitHub</a></strong> repo and <strong><a href="https://docs.haystack.deepset.ai">Documentation</a></strong>.
|
230 |
+
|
231 |
+
We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
|
232 |
+
|
233 |
+
[Twitter](https://twitter.com/deepset_ai) | [LinkedIn](https://www.linkedin.com/company/deepset-ai/) | [Discord](https://haystack.deepset.ai/community) | [GitHub Discussions](https://github.com/deepset-ai/haystack/discussions) | [Website](https://deepset.ai)
|
234 |
+
|
235 |
+
By the way: [we're hiring!](http://www.deepset.ai/jobs)
|
236 |
+
|