julien-c HF staff commited on
Commit
a45563f
1 Parent(s): 0109ade

Migrate model card from transformers-repo

Browse files

Read 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-squadv2/README.md

Files changed (1) hide show
  1. README.md +72 -0
README.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ datasets:
4
+ - squad_v2
5
+ ---
6
+
7
+ # SqueezeBERT + SQuAD v2
8
+
9
+ [squeezebert-uncased](https://huggingface.co/squeezebert/squeezebert-uncased) fine-tuned on [SQUAD v2](https://rajpurkar.github.io/SQuAD-explorer/explore/v2.0/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
+ **SQuAD2.0** combines the 100,000 questions in SQuAD1.1 with over 50,000 unanswerable questions written adversarially by crowdworkers to look similar to answerable ones. To do well on SQuAD2.0, systems must not only answer questions when possible, but also determine when no answer is supported by the paragraph and abstain from answering.
21
+
22
+ ## Model training 🏋️‍
23
+
24
+ The model was trained on a Tesla P100 GPU and 25GB of RAM with the following command:
25
+
26
+ ```bash
27
+ python /content/transformers/examples/question-answering/run_squad.py \
28
+ --model_type bert \
29
+ --model_name_or_path squeezebert/squeezebert-uncased \
30
+ --do_train \
31
+ --do_eval \
32
+ --do_lower_case \
33
+ --train_file /content/dataset/train-v2.0.json \
34
+ --predict_file /content/dataset/dev-v2.0.json \
35
+ --per_gpu_train_batch_size 16 \
36
+ --learning_rate 3e-5 \
37
+ --num_train_epochs 15 \
38
+ --max_seq_length 384 \
39
+ --doc_stride 128 \
40
+ --output_dir /content/output_dir \
41
+ --overwrite_output_dir \
42
+ --version_2_with_negative \
43
+ --save_steps 2000
44
+ ```
45
+
46
+ ## Test set Results 🧾
47
+
48
+ | Metric | # Value |
49
+ | ------ | --------- |
50
+ | **EM** | **69.98** |
51
+ | **F1** | **74.14** |
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-squadv2')
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.9768241047859192, '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;">&hearts;</span> in Spain