RichardErkhov commited on
Commit
89f6017
1 Parent(s): 6dd6129

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +269 -0
README.md ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization 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-base-squad2 - bnb 4bits
11
+ - Model creator: https://huggingface.co/deepset/
12
+ - Original model: https://huggingface.co/deepset/roberta-base-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
+ model-index:
24
+ - name: deepset/roberta-base-squad2
25
+ results:
26
+ - task:
27
+ type: question-answering
28
+ name: Question Answering
29
+ dataset:
30
+ name: squad_v2
31
+ type: squad_v2
32
+ config: squad_v2
33
+ split: validation
34
+ metrics:
35
+ - type: exact_match
36
+ value: 79.9309
37
+ name: Exact Match
38
+ verified: true
39
+ verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMDhhNjg5YzNiZGQ1YTIyYTAwZGUwOWEzZTRiYzdjM2QzYjA3ZTUxNDM1NjE1MTUyMjE1MGY1YzEzMjRjYzVjYiIsInZlcnNpb24iOjF9.EH5JJo8EEFwU7osPz3s7qanw_tigeCFhCXjSfyN0Y1nWVnSfulSxIk_DbAEI5iE80V4EKLyp5-mYFodWvL2KDA
40
+ - type: f1
41
+ value: 82.9501
42
+ name: F1
43
+ verified: true
44
+ verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMjk5ZDYwOGQyNjNkMWI0OTE4YzRmOTlkY2JjNjQ0YTZkNTMzMzNkYTA0MDFmNmI3NjA3NjNlMjhiMDQ2ZjJjNSIsInZlcnNpb24iOjF9.DDm0LNTkdLbGsue58bg1aH_s67KfbcmkvL-6ZiI2s8IoxhHJMSf29H_uV2YLyevwx900t-MwTVOW3qfFnMMEAQ
45
+ - type: total
46
+ value: 11869
47
+ name: total
48
+ verified: true
49
+ verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMGFkMmI2ODM0NmY5NGNkNmUxYWViOWYxZDNkY2EzYWFmOWI4N2VhYzY5MGEzMTVhOTU4Zjc4YWViOGNjOWJjMCIsInZlcnNpb24iOjF9.fexrU1icJK5_MiifBtZWkeUvpmFISqBLDXSQJ8E6UnrRof-7cU0s4tX_dIsauHWtUpIHMPZCf5dlMWQKXZuAAA
50
+ - task:
51
+ type: question-answering
52
+ name: Question Answering
53
+ dataset:
54
+ name: squad
55
+ type: squad
56
+ config: plain_text
57
+ split: validation
58
+ metrics:
59
+ - type: exact_match
60
+ value: 85.289
61
+ name: Exact Match
62
+ - type: f1
63
+ value: 91.841
64
+ name: F1
65
+ - task:
66
+ type: question-answering
67
+ name: Question Answering
68
+ dataset:
69
+ name: adversarial_qa
70
+ type: adversarial_qa
71
+ config: adversarialQA
72
+ split: validation
73
+ metrics:
74
+ - type: exact_match
75
+ value: 29.500
76
+ name: Exact Match
77
+ - type: f1
78
+ value: 40.367
79
+ name: F1
80
+ - task:
81
+ type: question-answering
82
+ name: Question Answering
83
+ dataset:
84
+ name: squad_adversarial
85
+ type: squad_adversarial
86
+ config: AddOneSent
87
+ split: validation
88
+ metrics:
89
+ - type: exact_match
90
+ value: 78.567
91
+ name: Exact Match
92
+ - type: f1
93
+ value: 84.469
94
+ name: F1
95
+ - task:
96
+ type: question-answering
97
+ name: Question Answering
98
+ dataset:
99
+ name: squadshifts amazon
100
+ type: squadshifts
101
+ config: amazon
102
+ split: test
103
+ metrics:
104
+ - type: exact_match
105
+ value: 69.924
106
+ name: Exact Match
107
+ - type: f1
108
+ value: 83.284
109
+ name: F1
110
+ - task:
111
+ type: question-answering
112
+ name: Question Answering
113
+ dataset:
114
+ name: squadshifts new_wiki
115
+ type: squadshifts
116
+ config: new_wiki
117
+ split: test
118
+ metrics:
119
+ - type: exact_match
120
+ value: 81.204
121
+ name: Exact Match
122
+ - type: f1
123
+ value: 90.595
124
+ name: F1
125
+ - task:
126
+ type: question-answering
127
+ name: Question Answering
128
+ dataset:
129
+ name: squadshifts nyt
130
+ type: squadshifts
131
+ config: nyt
132
+ split: test
133
+ metrics:
134
+ - type: exact_match
135
+ value: 82.931
136
+ name: Exact Match
137
+ - type: f1
138
+ value: 90.756
139
+ name: F1
140
+ - task:
141
+ type: question-answering
142
+ name: Question Answering
143
+ dataset:
144
+ name: squadshifts reddit
145
+ type: squadshifts
146
+ config: reddit
147
+ split: test
148
+ metrics:
149
+ - type: exact_match
150
+ value: 71.550
151
+ name: Exact Match
152
+ - type: f1
153
+ value: 82.939
154
+ name: F1
155
+ ---
156
+
157
+ # roberta-base for QA
158
+
159
+ This is the [roberta-base](https://huggingface.co/roberta-base) 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.
160
+
161
+
162
+ ## Overview
163
+ **Language model:** roberta-base
164
+ **Language:** English
165
+ **Downstream-task:** Extractive QA
166
+ **Training data:** SQuAD 2.0
167
+ **Eval data:** SQuAD 2.0
168
+ **Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/first-qa-system)
169
+ **Infrastructure**: 4x Tesla v100
170
+
171
+ ## Hyperparameters
172
+
173
+ ```
174
+ batch_size = 96
175
+ n_epochs = 2
176
+ base_LM_model = "roberta-base"
177
+ max_seq_len = 386
178
+ learning_rate = 3e-5
179
+ lr_schedule = LinearWarmup
180
+ warmup_proportion = 0.2
181
+ doc_stride=128
182
+ max_query_length=64
183
+ ```
184
+
185
+ ## Using a distilled model instead
186
+ Please note that we have also released a distilled version of this model called [deepset/tinyroberta-squad2](https://huggingface.co/deepset/tinyroberta-squad2). The distilled model has a comparable prediction quality and runs at twice the speed of the base model.
187
+
188
+ ## Usage
189
+
190
+ ### In Haystack
191
+ 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/):
192
+ ```python
193
+ reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2")
194
+ # or
195
+ reader = TransformersReader(model_name_or_path="deepset/roberta-base-squad2",tokenizer="deepset/roberta-base-squad2")
196
+ ```
197
+ For a complete example of ``roberta-base-squad2`` being used for Question Answering, check out the [Tutorials in Haystack Documentation](https://haystack.deepset.ai/tutorials/first-qa-system)
198
+
199
+ ### In Transformers
200
+ ```python
201
+ from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
202
+
203
+ model_name = "deepset/roberta-base-squad2"
204
+
205
+ # a) Get predictions
206
+ nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
207
+ QA_input = {
208
+ 'question': 'Why is model conversion important?',
209
+ 'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.'
210
+ }
211
+ res = nlp(QA_input)
212
+
213
+ # b) Load model & tokenizer
214
+ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
215
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
216
+ ```
217
+
218
+ ## Performance
219
+ Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/).
220
+
221
+ ```
222
+ "exact": 79.87029394424324,
223
+ "f1": 82.91251169582613,
224
+
225
+ "total": 11873,
226
+ "HasAns_exact": 77.93522267206478,
227
+ "HasAns_f1": 84.02838248389763,
228
+ "HasAns_total": 5928,
229
+ "NoAns_exact": 81.79983179142137,
230
+ "NoAns_f1": 81.79983179142137,
231
+ "NoAns_total": 5945
232
+ ```
233
+
234
+ ## Authors
235
+ **Branden Chan:** branden.chan@deepset.ai
236
+ **Timo Möller:** timo.moeller@deepset.ai
237
+ **Malte Pietsch:** malte.pietsch@deepset.ai
238
+ **Tanay Soni:** tanay.soni@deepset.ai
239
+
240
+ ## About us
241
+
242
+ <div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
243
+ <div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
244
+ <img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
245
+ </div>
246
+ <div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
247
+ <img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/haystack-logo-colored.png" class="w-40"/>
248
+ </div>
249
+ </div>
250
+
251
+ [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.
252
+
253
+
254
+ Some of our other work:
255
+ - [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")](https://huggingface.co/deepset/tinyroberta-squad2)
256
+ - [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
257
+ - [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
258
+
259
+ ## Get in touch and join the Haystack community
260
+
261
+ <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>.
262
+
263
+ We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
264
+
265
+ [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)
266
+
267
+ By the way: [we're hiring!](http://www.deepset.ai/jobs)
268
+
269
+