CoolFace
Datasetpublic

microsoft/XL-DocBench

XL-DocBench Evidence-grounded reasoning across hundreds or thousands of pages. Fully verified by 194 human experts. Hongchen Wei1,†,‡, Yuanzhe Wang2,†,‡, Bei Liu2,*, Yifan Yang2, Qi Dai2, Ruichun Ma2, Kai Qiu2, Yunsheng Li2, Dongdong Chen2, Chong Luo2, Zhenzhong Chen1, Baining Guo2 1Wuhan University   2Microsoft   †Equal contribution   ‡Work done during an internship at MSRA   *Project leader Project Page · Paper · Live Leaderboard… See the full description on the dataset page: https://huggingface.co/datasets/microsoft/XL-DocBench.

sourceHugging Faceotherupdated 20d agoView on Hugging Face
7likes944downloads
load_data.py41 linesDownload Raw Back to examples
1#!/usr/bin/env python32"""Load XL-DocBench JSONL files with the Python standard library."""3 4from __future__ import annotations5 6import argparse7import json8from pathlib import Path9 10 11def parse_args() -> argparse.Namespace:12    parser = argparse.ArgumentParser(description=__doc__)13    parser.add_argument(14        "--release-root",15        type=Path,16        default=Path(__file__).resolve().parents[2],17        help="Release directory; defaults to the directory containing code/",18    )19    return parser.parse_args()20 21 22def read_jsonl(path: Path) -> list[dict]:23    with path.open("r", encoding="utf-8") as handle:24        return [json.loads(line) for line in handle if line.strip()]25 26 27def main() -> None:28    root = parse_args().release_root.resolve()29    documents = read_jsonl(root / "data/documents.jsonl")30    single_doc = read_jsonl(root / "data/qa_single_doc.jsonl")31    cross_doc = read_jsonl(root / "data/qa_cross_doc.jsonl")32 33    print(f"documents:  {len(documents):,}")34    print(f"single_doc: {len(single_doc):,}")35    print(f"cross_doc:  {len(cross_doc):,}")36    print(f"first question: {single_doc[0]['question']}")37 38 39if __name__ == "__main__":40    main()41