csarron / mobilebert-uncased-squad-v2

huggingface.co
Total runs: 29.9K
24-hour runs: -875
7-day runs: 156
30-day runs: 15.1K
Model's Last Updated: July 19 2023
question-answering

Introduction of mobilebert-uncased-squad-v2

Model Details of mobilebert-uncased-squad-v2

MobileBERT fine-tuned on SQuAD v2

MobileBERT is a thin version of BERT_LARGE, while equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks.

This model was fine-tuned from the HuggingFace checkpoint google/mobilebert-uncased on SQuAD2.0 .

Details
Dataset Split # samples
SQuAD2.0 train 130k
SQuAD2.0 eval 12.3k
Fine-tuning
  • Python: 3.7.5

  • Machine specs:

    CPU: Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz

    Memory: 32 GiB

    GPUs: 2 GeForce GTX 1070, each with 8GiB memory

    GPU driver: 418.87.01, CUDA: 10.1

  • script:

    # after install https://github.com/huggingface/transformers
    
    cd examples/question-answering
    mkdir -p data
    
    wget -O data/train-v2.0.json https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v2.0.json
    
    wget -O data/dev-v2.0.json  https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v2.0.json
    
    export SQUAD_DIR=`pwd`/data
    
    python run_squad.py \
      --model_type mobilebert \
      --model_name_or_path google/mobilebert-uncased \
      --do_train \
      --do_eval \
      --do_lower_case \
      --version_2_with_negative \
      --train_file $SQUAD_DIR/train-v2.0.json \
      --predict_file $SQUAD_DIR/dev-v2.0.json \
      --per_gpu_train_batch_size 16 \
      --per_gpu_eval_batch_size 16 \
      --learning_rate 4e-5 \
      --num_train_epochs 5.0 \
      --max_seq_length 320 \
      --doc_stride 128 \
      --warmup_steps 1400 \
      --save_steps 2000 \
      --output_dir $SQUAD_DIR/mobilebert-uncased-warmup-squad_v2 2>&1 | tee train-mobilebert-warmup-squad_v2.log
    

It took about 3.5 hours to finish.

Results

Model size : 95M

Metric # Value # Original ( Table 5 )
EM 75.2 76.2
F1 78.8 79.2

Note that the above results didn't involve any hyperparameter search.

Example Usage
from transformers import pipeline

qa_pipeline = pipeline(
    "question-answering",
    model="csarron/mobilebert-uncased-squad-v2",
    tokenizer="csarron/mobilebert-uncased-squad-v2"
)

predictions = qa_pipeline({
    'context': "The game was played on February 7, 2016 at Levi's Stadium in the San Francisco Bay Area at Santa Clara, California.",
    'question': "What day was the game played on?"
})

print(predictions)
# output:
# {'score': 0.71434086561203, 'start': 23, 'end': 39, 'answer': 'February 7, 2016'}

Created by Qingqing Cao | GitHub | Twitter

Made with ❤️ in New York.

Runs of csarron mobilebert-uncased-squad-v2 on huggingface.co

29.9K
Total runs
-875
24-hour runs
-887
3-day runs
156
7-day runs
15.1K
30-day runs

More Information About mobilebert-uncased-squad-v2 huggingface.co Model

More mobilebert-uncased-squad-v2 license Visit here:

https://choosealicense.com/licenses/mit

mobilebert-uncased-squad-v2 huggingface.co

mobilebert-uncased-squad-v2 huggingface.co is an AI model on huggingface.co that provides mobilebert-uncased-squad-v2's model effect (), which can be used instantly with this csarron mobilebert-uncased-squad-v2 model. huggingface.co supports a free trial of the mobilebert-uncased-squad-v2 model, and also provides paid use of the mobilebert-uncased-squad-v2. Support call mobilebert-uncased-squad-v2 model through api, including Node.js, Python, http.

mobilebert-uncased-squad-v2 huggingface.co Url

https://huggingface.co/csarron/mobilebert-uncased-squad-v2

csarron mobilebert-uncased-squad-v2 online free

mobilebert-uncased-squad-v2 huggingface.co is an online trial and call api platform, which integrates mobilebert-uncased-squad-v2's modeling effects, including api services, and provides a free online trial of mobilebert-uncased-squad-v2, you can try mobilebert-uncased-squad-v2 online for free by clicking the link below.

csarron mobilebert-uncased-squad-v2 online free url in huggingface.co:

https://huggingface.co/csarron/mobilebert-uncased-squad-v2

mobilebert-uncased-squad-v2 install

mobilebert-uncased-squad-v2 is an open source model from GitHub that offers a free installation service, and any user can find mobilebert-uncased-squad-v2 on GitHub to install. At the same time, huggingface.co provides the effect of mobilebert-uncased-squad-v2 install, users can directly use mobilebert-uncased-squad-v2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

mobilebert-uncased-squad-v2 install url in huggingface.co:

https://huggingface.co/csarron/mobilebert-uncased-squad-v2

Url of mobilebert-uncased-squad-v2

mobilebert-uncased-squad-v2 huggingface.co Url

Provider of mobilebert-uncased-squad-v2 huggingface.co

csarron
ORGANIZATIONS

Other API from csarron

huggingface.co

Total runs: 11
Run Growth: 7
Growth Rate: 63.64%
Updated:July 08 2023
huggingface.co

Total runs: 5
Run Growth: 2
Growth Rate: 40.00%
Updated:July 08 2023