sjrhuschlee
commited on
Commit
•
e9839d3
1
Parent(s):
ddfc3c8
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,66 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
datasets:
|
4 |
+
- squad_v2
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
tags:
|
8 |
+
- bart
|
9 |
+
- question-answering
|
10 |
---
|
11 |
+
|
12 |
+
# bart-base for QA
|
13 |
+
|
14 |
+
This model is a fine-tuned version of [facebook/bart-base](https://huggingface.co/facebook/bart-base) on the [SQuAD2.0](https://huggingface.co/datasets/squad_v2) dataset.
|
15 |
+
|
16 |
+
## Overview
|
17 |
+
**Language model:** bart-base
|
18 |
+
**Language:** English
|
19 |
+
**Downstream-task:** Extractive QA
|
20 |
+
**Training data:** SQuAD 2.0
|
21 |
+
**Eval data:** SQuAD 2.0
|
22 |
+
**Infrastructure**: 1x NVIDIA 3070
|
23 |
+
|
24 |
+
|
25 |
+
## Model Usage
|
26 |
+
```python
|
27 |
+
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
28 |
+
model_name = "sjrhuschlee/bart-base-squad2"
|
29 |
+
# a) Using pipelines
|
30 |
+
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
|
31 |
+
qa_input = {
|
32 |
+
'question': 'Where do I live?',
|
33 |
+
'context': 'My name is Sarah and I live in London'
|
34 |
+
}
|
35 |
+
res = nlp(qa_input)
|
36 |
+
# b) Load model & tokenizer
|
37 |
+
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
39 |
+
```
|
40 |
+
|
41 |
+
## Metrics
|
42 |
+
More information needed.
|
43 |
+
|
44 |
+
## Training procedure
|
45 |
+
|
46 |
+
### Training hyperparameters
|
47 |
+
|
48 |
+
The following hyperparameters were used during training:
|
49 |
+
- learning_rate: 2e-06
|
50 |
+
- train_batch_size: 16
|
51 |
+
- eval_batch_size: 8
|
52 |
+
- seed: 42
|
53 |
+
- gradient_accumulation_steps: 6
|
54 |
+
- total_train_batch_size: 96
|
55 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
56 |
+
- lr_scheduler_type: linear
|
57 |
+
- lr_scheduler_warmup_ratio: 0.1
|
58 |
+
- num_epochs: 4.0
|
59 |
+
|
60 |
+
|
61 |
+
### Framework versions
|
62 |
+
|
63 |
+
- Transformers 4.30.0.dev0
|
64 |
+
- Pytorch 2.0.1+cu117
|
65 |
+
- Datasets 2.12.0
|
66 |
+
- Tokenizers 0.13.3
|