capreolus.benchmark.codesearchnet

Module Contents

Classes

CodeSearchNetCorpus

CodeSearchNet Corpus. [1]

CodeSearchNetChallenge

CodeSearchNet Challenge. [1]

Attributes

logger

PACKAGE_PATH

capreolus.benchmark.codesearchnet.logger[source]
capreolus.benchmark.codesearchnet.PACKAGE_PATH[source]
class capreolus.benchmark.codesearchnet.CodeSearchNetCorpus(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.benchmark.Benchmark

CodeSearchNet Corpus. [1]

[1] Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Miltiadis Allamanis, and Marc Brockschmidt. 2019. CodeSearchNet Challenge: Evaluating the State of Semantic Code Search. arXiv 2019.

module_name = codesearchnet_corpus[source]
dependencies[source]
url = https://s3.amazonaws.com/code-search-net/CodeSearchNet/v2[source]
query_type = title[source]
file_fn[source]
qrel_dir[source]
topic_dir[source]
fold_dir[source]
qidmap_dir[source]
docidmap_dir[source]
config_spec[source]
build(self)[source]
property qid_map(self)[source]
property docid_map(self)[source]
download_if_missing(self)[source]
get_docid(self, url, code_tokens)[source]

retrieve the doc id according to the doc dict

class capreolus.benchmark.codesearchnet.CodeSearchNetChallenge(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.benchmark.Benchmark

CodeSearchNet Challenge. [1] This benchmark can only be used for training (and challenge submissions) because no qrels are provided.

[1] Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Miltiadis Allamanis, and Marc Brockschmidt. 2019. CodeSearchNet Challenge: Evaluating the State of Semantic Code Search. arXiv 2019.

module_name = codesearchnet_challenge[source]
dependencies[source]
config_spec[source]
url = https://raw.githubusercontent.com/github/CodeSearchNet/master/resources/queries.csv[source]
query_type = title[source]
file_fn[source]
topic_file[source]
qid_map_file[source]
download_if_missing(self)[source]

download query.csv and prepare queryid - query mapping file