Commit
路
ac472cf
1
Parent(s):
c0bb917
Update README.md
Browse files
README.md
CHANGED
@@ -10,202 +10,86 @@ metrics:
|
|
10 |
library_name: transformers
|
11 |
pipeline_tag: question-answering
|
12 |
---
|
13 |
-
# Model
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
|
18 |
-
|
19 |
-
## Model Details
|
20 |
|
21 |
### Model Description
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
- **
|
28 |
-
- **Funded by [optional]:** [More Information Needed]
|
29 |
-
- **Shared by [optional]:** [More Information Needed]
|
30 |
-
- **Model type:** [More Information Needed]
|
31 |
-
- **Language(s) (NLP):** [More Information Needed]
|
32 |
-
- **License:** [More Information Needed]
|
33 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
34 |
-
|
35 |
-
### Model Sources [optional]
|
36 |
-
|
37 |
-
<!-- Provide the basic links for the model. -->
|
38 |
-
|
39 |
-
- **Repository:** [More Information Needed]
|
40 |
-
- **Paper [optional]:** [More Information Needed]
|
41 |
-
- **Demo [optional]:** [More Information Needed]
|
42 |
-
|
43 |
-
## Uses
|
44 |
-
|
45 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
46 |
-
|
47 |
-
### Direct Use
|
48 |
-
|
49 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
50 |
-
|
51 |
-
[More Information Needed]
|
52 |
-
|
53 |
-
### Downstream Use [optional]
|
54 |
|
55 |
-
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
### Out-of-Scope Use
|
60 |
-
|
61 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
62 |
-
|
63 |
-
[More Information Needed]
|
64 |
-
|
65 |
-
## Bias, Risks, and Limitations
|
66 |
-
|
67 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
68 |
-
|
69 |
-
[More Information Needed]
|
70 |
-
|
71 |
-
### Recommendations
|
72 |
-
|
73 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
74 |
-
|
75 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
76 |
-
|
77 |
-
## How to Get Started with the Model
|
78 |
-
|
79 |
-
Use the code below to get started with the model.
|
80 |
-
|
81 |
-
[More Information Needed]
|
82 |
|
83 |
## Training Details
|
84 |
|
85 |
### Training Data
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
90 |
|
91 |
-
|
|
|
|
|
|
|
|
|
92 |
|
93 |
-
|
|
|
|
|
|
|
|
|
94 |
|
95 |
-
|
96 |
|
97 |
-
|
98 |
|
|
|
99 |
|
100 |
#### Training Hyperparameters
|
101 |
|
102 |
-
- **Training regime:**
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
## Evaluation
|
111 |
|
112 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
113 |
-
|
114 |
-
### Testing Data, Factors & Metrics
|
115 |
-
|
116 |
-
#### Testing Data
|
117 |
-
|
118 |
-
<!-- This should link to a Dataset Card if possible. -->
|
119 |
-
|
120 |
-
[More Information Needed]
|
121 |
-
|
122 |
-
#### Factors
|
123 |
-
|
124 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
125 |
-
|
126 |
-
[More Information Needed]
|
127 |
-
|
128 |
-
#### Metrics
|
129 |
-
|
130 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
131 |
-
|
132 |
-
[More Information Needed]
|
133 |
-
|
134 |
-
### Results
|
135 |
-
|
136 |
-
[More Information Needed]
|
137 |
-
|
138 |
-
#### Summary
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
## Model Examination [optional]
|
143 |
-
|
144 |
-
<!-- Relevant interpretability work for the model goes here -->
|
145 |
-
|
146 |
-
[More Information Needed]
|
147 |
-
|
148 |
-
## Environmental Impact
|
149 |
-
|
150 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
151 |
-
|
152 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
153 |
-
|
154 |
-
- **Hardware Type:** [More Information Needed]
|
155 |
-
- **Hours used:** [More Information Needed]
|
156 |
-
- **Cloud Provider:** [More Information Needed]
|
157 |
-
- **Compute Region:** [More Information Needed]
|
158 |
-
- **Carbon Emitted:** [More Information Needed]
|
159 |
-
|
160 |
-
## Technical Specifications [optional]
|
161 |
-
|
162 |
-
### Model Architecture and Objective
|
163 |
-
|
164 |
-
[More Information Needed]
|
165 |
-
|
166 |
-
### Compute Infrastructure
|
167 |
-
|
168 |
-
[More Information Needed]
|
169 |
-
|
170 |
-
#### Hardware
|
171 |
-
|
172 |
-
[More Information Needed]
|
173 |
-
|
174 |
-
#### Software
|
175 |
-
|
176 |
-
[More Information Needed]
|
177 |
-
|
178 |
-
## Citation [optional]
|
179 |
-
|
180 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
181 |
-
|
182 |
-
**BibTeX:**
|
183 |
-
|
184 |
-
[More Information Needed]
|
185 |
-
|
186 |
-
**APA:**
|
187 |
-
|
188 |
-
[More Information Needed]
|
189 |
-
|
190 |
-
## Glossary [optional]
|
191 |
-
|
192 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
193 |
-
|
194 |
-
[More Information Needed]
|
195 |
-
|
196 |
-
## More Information [optional]
|
197 |
-
|
198 |
-
[More Information Needed]
|
199 |
-
|
200 |
-
## Model Card Authors [optional]
|
201 |
-
|
202 |
-
[More Information Needed]
|
203 |
-
|
204 |
-
## Model Card Contact
|
205 |
-
|
206 |
-
[More Information Needed]
|
207 |
-
|
208 |
-
### Info to format
|
209 |
Evaluation Dataset:
|
210 |
Dataset({
|
211 |
features: ['id', 'title', 'context', 'question', 'answers'],
|
@@ -216,21 +100,22 @@ Max Tokens Length:
|
|
216 |
Evaluation Metrics:
|
217 |
{'exact': 66.00660066006601, 'f1': 78.28040573606134, 'total': 909, 'HasAns_exact': 66.00660066006601, 'HasAns_f1': 78.28040573606134, 'HasAns_total': 909, 'best_exact': 66.00660066006601, 'best_exact_thresh': 0.0, 'best_f1': 78.28040573606134, 'best_f1_thresh': 0.0}
|
218 |
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
|
|
|
|
223 |
|
224 |
-
Eval dataset:
|
225 |
Dataset({
|
226 |
features: ['id', 'title', 'context', 'question', 'answers'],
|
227 |
-
num_rows:
|
228 |
})
|
229 |
|
230 |
-
|
231 |
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
|
|
10 |
library_name: transformers
|
11 |
pipeline_tag: question-answering
|
12 |
---
|
13 |
+
# Model card for SaraPiscitelli/roberta-base-qa-v1
|
14 |
+
This model is a **finetuned** model starting from the base transformer model [roberta-base](https://huggingface.co/roberta-base).
|
15 |
+
This model is finetuned on **extractive question answering** task using [squad dataset](https://huggingface.co/datasets/squad).
|
16 |
+
You can access the training code [here](https://github.com/sarapiscitelli/nlp-tasks/blob/main/scripts/train/question_answering.py) and the evaluation code [here](https://github.com/sarapiscitelli/nlp-tasks/blob/main/scripts/evaluation/question_answering.py).
|
|
|
|
|
|
|
17 |
|
18 |
### Model Description
|
19 |
|
20 |
+
- **Developed by:** Sara Piscitelli
|
21 |
+
- **Model type:** Transformer Encoder - RobertaBaseForQuestionAnswering (124.056.578 params)
|
22 |
+
- **Language(s) (NLP):** English
|
23 |
+
- **License:** Apache 2.0
|
24 |
+
- **Finetuned from model:** [roberta-base](https://huggingface.co/roberta-base)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
### Model Sources
|
27 |
|
28 |
+
- **training code:** [here](https://github.com/sarapiscitelli/nlp-tasks/blob/main/scripts/train/question_answering.py)
|
29 |
+
- **evaluation code:** [here](https://github.com/sarapiscitelli/nlp-tasks/blob/main/scripts/evaluation/question_answering.py).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
## Training Details
|
32 |
|
33 |
### Training Data
|
34 |
|
35 |
+
Train Dataset({
|
36 |
+
features: ['id', 'title', 'context', 'question', 'answers'],
|
37 |
+
num_rows: 8207
|
38 |
+
})
|
39 |
|
40 |
+
Eval dataset:
|
41 |
+
Dataset({
|
42 |
+
features: ['id', 'title', 'context', 'question', 'answers'],
|
43 |
+
num_rows: 637
|
44 |
+
})
|
45 |
|
46 |
+
Dataset:
|
47 |
+
squad = load_dataset("squad")
|
48 |
+
squad['train'] = squad['train'].select(range(30000))
|
49 |
+
squad['test'] = squad['validation']
|
50 |
+
squad['validation'] = squad['validation'].select(range(2000))
|
51 |
|
52 |
+
### Training Procedure
|
53 |
|
54 |
+
#### Preprocessing
|
55 |
|
56 |
+
max-tokens-length = 512
|
57 |
|
58 |
#### Training Hyperparameters
|
59 |
|
60 |
+
- **Training regime:** fp32
|
61 |
+
- **base_model_name_or_path:** roberta-base
|
62 |
+
- **max_tokens_length:** 512
|
63 |
+
- **weighted_loss** true
|
64 |
+
- **training_arguments:** TrainingArguments(
|
65 |
+
output_dir=results_dir,
|
66 |
+
num_train_epochs=5,
|
67 |
+
per_device_train_batch_size=8,
|
68 |
+
per_device_eval_batch_size=8,
|
69 |
+
gradient_accumulation_steps=1,
|
70 |
+
learning_rate=0.0001,
|
71 |
+
lr_scheduler_type="linear",
|
72 |
+
optim="adamw_torch",
|
73 |
+
eval_accumulation_steps=1,
|
74 |
+
evaluation_strategy="steps",
|
75 |
+
eval_steps=0.01,
|
76 |
+
save_strategy="steps",
|
77 |
+
save_steps=0.01,
|
78 |
+
logging_strategy="steps",
|
79 |
+
logging_steps=1,
|
80 |
+
report_to="tensorboard",
|
81 |
+
do_train=True,
|
82 |
+
do_eval=True,
|
83 |
+
max_grad_norm=0.3,
|
84 |
+
warmup_ratio=0.03,
|
85 |
+
group_by_length=True,
|
86 |
+
dataloader_drop_last=False,
|
87 |
+
fp16=False,
|
88 |
+
bf16=False
|
89 |
+
)
|
90 |
|
91 |
## Evaluation
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
Evaluation Dataset:
|
94 |
Dataset({
|
95 |
features: ['id', 'title', 'context', 'question', 'answers'],
|
|
|
100 |
Evaluation Metrics:
|
101 |
{'exact': 66.00660066006601, 'f1': 78.28040573606134, 'total': 909, 'HasAns_exact': 66.00660066006601, 'HasAns_f1': 78.28040573606134, 'HasAns_total': 909, 'best_exact': 66.00660066006601, 'best_exact_thresh': 0.0, 'best_f1': 78.28040573606134, 'best_f1_thresh': 0.0}
|
102 |
|
103 |
+
### Testing Data, Factors & Metrics
|
104 |
+
|
105 |
+
#### Testing Data
|
106 |
+
|
107 |
+
squad = load_dataset("squad")
|
108 |
+
squad['test'] = squad['validation']
|
109 |
|
|
|
110 |
Dataset({
|
111 |
features: ['id', 'title', 'context', 'question', 'answers'],
|
112 |
+
num_rows: 10570
|
113 |
})
|
114 |
|
115 |
+
#### Metrics
|
116 |
|
117 |
+
metric_eval = evaluate.load("squad_v2")
|
118 |
+
|
119 |
+
### Results
|
120 |
+
|
121 |
+
{'exact': 66.00660066006601, 'f1': 78.28040573606134, 'total': 909, 'HasAns_exact': 66.00660066006601, 'HasAns_f1': 78.28040573606134, 'HasAns_total': 909, 'best_exact': 66.00660066006601, 'best_exact_thresh': 0.0, 'best_f1': 78.28040573606134, 'best_f1_thresh': 0.0}
|