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/mrm8488/squeezebert-finetuned-squadv1/README.md
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
datasets:
|
| 4 |
+
- squad
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# SqueezeBERT + SQuAD (v1.1)
|
| 8 |
+
|
| 9 |
+
[squeezebert-uncased](https://huggingface.co/squeezebert/squeezebert-uncased) fine-tuned on [SQUAD v1.1](https://rajpurkar.github.io/SQuAD-explorer/explore/1.1/dev/) for **Q&A** downstream task.
|
| 10 |
+
|
| 11 |
+
## Details of SqueezeBERT
|
| 12 |
+
|
| 13 |
+
This model, `squeezebert-uncased`, is a pretrained model for the English language using a masked language modeling (MLM) and Sentence Order Prediction (SOP) objective.
|
| 14 |
+
SqueezeBERT was introduced in [this paper](https://arxiv.org/abs/2006.11316). This model is case-insensitive. The model architecture is similar to BERT-base, but with the pointwise fully-connected layers replaced with [grouped convolutions](https://blog.yani.io/filter-group-tutorial/).
|
| 15 |
+
The authors found that SqueezeBERT is 4.3x faster than `bert-base-uncased` on a Google Pixel 3 smartphone.
|
| 16 |
+
More about the model [here](https://arxiv.org/abs/2004.02984)
|
| 17 |
+
|
| 18 |
+
## Details of the downstream task (Q&A) - Dataset 📚 🧐 ❓
|
| 19 |
+
|
| 20 |
+
**S**tanford **Q**uestion **A**nswering **D**ataset (SQuAD) is a reading comprehension dataset, consisting of questions posed by crowdworkers on a set of Wikipedia articles, where the answer to every question is a segment of text, or span, from the corresponding reading passage, or the question might be unanswerable.
|
| 21 |
+
SQuAD v1.1 contains **100,000+** question-answer pairs on **500+** articles.
|
| 22 |
+
|
| 23 |
+
## Model training 🏋️
|
| 24 |
+
|
| 25 |
+
The model was trained on a Tesla P100 GPU and 25GB of RAM with the following command:
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
python /content/transformers/examples/question-answering/run_squad.py \
|
| 29 |
+
--model_type bert \
|
| 30 |
+
--model_name_or_path squeezebert/squeezebert-uncased \
|
| 31 |
+
--do_eval \
|
| 32 |
+
--do_train \
|
| 33 |
+
--do_lower_case \
|
| 34 |
+
--train_file /content/dataset/train-v1.1.json \
|
| 35 |
+
--predict_file /content/dataset/dev-v1.1.json \
|
| 36 |
+
--per_gpu_train_batch_size 16 \
|
| 37 |
+
--learning_rate 3e-5 \
|
| 38 |
+
--num_train_epochs 15 \
|
| 39 |
+
--max_seq_length 384 \
|
| 40 |
+
--doc_stride 128 \
|
| 41 |
+
--output_dir /content/output_dir \
|
| 42 |
+
--overwrite_output_dir \
|
| 43 |
+
--save_steps 2000
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Test set Results 🧾
|
| 47 |
+
|
| 48 |
+
| Metric | # Value |
|
| 49 |
+
| ------ | --------- |
|
| 50 |
+
| **EM** | **76.66** |
|
| 51 |
+
| **F1** | **85.83** |
|
| 52 |
+
|
| 53 |
+
Model Size: **195 MB**
|
| 54 |
+
|
| 55 |
+
### Model in action 🚀
|
| 56 |
+
|
| 57 |
+
Fast usage with **pipelines**:
|
| 58 |
+
|
| 59 |
+
```python
|
| 60 |
+
from transformers import pipeline
|
| 61 |
+
QnA_pipeline = pipeline('question-answering', model='mrm8488/squeezebert-finetuned-squadv1')
|
| 62 |
+
QnA_pipeline({
|
| 63 |
+
'context': 'A new strain of flu that has the potential to become a pandemic has been identified in China by scientists.',
|
| 64 |
+
'question': 'Who did identified it ?'
|
| 65 |
+
})
|
| 66 |
+
|
| 67 |
+
# Output: {'answer': 'scientists.', 'end': 106, 'score': 0.6988425850868225, 'start': 96}
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
> Created by [Manuel Romero/@mrm8488](https://twitter.com/mrm8488) | [LinkedIn](https://www.linkedin.com/in/manuel-romero-cs/)
|
| 71 |
+
|
| 72 |
+
> Made with <span style="color: #e25555;">♥</span> in Spain
|