Dataset Viewer
Auto-converted to Parquet Duplicate
query-id
stringlengths
2
6
corpus-id
stringlengths
2
6
score
int64
1
1
q5
c5
1
q117
c117
1
q118
c118
1
q119
c119
1
q120
c120
1
q212
c212
1
q459
c459
1
q493
c493
1
q494
c494
1
q495
c495
1
q496
c496
1
q497
c497
1
q498
c498
1
q499
c499
1
q500
c500
1
q501
c501
1
q502
c502
1
q503
c503
1
q504
c504
1
q505
c505
1
q506
c506
1
q507
c507
1
q508
c508
1
q509
c509
1
q510
c510
1
q511
c511
1
q512
c512
1
q513
c513
1
q514
c514
1
q515
c515
1
q516
c516
1
q517
c517
1
q518
c518
1
q519
c519
1
q520
c520
1
q521
c521
1
q522
c522
1
q523
c523
1
q524
c524
1
q525
c525
1
q526
c526
1
q527
c527
1
q528
c528
1
q529
c529
1
q530
c530
1
q531
c531
1
q532
c532
1
q533
c533
1
q534
c534
1
q535
c535
1
q536
c536
1
q537
c537
1
q538
c538
1
q539
c539
1
q540
c540
1
q541
c541
1
q542
c542
1
q543
c543
1
q544
c544
1
q545
c545
1
q546
c546
1
q547
c547
1
q548
c548
1
q549
c549
1
q550
c550
1
q551
c551
1
q552
c552
1
q553
c553
1
q554
c554
1
q555
c555
1
q556
c556
1
q557
c557
1
q558
c558
1
q559
c559
1
q560
c560
1
q561
c561
1
q562
c562
1
q563
c563
1
q564
c564
1
q565
c565
1
q566
c566
1
q567
c567
1
q568
c568
1
q569
c569
1
q570
c570
1
q571
c571
1
q572
c572
1
q573
c573
1
q574
c574
1
q575
c575
1
q576
c576
1
q577
c577
1
q578
c578
1
q579
c579
1
q580
c580
1
q581
c581
1
q582
c582
1
q583
c583
1
q584
c584
1
q585
c585
1
End of preview. Expand in Data Studio

NASA Code Retrieval Benchmark v0.1.1

This repository is an updated version of the NASA Code Retrieval Benchmark. It provides a code retrieval benchmark based on code from 7 programming languages sourced from NASA's GitHub repositories.

What's New in v0.1.1?

v0.1.1 introduces a hierarchical structure and official Hugging Face dataset configurations. This allows you to evaluate models specifically by language or by query category without data redundancy in the file system.

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


Dataset Structure

The ground-truth relationships (qrels) are organized into two primary configurations:

nasa-science-code-benchmark-v0.1.1/
β”œβ”€β”€ corpus.jsonl
β”œβ”€β”€ queries.jsonl
└── qrels/
    β”œβ”€β”€ division/                 # Evaluation by NASA Science Division
    β”‚   β”œβ”€β”€ astrophysics_division.tsv
    β”‚   β”œβ”€β”€ biological_and_physical_sciences_division.tsv
    β”‚   β”œβ”€β”€ earth_science_division.tsv
    β”‚   β”œβ”€β”€ heliophysics_division.tsv
    β”‚   β”œβ”€β”€ planetary_science_division.tsv
    β”‚   └── not_a_nasa_division.tsv
    β”œβ”€β”€ programming_language/     # Evaluation by language
    β”‚   β”œβ”€β”€ c++.tsv
    β”‚   β”œβ”€β”€ c.tsv
    β”‚   β”œβ”€β”€ fortran.tsv
    β”‚   β”œβ”€β”€ java.tsv
    β”‚   β”œβ”€β”€ javascript.tsv
    β”‚   β”œβ”€β”€ matlab.tsv
    β”‚   └── python.tsv
    └── query_type/               # Evaluation by query intent
        β”œβ”€β”€ nasa_science_class_code_docstring_heldout.tsv
        β”œβ”€β”€ nasa_science_class_code_identifier_heldout.tsv
        β”œβ”€β”€ nasa_science_function_code_docstring_heldout.tsv
        └── nasa_science_function_code_identifier_heldout.tsv

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/: Tab-Separated Values (TSV) files mapping queries to relevant code snippets. Format: query-id corpus-id score.

How to Use

1. Load by Programming Language

Use this to evaluate model performance on specific languages.

from datasets import load_dataset

ds = load_dataset(
    "nasa-impact/nasa-science-code-benchmark-v0.1.1", 
    name="programming_language"
)

2. Load by Query Type

Use this to evaluate performance based on the nature of the query (e.g., nasa_science_class_code_docstring_heldout, nasa_science_class_code_identifier_heldout).

from datasets import load_dataset

ds = load_dataset(
    "nasa-impact/nasa-science-code-benchmark-v0.1.1", 
    name="query_type"
)

3. Load by Division

Use this to evaluate performance based on the nasa division (e.g., astrophysics_division, biological_and_physical_sciences_division).

from datasets import load_dataset

ds = load_dataset(
    "nasa-impact/nasa-science-code-benchmark-v0.1.1", 
    name="division"
)

Evaluation Categories

Programming Languages

File Language
python.tsv Python
c.tsv C
c++.tsv C++
java.tsv Java
javascript.tsv JavaScript
fortran.tsv Fortran
matlab.tsv Matlab

Query Types

File Description
nasa_science_function_code_docstring_heldout.tsv Query is a function's documentation/comment.
nasa_science_function_code_identifier_heldout.tsv Query is the specific function name.
nasa_science_class_code_docstring_heldout.tsv Query is a class's documentation/comment.
nasa_science_class_code_identifier_heldout.tsv Query is the specific class name.
Downloads last month
125