Migrate model card from transformers-repo
Browse filesRead announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/a-ware/roberta-large-squad-classification/README.md
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- squad_v2
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Roberta-LARGE finetuned on SQuADv2
|
| 7 |
+
|
| 8 |
+
This is roberta-large model finetuned on SQuADv2 dataset for question answering answerability classification
|
| 9 |
+
|
| 10 |
+
## Model details
|
| 11 |
+
This model is simply an Sequenceclassification model with two inputs (context and question) in a list.
|
| 12 |
+
The result is either [1] for answerable or [0] if it is not answerable.
|
| 13 |
+
It was trained over 4 epochs on squadv2 dataset and can be used to filter out which context is good to give into the QA model to avoid bad answers.
|
| 14 |
+
|
| 15 |
+
## Model training
|
| 16 |
+
This model was trained with following parameters using simpletransformers wrapper:
|
| 17 |
+
```
|
| 18 |
+
train_args = {
|
| 19 |
+
'learning_rate': 1e-5,
|
| 20 |
+
'max_seq_length': 512,
|
| 21 |
+
'overwrite_output_dir': True,
|
| 22 |
+
'reprocess_input_data': False,
|
| 23 |
+
'train_batch_size': 4,
|
| 24 |
+
'num_train_epochs': 4,
|
| 25 |
+
'gradient_accumulation_steps': 2,
|
| 26 |
+
'no_cache': True,
|
| 27 |
+
'use_cached_eval_features': False,
|
| 28 |
+
'save_model_every_epoch': False,
|
| 29 |
+
'output_dir': "bart-squadv2",
|
| 30 |
+
'eval_batch_size': 8,
|
| 31 |
+
'fp16_opt_level': 'O2',
|
| 32 |
+
}
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
## Results
|
| 36 |
+
```{"accuracy": 90.48%}```
|
| 37 |
+
## Model in Action 🚀
|
| 38 |
+
```python3
|
| 39 |
+
from simpletransformers.classification import ClassificationModel
|
| 40 |
+
|
| 41 |
+
model = ClassificationModel('roberta', 'a-ware/roberta-large-squadv2', num_labels=2, args=train_args)
|
| 42 |
+
|
| 43 |
+
predictions, raw_outputs = model.predict([["my dog is an year old. he loves to go into the rain", "how old is my dog ?"]])
|
| 44 |
+
print(predictions)
|
| 45 |
+
==> [1]
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
> Created with ❤️ by A-ware UG [](https://github.com/aware-ai)
|