Back to all models
question-answering mask_token: [MASK]
Query this model
馃敟 This model is currently loaded and running on the Inference API. 鈿狅笍 This model could not be loaded by the inference API. 鈿狅笍 This model can be loaded on the Inference API on-demand.
JSON Output
API endpoint  

鈿★笍 Upgrade your account to access the Inference API

							curl -X POST \
-H "Authorization: Bearer YOUR_ORG_OR_USER_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"question": "Where does she live?", "context": "She lives in Berlin."}' \
Share Copied link to clipboard

Monthly model downloads

twmkn9/albert-base-v2-squad2 twmkn9/albert-base-v2-squad2
last 30 days



Contributed by

twmkn9 Travis McGuire
4 models

How to use this model directly from the 馃/transformers library:

Copy to clipboard
from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("twmkn9/albert-base-v2-squad2") model = AutoModelForQuestionAnswering.from_pretrained("twmkn9/albert-base-v2-squad2")

This model is ALBERT base v2 trained on SQuAD v2 as:

export SQUAD_DIR=../../squad2
    --model_type albert 
    --model_name_or_path albert-base-v2 
    --save_steps 100000 
    --train_file $SQUAD_DIR/train-v2.0.json 
    --predict_file $SQUAD_DIR/dev-v2.0.json 
    --per_gpu_train_batch_size 8 
    --num_train_epochs 3 
    --learning_rate 3e-5 
    --max_seq_length 384 
    --doc_stride 128 
    --output_dir ./tmp/albert_fine/

Performance on a dev subset is close to the original paper:

    'exact': 78.71010200723923, 
    'f1': 81.89228117126069, 
    'total': 6078, 
    'HasAns_exact': 75.39518900343643, 
    'HasAns_f1': 82.04167868004215, 
    'HasAns_total': 2910, 
    'NoAns_exact': 81.7550505050505, 
    'NoAns_f1': 81.7550505050505, 
    'NoAns_total': 3168, 
    'best_exact': 78.72655478775913, 
    'best_exact_thresh': 0.0, 
    'best_f1': 81.90873395178066, 
    'best_f1_thresh': 0.0

We are hopeful this might save you time, energy, and compute. Cheers!