Skip to content
Branch: master
Find file Copy path
Find file Copy path
4 contributors

Users who have contributed to this file

@shawnlewis @staceysv @raubitsj @hamelsmu
74 lines (45 sloc) 6.5 KB

Submitting runs to the benchmark

The Weights & Biases (W&B) benchmark tracks and compares models trained on the CodeSearchNet dataset by the global machine learning research community. Anyone is welcome to submit their results for review.

Submission process


There are a few requirements for submitting a model to the benchmark.

  • You must a have a run logged to W&B.
  • Your run must have attached inference results in a file named model_predictions.csv. You can view all the files attached to a given run in the browser by clicking the "Files" icon from that run's main page.
  • The schema outlined in the submission format section below must be strictly followed.

Submission format

To submit from our baseline model, skip to the training the baseline model section below.

A valid submission to the CodeSeachNet Challenge requires a file named model_predictions.csv with the following fields: query, language, identifier, and url:

For further background and instructions on the submission process, see the root README.

The row order corresponds to the result ranking in the search task. For example, if in row 5 there is an entry for the Python query "read properties file", and in row 60 another result for the Python query "read properties file", then the URL in row 5 is considered to be ranked higher than the URL in row 60 for that query and language.

Here is an example:

query language identifier url
convert int to string python int_to_decimal_str
convert int to string python str_to_int_array
convert int to string python Bcp47LanguageParser.IntStr26ToInt
convert int to string python PrimaryEqualProof.to_str_dict
convert int to string python to_int
how to read .csv file in an efficient way? ruby Icosmith.Font.generate_scss
how to read .csv file in an efficient way? ruby WebSocket.Extensions.valid_frame_rsv
how to read .csv file in an efficient way? ruby APNS.Pem.read_file_at_path

Submitting model predictions to W&B

You can submit your results to the benchmark as follows:

  1. Run a training job with any script (your own or the baseline example provided, with or without W&B logging).
  2. Generate your own file of model predictions following the format above and name it `model_predictions.csv`.
  3. Upload a run to wandb with this `model_predictions.csv` file attached.

Our example script src/ takes care of steps 2 and 3 for a model training run that has already been logged to W&B, given the corresponding W&B run id, which you can find on the /overview page in the browser or by clicking the 'info' icon on a given run.

Publishing your submission

You've now generated all the content required to submit a run to the CodeSearchNet benchmark. Using the W&B GitHub integration you can now submit your model for review via the web app.

You can submit your runs by visiting the run page and clicking on the overview tab:

or by visiting the project page and selecting a run from the runs table:

Result evaluation

Once you upload your `model_predictions.csv` file, W&B will compute the normalized discounted cumulative gain (NDCG) of your model's predictions against the human-annotated relevance scores. Further details on the evaluation process and metrics are in the root README. For transparency, we include the script used to evaluate submissions: src/

Training the baseline model (optional)

Replicating our results for the CodeSearchNet baseline is optional, as we encourage the community to create their own models and methods for ranking search results. To replicate our baseline submission, you can start with the "Quickstart" instructions in the CodeSearchNet GitHub repository. This baseline model uses src/ to generate the submission file.

Your run will be logged to W&B, within a project that will be automatically linked to this benchmark.

You can’t perform that action at this time.