Dataset Viewer
Auto-converted to Parquet Duplicate
docid
int64
0
110k
document
stringlengths
385
519k
0
The Walking Dead (season 8) The eighth season of The Walking Dead , an American post-apocalyptic horror television series on AMC , premiered on October 22 , 2017 , and will consist of 16 episodes split into two eight - episode parts , with the second part debuting on February 25 , 2018 . Developed for television by Fra...
1
Persephone In Greek mythology , Persephone ( / pərˈsɛfəni / ; Greek : Περσεφόνη ) , also called Kore ( / ˈkɔːriː / ; `` the maiden '' ) , is the daughter of Zeus and Demeter and is the queen of the underworld . Homer describes her as the formidable , venerable majestic princess of the underworld , who carries into effe...
2
Colony (biology) In biology , a colony is composed of two or more conspecific individuals living in close association with , or connected to , one another . This association is usually for mutual benefit such as stronger defense or the ability to attack bigger prey . It is a cluster of identical cells ( clones ) on the...
3
The Man in the High Castle (TV series) The Man in the High Castle is an American dystopian alternative history television series produced by Amazon Studios , Scott Free Productions , Headline Pictures , Electric Shepherd Productions and Big Light Productions . The series is loosely based on the 1962 novel of the same n...
4
List of heads of state of Nigeria This is a list of the heads of state of Nigeria , from independence in 1960 to the present day . From 1960 to 1963 the head of state under the Nigeria Independence Act 1960 was the Queen of Nigeria , Elizabeth II , who was also monarch of the United Kingdom and the other Commonwealth r...
5
"List of awards and nominations received by Game of Thrones Game of Thrones is an American fantasy d(...TRUNCATED)
6
"Judaism Judaica ( clockwise from top ) : Shabbat candlesticks , handwashing cup , Chumash and Tanak(...TRUNCATED)
7
"Hanggang Makita Kang Muli Hanggang Makita Kang Muli ( International title : Until We Meet Again / l(...TRUNCATED)
8
"Football in Spain Association football is the most popular sport in Spain , followed by basketball (...TRUNCATED)
9
"Robot-assisted surgery Robotic surgery , computer - assisted surgery , and robotically - assisted s(...TRUNCATED)
End of preview. Expand in Data Studio

NQ320K (NCI-style preprocessing)

A reproduction of the NQ320K corpus used by generative-retrieval papers (DSI, NCI, GenRet, RIPOR, Ultron, LTRGR, …) built directly from the Hugging Face google-research-datasets/natural_questions snapshot.

At a glance

Split Rows
corpus 109,650
train pairs 307,373
validation pairs 7,830
  • Train pairs with non-empty long_answer: 152,148 / 307,373 (49.5%)
  • Train pairs with non-empty short_answer: 106,926 / 307,373 (34.8%)
  • Date built: 2026-04-30

Schema

corpus.jsonl

{"docid": 0, "document": "<NCI doc_tac string, ~5K-50K chars>"}

train.jsonl / valid.jsonl

{
  "query": "when is the last episode of season 8 of the walking dead",
  "docid": 0,
  "nq_id": "5225754983651766092",
  "url": "https://en.wikipedia.org//w/index.php?title=The_Walking_Dead_(season_8)&oldid=...",
  "title": "The Walking Dead (season 8)",
  "long_answer": "List of The Walking Dead episodes ...",
  "short_answer": ""
}

docid is a stable integer that joins to corpus.jsonl. To materialise a (query, document) pair:

from datasets import load_dataset
corpus = load_dataset("<your-username>/NQ320K-NCI", "corpus", split="corpus")
pairs  = load_dataset("<your-username>/NQ320K-NCI", "pairs",  split="train")

doc_lookup = {r["docid"]: r["document"] for r in corpus}
for p in pairs:
    document = doc_lookup[p["docid"]]
    # ... feed (p["query"], document) to your model

Preprocessing

Faithful port of the official NCI notebook (Wang et al., NeurIPS 2022, Data_process/NQ_dataset/NQ_dataset_Process.ipynb in the released code). Each NQ row produces one record:

  1. Reconstruct document_text = " ".join(document.tokens.token) (HTML tags appear as their own tokens).
  2. title = document.title
  3. abs = document_text[<P>+3 : </P>]HTML tags inside <P> are kept, matching NCI.
  4. content = document_text[</P>+4 : second-to-last </Ul>], then HTML stripped, \n deleted, multiple spaces collapsed.
  5. doc_tac = title + abs + contentno separators.
  6. long_answer / short_answer: token-span slices from the first annotator (annotations[0]), HTML stripped.

Documents are de-duplicated by their BERT-uncased-tokenizer-normalised title (tokenizer.tokenize(title) → convert_to_ids → decode), exactly as in NCI's released notebook. Concatenating train + validation and dropping duplicates yields 109,650 unique documents (NCI reports 109,739; the ~80-doc delta comes from a slightly newer Hugging Face snapshot of NQ).

Known formatting characteristics

These are inherited from NCI's preprocessing and intentional:

  • Token-joined whitespace: "AMC ," instead of "AMC,". NCI's doc_tac is built by " ".join(tokens), leaving a space before every punctuation mark. NCI's downstream BERT/T5 tokenizer absorbs these correctly; you may want to detokenize when feeding into other encoders.
  • HTML tags inside abs: e.g. "<Table><Tr>…<P>The eighth season…</P>". Only content has its tags stripped. This is the canonical NCI format.
  • Non-detokenized hyphenation: "post - apocalyptic", "Spider - Man".

Caveat: nq_id is a string

NQ's original example_id is a uint64, and roughly half of the IDs exceed 2^63 = 9.22 × 10^18. They fit unsigned but overflow signed int64.

nq_id is therefore stored as a string, exactly as Google publishes it. Do not auto-cast it to int64 — about 50% of the values would silently wrap to negative numbers. If you load with pandas:

import pandas as pd
df = pd.read_json("train.jsonl", lines=True, dtype={"nq_id": str})

If you load with datasets, the typed dataset_info in this card already enforces string, so you don't need to do anything extra:

from datasets import load_dataset
ds = load_dataset("<your-username>/NQ320K-NCI", "pairs")
print(ds["train"].features["nq_id"])  # Value(dtype='string', id=None)

License & attribution

This dataset is a derivative of the Natural Questions dataset by Google (Kwiatkowski et al., TACL 2019), released under CC BY-SA 3.0. This derivative dataset is therefore also released under CC BY-SA 3.0 (ShareAlike).

The preprocessing recipe is from Neural Corpus Indexer (Wang et al., NeurIPS 2022); see their released notebook.

Citation

If you use this dataset, please cite:

@article{kwiatkowski2019natural,
  author    = {Kwiatkowski, Tom and Palomaki, Jennimaria and Redfield, Olivia
               and Collins, Michael and Parikh, Ankur and Alberti, Chris and
               Epstein, Danielle and Polosukhin, Illia and Devlin, Jacob and
               Lee, Kenton and Toutanova, Kristina and Jones, Llion and Kelcey,
               Matthew and Chang, Ming-Wei and Dai, Andrew and Uszkoreit, Jakob
               and Le, Quoc and Petrov, Slav},
  title     = {Natural Questions: a Benchmark for Question Answering Research},
  journal   = {Transactions of the Association for Computational Linguistics},
  year      = {2019}
}

@inproceedings{wang2022neural,
  author    = {Wang, Yujing and Hou, Yingyan and Wang, Haonan and Miao, Ziming
               and Wu, Shibin and Sun, Hao and Chen, Qi and Xia, Yuqing and
               Chi, Chengmin and Zhao, Guoshuai and Liu, Zheng and Xie, Xing
               and Sun, Hao Allen and Deng, Weiwei and Zhang, Qi and Yang,
               Mao},
  title     = {A Neural Corpus Indexer for Document Retrieval},
  booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
  year      = {2022}
}
Downloads last month
87

Paper for dqmis/NQ320K-NCI