CoolFace
Apppublic

timchen0618/corpusqa-viewer

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes
App README

CorpusQA Viewer

Static viewer for **CorpusQA** (HF dataset) — a 10M-token benchmark for corpus-level analysis and reasoning, where evidence is dispersed across hundreds of documents.

Two tabs, with a set selector (context-length) at the top of the sidebar:

  • 📚 Corpus — every unique source document in the selected set. A dropdown selects a document by title (filter by title text and/or domain, or use prev/next). The panel shows the document's metadata (domain, file type, how many questions use it, size) and renders its full content (markdown + HTML tables, incl. Chinese filings) with marked.
  • ❓ Eval — every question in the selected set. A dropdown selects a question (filter by domain, or search question / id / answer / doc name). Each shows the question, the gold answer (lists rendered as bullets; the [] "no matching entities" case is called out), the supporting documents (clickable chips that jump to that document in the Corpus tab), metadata (id, domain, type, #docs), and collapsible answer-format instructions + system prompt.

Sets

SetQuestionsUnique docsCorpus text
128k32923~1.2 MB
1m329183~11.7 MB

The 4M and 10M sets are not yet on Hugging Face (ModelScope only) and are therefore not included.

Data layout

Each set is derived from CorpusQA's raw <set>_4domains.jsonl (108 MB / 1 GB — not committed here) into compact, browser-friendly files:

FileContents
sets.jsonmanifest of available sets (counts, domains, file pointers)
corpus_<set>.jsonper-document index: {title, domain, ext, size, n_questions, file}
corpus_<set>/*.txtone content shard per unique document (lazy-loaded)
eval_<set>.jsonquestions: {id, domain, type, question, answer, doc_files, system_prompt, answer_format}

Documents are heavily reused across questions, so the corpus is small even though each raw record embeds tens of documents. Content is stored as per-doc shards (largest ~0.3 MB) so no single file needs git-LFS and the browser loads one document at a time.

Each raw record's user prompt concatenates its documents (# Document N: markers) followed by a # Question: block; the build script splits at # Question:, then by # Document N:, aligns segment N to doc_files[N-1], and de-duplicates by title (keeping the longest occurrence).

Rebuilding the data

bash
python scripts/build_data.py --set 128k \
    --input /mnt/ramdisk/blobstore/timchen0618/data/corpusqa/128k_4domains.jsonl
python scripts/build_data.py --set 1m \
    --input /mnt/ramdisk/blobstore/timchen0618/data/corpusqa/1m_4domains.jsonl

Each run rewrites corpus_<set>.json + corpus_<set>/ + eval_<set>.json and upserts the set into sets.json. To add the 4M/10M sets later, download the raw JSONL and run the same command with --set 4m / --set 10m.

Local dev

bash
python -m http.server 8000   # then open http://localhost:8000/

Serves statically — no build step. Push to the HF Space remote to deploy.

Dataset license: MIT. See the CorpusQA repo for the paper.