File size: 5,073 Bytes
1cd567a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
tags:
  - vector-database
  - embeddings
  - parquet
  - qdrant
  - stackoverflow
  - question-answering
pretty_name: StackOverflow Vector Dataset - Java
license: cc-by-sa-4.0
size_categories:
  - 1M<n<10M
---

# Java StackOverflow Vector Dataset

## Summary

This repository contains the Java 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_java_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](https://github.com/tha-atlas/Stack2Graph)

## Repository Layout

```text
README.md
dataset_manifest.json
qdrant_snapshots/
  collections_manifest.json
  stackoverflow_java_vector.tar.zst
  stackoverflow_java_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_java_vector.*`: optional Qdrant restore artifact files for `stackoverflow_java_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 `java/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 Java.

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 Java 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:

```bash
docker compose up -d
```

3. Download and restore vector artifacts:

```bash
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:

```text
stackoverflow_java_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