query-id stringlengths 2 7 | corpus-id stringlengths 2 7 | score int64 1 1 |
|---|---|---|
q9081 | c9067 | 1 |
q9082 | c9068 | 1 |
q9083 | c9069 | 1 |
q9084 | c9070 | 1 |
q9085 | c9071 | 1 |
q9086 | c9072 | 1 |
q9087 | c9073 | 1 |
q9088 | c9074 | 1 |
q9089 | c9075 | 1 |
q9090 | c9076 | 1 |
q9091 | c9077 | 1 |
q9092 | c9078 | 1 |
q9093 | c9079 | 1 |
q9094 | c9080 | 1 |
q9095 | c9081 | 1 |
q9096 | c9082 | 1 |
q9097 | c9083 | 1 |
q9098 | c9084 | 1 |
q9099 | c9085 | 1 |
q9100 | c9086 | 1 |
q9101 | c9087 | 1 |
q9102 | c9088 | 1 |
q9103 | c9089 | 1 |
q9104 | c9090 | 1 |
q9105 | c9091 | 1 |
q9106 | c9092 | 1 |
q9107 | c9093 | 1 |
q9108 | c9094 | 1 |
q9109 | c9095 | 1 |
q9110 | c9096 | 1 |
q9111 | c9097 | 1 |
q9112 | c9098 | 1 |
q9113 | c9099 | 1 |
q9114 | c9100 | 1 |
q9115 | c9101 | 1 |
q9116 | c9102 | 1 |
q9117 | c9103 | 1 |
q9118 | c9104 | 1 |
q9119 | c9105 | 1 |
q9120 | c9106 | 1 |
q9121 | c9107 | 1 |
q9122 | c9108 | 1 |
q9123 | c9109 | 1 |
q9124 | c9110 | 1 |
q9125 | c9111 | 1 |
q9126 | c9112 | 1 |
q9127 | c9113 | 1 |
q9128 | c9114 | 1 |
q9129 | c9115 | 1 |
q9130 | c9116 | 1 |
q9131 | c9117 | 1 |
q9132 | c9118 | 1 |
q9133 | c9119 | 1 |
q9134 | c9120 | 1 |
q9135 | c9121 | 1 |
q9136 | c9122 | 1 |
q9137 | c9123 | 1 |
q9138 | c9124 | 1 |
q9139 | c9125 | 1 |
q9140 | c9126 | 1 |
q9141 | c9127 | 1 |
q9142 | c9128 | 1 |
q9143 | c9129 | 1 |
q9144 | c9130 | 1 |
q9145 | c9131 | 1 |
q9146 | c9132 | 1 |
q9147 | c9133 | 1 |
q9148 | c9134 | 1 |
q9149 | c9135 | 1 |
q9150 | c9136 | 1 |
q9151 | c9137 | 1 |
q9152 | c9138 | 1 |
q9153 | c9139 | 1 |
q9154 | c9140 | 1 |
q9155 | c9141 | 1 |
q9156 | c9142 | 1 |
q9157 | c9143 | 1 |
q9158 | c9144 | 1 |
q9159 | c9145 | 1 |
q9160 | c9146 | 1 |
q9161 | c9147 | 1 |
q9162 | c9148 | 1 |
q9163 | c9149 | 1 |
q9164 | c9150 | 1 |
q9165 | c9151 | 1 |
q9166 | c9152 | 1 |
q9167 | c9153 | 1 |
q9168 | c9154 | 1 |
q9169 | c9155 | 1 |
q9170 | c9156 | 1 |
q9171 | c9157 | 1 |
q9172 | c9158 | 1 |
q9173 | c9159 | 1 |
q9174 | c9160 | 1 |
q9175 | c9161 | 1 |
q9176 | c9162 | 1 |
q9177 | c9163 | 1 |
q9178 | c9164 | 1 |
q9179 | c9165 | 1 |
q9180 | c9166 | 1 |
NASA Code Retrieval Benchmark v0.1
Note: This dataset has been superseded by nasa-impact/nasa-science-code-benchmark-v0.1.1, which introduces a hierarchical structure, official Hugging Face dataset configurations, and evaluation by NASA science division. Please use v0.1.1 for new work.
This dataset provides a code retrieval benchmark based on code from 7 programming languages (Python, C, C++, Java, JavaScript, Fortran, and Matlab) sourced from NASA's GitHub repositories. It serves as the held-out test set for evaluating information retrieval models trained on NASA science code. The primary task is to retrieve a relevant code snippet (from the corpus) given a natural language query, which can be a docstring or a code identifier (e.g., function or class name).
Licensing and Intellectual Property
This dataset is released under CC-BY-4.0 and contains only structured metadata and annotations produced by the dataset authors. It does not redistribute original source code from the indexed repositories.
The corpus.jsonl file contains placeholders for original code content rather than the source code itself. This is by design to respect the intellectual property and licensing terms of individual repository owners.
Users who wish to populate the corpus for research purposes may do so by fetching content directly from the source repositories using the replication scripts provided in the companion repository:
👉 NASA-IMPACT/github-code-discovery — see scripts/code_snippet/
Please ensure you comply with the licensing terms of each individual repository when using the fetched content.
Related Resources
- Retrieval benchmark system: NASA-IMPACT/nasa-science-repo-benchmark
- Data collection & replication scripts: NASA-IMPACT/github-code-discovery
- Latest version: nasa-impact/nasa-science-code-benchmark-v0.1.1
Source Data & Training
This benchmark is the official test set corresponding to the following training and validation datasets.
- nasa-impact/nasa-science-function-code-docstring
- nasa-impact/nasa-science-class-code-docstring
- nasa-impact/nasa-science-function-code-identifier
- nasa-impact/nasa-science-class-code-identifier
Dataset Statistics
- Total unique corpus entries: 117,950
- Total unique query entries: 119,720
Dataset Structure
The dataset follows a standard Information Retrieval format with three main components: a corpus, a set of queries, and query-relevance judgments (qrels).
Data Fields
corpus.jsonl: A collection of all unique code snippets (functions and classes) from all languages._id: A unique string identifier for the code snippet.text: ⚠️ Placeholder — use replication scripts to populate with original source code.
queries.jsonl: A collection of all unique queries (docstrings and identifiers)._id: A unique string identifier for the query.text: The natural language query.
qrels/: A directory containing Tab-Separated Values (TSV) files that map queries to their relevant code snippets. This is the ground truth for evaluation. Each file has the formatquery-id corpus-id score.
Qrels (Query-Relevance Pairs)
The dataset provides several qrels files to evaluate performance across different programming languages and query types.
By Programming Language
| Qrels File | Description | Size |
|---|---|---|
python.tsv |
All query-corpus pairs for the Python dataset. | 64,110 |
c.tsv |
All query-corpus pairs for the C dataset. | 17,149 |
c++.tsv |
All query-corpus pairs for the C++ dataset. | 14,975 |
java.tsv |
All query-corpus pairs for the Java dataset. | 14,088 |
javascript.tsv |
All query-corpus pairs for the JavaScript dataset. | 5,159 |
fortran.tsv |
All query-corpus pairs for the Fortran dataset. | 3,586 |
matlab.tsv |
All query-corpus pairs for the Matlab dataset. | 653 |
By Query Type
| Qrels File | Description | Size |
|---|---|---|
nasa_science_function_code_docstring_heldout.tsv |
Pairs where the query is a function docstring. | 61,083 |
nasa_science_function_code_identifier_heldout.tsv |
Pairs where the query is a function name (identifier). | 32,742 |
nasa_science_class_code_docstring_heldout.tsv |
Pairs where the query is a class docstring. | 13,355 |
nasa_science_class_code_identifier_heldout.tsv |
Pairs where the query is a class name (identifier). | 12,540 |
- Downloads last month
- 87