readme: ---
  language: en
  license: apache-2.0
  datasets:
  - squad
  metrics:
  - squad
  model-index:
  - name: distilbert-base-cased-distilled-squad
    results:
    - task:
        type: question-answering
        name: Question Answering
      dataset:
        name: squad
        type: squad
        config: plain_text
        split: validation
      metrics:
      - type: exact_match
        value: 79.5998
        name: Exact Match
        verified: true
        verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZTViZDA2Y2E2NjUyMjNjYjkzNTUzODc5OTk2OTNkYjQxMDRmMDhlYjdmYWJjYWQ2N2RlNzY1YmI3OWY1NmRhOSIsInZlcnNpb24iOjF9.ZJHhboAMwsi3pqU-B-XKRCYP_tzpCRb8pEjGr2Oc-TteZeoWHI8CXcpDxugfC3f7d_oBcKWLzh3CClQxBW1iAQ
      - type: f1
        value: 86.9965
        name: F1
        verified: true
        verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZWZlMzY2MmE1NDNhOGNjNWRmODg0YjQ2Zjk5MjUzZDQ2MDYxOTBlMTNhNzQ4NTA2NjRmNDU3MGIzMTYwMmUyOSIsInZlcnNpb24iOjF9.z0ZDir87aT7UEmUeDm8Uw0oUdAqzlBz343gwnsQP3YLfGsaHe-jGlhco0Z7ISUd9NokyCiJCRc4NNxJQ83IuCw
  ---
  
  # DistilBERT base cased distilled SQuAD
  
  ## Table of Contents
  - [Model Details](#model-details)
  - [How To Get Started With the Model](#how-to-get-started-with-the-model)
  - [Uses](#uses)
  - [Risks, Limitations and Biases](#risks-limitations-and-biases)
  - [Training](#training)
  - [Evaluation](#evaluation)
  - [Environmental Impact](#environmental-impact)
  - [Technical Specifications](#technical-specifications)
  - [Citation Information](#citation-information)
  - [Model Card Authors](#model-card-authors)
  
  ## Model Details
  
  **Model Description:** The DistilBERT model was proposed in the blog post [Smaller, faster, cheaper, lighter: Introducing DistilBERT, adistilled version of BERT](https://medium.com/huggingface/distilbert-8cf3380435b5), and the paper [DistilBERT, adistilled version of BERT: smaller, faster, cheaper and lighter](https://arxiv.org/abs/1910.01108). DistilBERT is a small, fast, cheap and light Transformer model trained by distilling BERT base. It has 40% less parameters than *bert-base-uncased*, runs 60% faster while preserving over 95% of BERT's performances as measured on the GLUE language understanding benchmark.
  
  This model is a fine-tune checkpoint of [DistilBERT-base-cased](https://huggingface.co/distilbert-base-cased), fine-tuned using (a second step of) knowledge distillation on [SQuAD v1.1](https://huggingface.co/datasets/squad). 
  
  - **Developed by:** Hugging Face
  - **Model Type:** Transformer-based language model
  - **Language(s):** English 
  - **License:** Apache 2.0
  - **Related Models:** [DistilBERT-base-cased](https://huggingface.co/distilbert-base-cased)
  - **Resources for more information:**
    - See [this repository](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation) for more about Distil\* (a class of compressed models including this model)
    - See [Sanh et al. (2019)](https://arxiv.org/abs/1910.01108) for more information about knowledge distillation and the training procedure
  
  ## How to Get Started with the Model 
  
  Use the code below to get started with the model. 
  
  ```python
  >>> from transformers import pipeline
  >>> question_answerer = pipeline("question-answering", model='distilbert-base-cased-distilled-squad')
  
  >>> context = r"""
  ... Extractive Question Answering is the task of extracting an answer from a text given a question. An example     of a
  ... question answering dataset is the SQuAD dataset, which is entirely based on that task. If you would like to fine-tune
  ... a model on a SQuAD task, you may leverage the examples/pytorch/question-answering/run_squad.py script.
  ... """
  
  >>> result = question_answerer(question="What is a good example of a question answering dataset?",     context=context)
  >>> print(
  ... f"Answer: '{result['answer']}', score: {round(result['score'], 4)}, start: {result['start']}, end: {result['end']}"
  ...)
  
  Answer: 'SQuAD dataset', score: 0.5152, start: 147, end: 160
  ```
  
  Here is how to use this model in PyTorch:
  
  ```python
  from transformers import DistilBertTokenizer, DistilBertModel
  import torch
  tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-cased-distilled-squad')
  model = DistilBertModel.from_pretrained('distilbert-base-cased-distilled-squad')
  
  question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
  
  inputs = tokenizer(question, text, return_tensors="pt")
  with torch.no_grad():
      outputs = model(**inputs)
  
  print(outputs)
  ```
  
  And in TensorFlow: 
  
  ```python
  from transformers import DistilBertTokenizer, TFDistilBertForQuestionAnswering
  import tensorflow as tf
  
  tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-cased-distilled-squad")
  model = TFDistilBertForQuestionAnswering.from_pretrained("distilbert-base-cased-distilled-squad")
  
  question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
  
  inputs = tokenizer(question, text, return_tensors="tf")
  outputs = model(**inputs)
  
  answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
  answer_end_index = in