Dataset Viewer
Auto-converted to Parquet Duplicate
chunk_id
string
question_id
string
language
string
chunk_index
int64
dense_vector
list
sparse_indices
list
sparse_values
list
4588536_c0
4588536
sql
0
[ 0.015869140625, -0.01300048828125, 0.0264892578125, -0.0106201171875, 0.0157470703125, 0.0033111572265625, 0.031982421875, -0.01019287109375, 0.0194091796875, 0.00994873046875, -0.00811767578125, -0.003265380859375, -0.0019683837890625, 0.00115966796875, 0.020751953125, 0.02392578125, ...
[ 48962, 12, 80866, 21115, 390, 3447, 12298, 91, 99247, 15649 ]
[ 0.1015625, 0.036285400390625, 0.27734375, 0.259033203125, 0.176025390625, 0.2314453125, 0.1478271484375, 0.0552978515625, 0.224365234375, 0.202880859375 ]
50954743_c0
50954743
sql
0
[ 0.008056640625, -0.0230712890625, -0.0034637451171875, -0.02099609375, 0.03515625, 0.00970458984375, 0.0010833740234375, 0.0123291015625, 0.0125732421875, 0.008056640625, -0.0299072265625, 0.0029296875, 0.016845703125, -0.0205078125, -0.00445556640625, -0.0213623046875, 0.02355957031...
[ 48962, 12, 21672, 87377, 71, 25512, 12298, 91, 99247, 15649 ]
[ 0.144287109375, 0.048431396484375, 0.202392578125, 0.24462890625, 0.13330078125, 0.217529296875, 0.1636962890625, 0.02838134765625, 0.2308349609375, 0.2083740234375 ]
2048210_c0
2048210
sql
0
[0.044677734375,-0.007537841796875,0.00634765625,0.008544921875,0.040283203125,-0.004852294921875,-0(...TRUNCATED)
[ 48962, 12, 154109, 171763, 1636, 12298, 91, 99247, 4, 3958, 15649 ]
[0.1343994140625,0.0701904296875,0.282958984375,0.322265625,0.224609375,0.1456298828125,0.0143814086(...TRUNCATED)
4565581_c0
4565581
sql
0
[0.023681640625,-0.005584716796875,0.003143310546875,-0.022705078125,0.00836181640625,0.004058837890(...TRUNCATED)
[ 48962, 12, 28723, 47691, 23, 91, 99247, 12298, 15649 ]
[0.12158203125,0.0550537109375,0.2347412109375,0.2313232421875,0.1353759765625,0.0885009765625,0.280(...TRUNCATED)
11386083_c0
11386083
sql
0
[0.0225830078125,-0.022705078125,0.013671875,-0.0205078125,0.034423828125,0.004302978515625,-0.00695(...TRUNCATED)
[ 48962, 12, 225073, 91, 99247, 18499, 12298, 759, 7, 4, 15649 ]
[0.122802734375,0.0401611328125,0.28466796875,0.0888671875,0.265380859375,0.227294921875,0.132690429(...TRUNCATED)
15211479_c0
15211479
sql
0
[0.0257568359375,-0.0194091796875,0.01318359375,-0.007171630859375,0.01312255859375,0.00607299804687(...TRUNCATED)
[ 48962, 10760, 90825, 38132, 12298, 759, 7, 99247, 91, 15649 ]
[0.06707763671875,0.2310791015625,0.278076171875,0.2509765625,0.1168212890625,0.1328125,0.0359802246(...TRUNCATED)
17312978_c0
17312978
sql
0
[0.0279541015625,-0.0283203125,0.0177001953125,-0.0225830078125,0.0250244140625,0.0155029296875,0.01(...TRUNCATED)
[ 48962, 12, 80866, 58836, 53, 131176, 12298, 759, 7, 99247, 4, 91, 15649 ]
[0.15380859375,0.09368896484375,0.284423828125,0.232666015625,0.1448974609375,0.2900390625,0.1735839(...TRUNCATED)
39351656_c0
39351656
sql
0
[0.005126953125,-0.03125,0.0167236328125,-0.0167236328125,0.037109375,-0.021728515625,0.00439453125,(...TRUNCATED)
[ 48962, 12, 80866, 20, 6002, 86531, 18499, 12298, 3958, 4, 91, 99247, 15649 ]
[0.150390625,0.04901123046875,0.316650390625,0.07177734375,0.1904296875,0.269287109375,0.24340820312(...TRUNCATED)
2963657_c0
2963657
sql
0
[0.028564453125,-0.0167236328125,0.01239013671875,-0.042236328125,0.0255126953125,0.00634765625,0.02(...TRUNCATED)
[ 48962, 12, 157146, 5881, 52952, 21253, 8852, 12298, 759, 7, 99247, 4, 91, 15649 ]
[0.1484375,0.117919921875,0.3330078125,0.187255859375,0.26708984375,0.277099609375,0.25244140625,0.1(...TRUNCATED)
55878945_c0
55878945
sql
0
[0.01483154296875,-0.003204345703125,-0.002227783203125,-0.046630859375,0.015625,-0.006561279296875,(...TRUNCATED)
[ 48962, 12, 63399, 5426, 12298, 91, 99247, 4, 3620, 11030, 1662, 177, 15649 ]
[0.145263671875,0.1055908203125,0.228515625,0.25244140625,0.1524658203125,0.036895751953125,0.233886(...TRUNCATED)
End of preview. Expand in Data Studio

SQL StackOverflow Vector Dataset

Summary

This repository contains the SQL shard of the Stack2Graph vector retrieval dataset. Each Hugging Face dataset repository contains one programming-language shard and is intended to restore or rebuild the Qdrant collection stackoverflow_sql_vector.

The dataset is the vector counterpart to the Stack2Graph RDF knowledge graph. It is designed for hybrid retrieval, graph entry-point finding, and retrieval-augmented generation experiments over Stack Overflow content.

Stack2Graph source: https://github.com/tha-atlas/Stack2Graph

Repository Layout

README.md
dataset_manifest.json
qdrant_snapshots/
  collections_manifest.json
  stackoverflow_sql_vector.tar.zst
  stackoverflow_sql_vector.snapshot.zst.part_000
  ...
question_metadata/
  r0_00000.parquet
chunk_records/
  r0_00000.parquet
question_records/
  r0_00000.parquet
  • dataset_manifest.json: language-scoped manifest listing the files in this shard.
  • qdrant_snapshots/collections_manifest.json: language-scoped Qdrant snapshot manifest.
  • qdrant_snapshots/stackoverflow_sql_vector.*: optional Qdrant restore artifact files for stackoverflow_sql_vector.
  • question_metadata/*.parquet: question-level metadata used by parent-child chunk retrieval.
  • chunk_records/*.parquet: chunk-level vector rows when parent-child indexing is enabled.
  • question_records/*.parquet: question-level vector rows when non-chunked export is used.

The Hugging Face upload is one repository per language. During upload, the local leading language directory is removed, so local files such as sql/chunk_records/r0_00000.parquet appear in this repository as chunk_records/r0_00000.parquet.

Data Model

Rows are derived from Stack Overflow questions tagged for SQL.

The current Stack2Graph vector pipeline uses:

  • dense vectors from Qwen/Qwen3-Embedding-8B
  • 4096-dimensional dense embeddings with last-token pooling
  • instruction-aware query embedding for retrieval
  • sparse lexical vectors from BAAI/bge-m3
  • unified question text containing title, tags, cleaned problem text, and code
  • optional parent-child indexing where chunk hits collapse back to parent question IDs

When Qdrant snapshots are included, they are the fastest restore path. The Parquet files remain the portable fallback for rebuilding the collection.

Coverage

This repository contains only the SQL shard. A Stack Overflow question can appear in more than one language shard when it has multiple programming-language tags.

The dataset is not a complete Stack Overflow mirror. Full question and answer graph context lives in the corresponding Stack2Graph knowledge graph artifacts; the vector dataset stores retrieval rows, vectors, sparse weights, and routing metadata.

Recommended Use

Use this dataset for:

  • semantic and hybrid retrieval
  • Qdrant restore or ingestion tests
  • Stack2Graph RAG experiments
  • graph entry-point retrieval before QLever graph expansion
  • vector database benchmarking and diagnostics

This dataset is not intended as a standalone supervised training dataset.

Restore With Stack2Graph

You do not need to regenerate embeddings to use this dataset.

Typical workflow:

  1. Clone Stack2Graph and configure .env with service paths and HF token.
  2. Start local services:
docker compose up -d
  1. Download and restore vector artifacts:
python -m experiment.sources.hf --skip-kg

The loader restores Qdrant snapshots when present and falls back to Parquet ingestion when snapshots are unavailable.

Manual Use

For manual use, inspect dataset_manifest.json, then either:

  • restore the Qdrant snapshot artifacts under qdrant_snapshots/, or
  • ingest the listed Parquet shards into a compatible vector database.

The target Qdrant collection name is:

stackoverflow_sql_vector

Quality Notes

  • Embedding quality depends on the configured Stack2Graph export pipeline and model versions.
  • Sparse text can be generated from the same unified text as dense embeddings or from a lexical variant, depending on export configuration.
  • Community-generated Stack Overflow content may contain errors, outdated information, bias, or incomplete answers.
  • Rebuilding from Parquet may produce operational differences if Qdrant collection settings differ from the original export.

License And Attribution

This dataset is derived from Stack Overflow content and is distributed under CC-BY-SA-4.0. Preserve required attribution and license notices when redistributing derived artifacts.

Citation

If you use this dataset, cite the Stack2Graph project and preserve Stack Overflow attribution requirements:

  • Stack2Graph: A Structured Knowledge Representation of Stack Overflow Data for Retrieval-based Question Answering
Downloads last month
519