CoolFace
Datasetpublic

AmanPriyanshu/RLVR-Env-Retrieval-Source-code-search-net-python

RLVR-Env-Retrieval-Source-code-search-net-python RLVR-ready retrieval environment derived from Nan-Do/code-search-net-python. Author: Aman Priyanshu What Is This A 100k-row retrieval QA dataset where each row contains a question, ground-truth chunks, and pre-mined distractor chunks (random + semantically similar). Designed for training and evaluating retrieval agents in an RLVR (Reinforcement Learning with Verifiable Rewards) setup — the agent searches through… See the full description on the dataset page: https://huggingface.co/datasets/AmanPriyanshu/RLVR-Env-Retrieval-Source-code-search-net-python.

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes27downloads
Dataset Card

RLVR-Env-Retrieval-Source-code-search-net-python

RLVR-ready retrieval environment derived from Nan-Do/code-search-net-python.

Author: Aman Priyanshu

What Is This

A 100k-row retrieval QA dataset where each row contains a question, ground-truth chunks, and pre-mined distractor chunks (random + semantically similar). Designed for training and evaluating retrieval agents in an RLVR (Reinforcement Learning with Verifiable Rewards) setup — the agent searches through distractors to find the correct chunk(s).

Domain: Python open-source functions from GitHub (CodeSearchNet)

Source

Derived from Nan-Do/code-search-net-python (455,243 unique functions). Original license: Apache 2.0 — retained here.

Schema

qa.parquet (100,000 rows)

ColumnTypeDescription
qa_idstringUnique ID (search_py_0, search_py_1, ...)
questionstringThe retrieval query
gt_chunksJSON stringList of ground-truth chunk texts. 1 target code chunk per question (the function matching the summary)
random_chunksJSON stringList of random distractor texts. ~500 random code chunks (>=20 chars, deduplicated against gt and similar)
similar_chunksJSON stringList of hard-negative distractor texts. ~178 similar chunks via MiniLM cosine (<0.97) + char trigram edit-distance (<0.97 seq ratio), deduplicated

metadata.parquet (100,000 rows)

ColumnTypeDescription
qa_idstringMatches qa.parquet
......chunkidx, funcname, repo, char_count

chunks.parquet

455,243 code chunks with MiniLM embeddings. Kept for reference — not needed at inference time.

Deduplication

Within each row: gt > similar > random priority. No chunk text appears in more than one column per row. Similar chunks are internally deduplicated. Random chunks are filtered against both gt and similar.

How To Use

python
import json
import pyarrow.parquet as pq

t = pq.read_table("qa.parquet")
row = {col: t.column(col)[0].as_py() for col in t.column_names}
gt = json.loads(row["gt_chunks"])
distractors = json.loads(row["random_chunks"]) + json.loads(row["similar_chunks"])

License

Apache 2.0 (inherited from source dataset).