Datasets ⭐
SQuAD Dataset
Load the SQuAD dataset in Python fast with one line of code. 100,000 questions with 50,000 unanswerable questions. Stream SQuAD while training ML models.

SQuAD Dataset

What is SQuAD Dataset?

The SQuAD(Stanford Question Answering Dataset) dataset consists of 100,000 questions with over 50,000 unanswerable questions and additionally assesses a system's capacity to not only answer reading comprehension questions, but also to refrain from answering a question that cannot be answered based on the given paragraph.

Download SQuAD Dataset in Python

Instead of downloading the SQuAD dataset in Python, you can effortlessly load it in Python via our open-source package Hub with just one line of code.

Load SQuAD Dataset Training Subset in Python

import hub
ds = hub.load('hub://activeloop/squad-train')

Load SQuAD Dataset Validation Subset in Python

import hub
ds = hub.load('hub://activeloop/squad-val')

SQuAD Dataset Structure

SQuAD Data Fields

  • id : tensor containing article id.
  • title : tensor containing the title.
  • context: tensor containing a context from the article.
  • question : tensor containg the question
  • text : tensor containing the text
  • answer_start : tensor that contains the starting index of the answer.
  • is_impossible: A label that represents whether answering is possible or impossible.If it is impossible, label represents the value 1 for True. If not impossible label respresents the value o for False.

SQuAD Data Splits

  • The SQuAD dataset training set is composed of 86821 samples.
  • The SQuAD dataset validation set is composed of 20302 samples.

How to use SQuAD Dataset with PyTorch and TensorFlow in Python

Train a model on SQuAD dataset with PyTorch in Python

Let's use Hub's built-in PyTorch one-line dataloader to connect the data to the compute:
dataloader = ds.pytorch(num_workers=0, batch_size=4, shuffle=False)

Train a model on SQuAD dataset with TensorFlow in Python

dataloader = ds.tensorflow()

SQuAD Dataset Creation

Data Collection and Normalization Information
Up to five questions that were impossible to answer based on each paragraph alone were written with the help of crowd workers, referring entities in the paragraph and ensuring that a credible response could be found from the entire SQuAD 1.1 text. Those questions from workers who didn't understand the task on that article were screened to reduce noise. The train, development, and test splits were constructed using the same article division as SQuAD 1.1, with each split integrating old and new data and eliminating articles containing unanswerable questions. For SQuAD 2.0, the ratio of answerable to unanswerable questions in these splits is around one-to-one, whereas train data has roughly twice as many answerable as unanswerable questions.

Additional Information about SQuAD Dataset

SQuAD Dataset Description

SQuAD Dataset Curators

Pranav Rajpurkar, Robin Jia, Percy Liang

SQuAD Dataset Licensing Information

SQuAD Dataset Citation Information

title={Know what you don't know: Unanswerable questions for SQuAD},
author={Rajpurkar, Pranav and Jia, Robin and Liang, Percy},
journal={arXiv preprint arXiv:1806.03822},