--- annotations_creators: - derived language: - code license: mit multilinguality: monolingual source_datasets: - code-search-net/code_search_net task_categories: - text-retrieval task_ids: [] dataset_info: - config_name: go-corpus features: - name: id dtype: string - name: text dtype: string - name: title dtype: string splits: - name: test num_bytes: 687923 num_examples: 1000 download_size: 305126 dataset_size: 687923 - config_name: go-qrels features: - name: query-id dtype: string - name: corpus-id dtype: string - name: score dtype: int64 splits: - name: test num_bytes: 131084 num_examples: 1000 download_size: 30642 dataset_size: 131084 - config_name: go-queries features: - name: id dtype: string - name: text dtype: string splits: - name: test num_bytes: 136105 num_examples: 1000 download_size: 82017 dataset_size: 136105 - config_name: java-corpus features: - name: id dtype: string - name: text dtype: string - name: title dtype: string splits: - name: test num_bytes: 591398 num_examples: 1000 download_size: 186606 dataset_size: 591398 - config_name: java-qrels features: - name: query-id dtype: string - name: corpus-id dtype: string - name: score dtype: int64 splits: - name: test num_bytes: 176341 num_examples: 1000 download_size: 34953 dataset_size: 176341 - config_name: java-queries features: - name: id dtype: string - name: text dtype: string splits: - name: test num_bytes: 701958 num_examples: 1000 download_size: 255486 dataset_size: 701958 - config_name: javascript-corpus features: - name: id dtype: string - name: text dtype: string - name: title dtype: string splits: - name: test num_bytes: 1551805 num_examples: 1000 download_size: 571030 dataset_size: 1551805 - config_name: javascript-qrels features: - name: query-id dtype: string - name: corpus-id dtype: string - name: score dtype: int64 splits: - name: test num_bytes: 141801 num_examples: 1000 download_size: 39930 dataset_size: 141801 - config_name: javascript-queries features: - name: id dtype: string - name: text dtype: string splits: - name: test num_bytes: 202696 num_examples: 1000 download_size: 112208 dataset_size: 202696 - config_name: php-corpus features: - name: id dtype: string - name: text dtype: string - name: title dtype: string splits: - name: test num_bytes: 856887 num_examples: 1000 download_size: 333818 dataset_size: 856887 - config_name: php-qrels features: - name: query-id dtype: string - name: corpus-id dtype: string - name: score dtype: int64 splits: - name: test num_bytes: 151365 num_examples: 1000 download_size: 33419 dataset_size: 151365 - config_name: php-queries features: - name: id dtype: string - name: text dtype: string splits: - name: test num_bytes: 173189 num_examples: 1000 download_size: 88243 dataset_size: 173189 - config_name: python-corpus features: - name: id dtype: string - name: text dtype: string - name: title dtype: string splits: - name: test num_bytes: 1008096 num_examples: 1000 download_size: 397446 dataset_size: 1008096 - config_name: python-qrels features: - name: query-id dtype: string - name: corpus-id dtype: string - name: score dtype: int64 splits: - name: test num_bytes: 152118 num_examples: 1000 download_size: 32945 dataset_size: 152118 - config_name: python-queries features: - name: id dtype: string - name: text dtype: string splits: - name: test num_bytes: 477722 num_examples: 1000 download_size: 232579 dataset_size: 477722 - config_name: ruby-corpus features: - name: id dtype: string - name: text dtype: string - name: title dtype: string splits: - name: test num_bytes: 713048 num_examples: 1000 download_size: 300121 dataset_size: 713048 - config_name: ruby-qrels features: - name: query-id dtype: string - name: corpus-id dtype: string - name: score dtype: int64 splits: - name: test num_bytes: 142286 num_examples: 1000 download_size: 43267 dataset_size: 142286 - config_name: ruby-queries features: - name: id dtype: string - name: text dtype: string splits: - name: test num_bytes: 324866 num_examples: 1000 download_size: 169887 dataset_size: 324866 configs: - config_name: go-corpus data_files: - split: test path: go-corpus/test-* - config_name: go-qrels data_files: - split: test path: go-qrels/test-* - config_name: go-queries data_files: - split: test path: go-queries/test-* - config_name: java-corpus data_files: - split: test path: java-corpus/test-* - config_name: java-qrels data_files: - split: test path: java-qrels/test-* - config_name: java-queries data_files: - split: test path: java-queries/test-* - config_name: javascript-corpus data_files: - split: test path: javascript-corpus/test-* - config_name: javascript-qrels data_files: - split: test path: javascript-qrels/test-* - config_name: javascript-queries data_files: - split: test path: javascript-queries/test-* - config_name: php-corpus data_files: - split: test path: php-corpus/test-* - config_name: php-qrels data_files: - split: test path: php-qrels/test-* - config_name: php-queries data_files: - split: test path: php-queries/test-* - config_name: python-corpus data_files: - split: test path: python-corpus/test-* - config_name: python-qrels data_files: - split: test path: python-qrels/test-* - config_name: python-queries data_files: - split: test path: python-queries/test-* - config_name: ruby-corpus data_files: - split: test path: ruby-corpus/test-* - config_name: ruby-qrels data_files: - split: test path: ruby-qrels/test-* - config_name: ruby-queries data_files: - split: test path: ruby-queries/test-* tags: - mteb - text ---
The dataset is a collection of code snippets and their corresponding natural language queries. The task is to retrieve the most relevant code snippet for a given query. | | | |---------------|---------------------------------------------| | Task category | t2t | | Domains | Programming, Written | | Reference | https://huggingface.co/datasets/code_search_net/ | Source datasets: - [code-search-net/code_search_net](https://huggingface.co/datasets/code-search-net/code_search_net) ## How to evaluate on this task You can evaluate an embedding model on this dataset using the following code: ```python import mteb task = mteb.get_task("CodeSearchNetRetrieval") evaluator = mteb.MTEB([task]) model = mteb.get_model(YOUR_MODEL) evaluator.run(model) ``` To learn more about how to run models on `mteb` task check out the [GitHub repository](https://github.com/embeddings-benchmark/mteb). ## Citation If you use this dataset, please cite the dataset as well as [mteb](https://github.com/embeddings-benchmark/mteb), as this dataset likely includes additional processing as a part of the [MMTEB Contribution](https://github.com/embeddings-benchmark/mteb/tree/main/docs/mmteb). ```bibtex @article{husain2019codesearchnet, author = {Husain, Hamel and Wu, Ho-Hsiang and Gazit, Tiferet and Allamanis, Miltiadis and Brockschmidt, Marc}, journal = {arXiv preprint arXiv:1909.09436}, title = {{CodeSearchNet} challenge: Evaluating the state of semantic code search}, year = {2019}, } @article{enevoldsen2025mmtebmassivemultilingualtext, title={MMTEB: Massive Multilingual Text Embedding Benchmark}, author={Kenneth Enevoldsen and Isaac Chung and Imene Kerboua and Márton Kardos and Ashwin Mathur and David Stap and Jay Gala and Wissam Siblini and Dominik Krzemiński and Genta Indra Winata and Saba Sturua and Saiteja Utpala and Mathieu Ciancone and Marion Schaeffer and Gabriel Sequeira and Diganta Misra and Shreeya Dhakal and Jonathan Rystrøm and Roman Solomatin and Ömer Çağatan and Akash Kundu and Martin Bernstorff and Shitao Xiao and Akshita Sukhlecha and Bhavish Pahwa and Rafał Poświata and Kranthi Kiran GV and Shawon Ashraf and Daniel Auras and Björn Plüster and Jan Philipp Harries and Loïc Magne and Isabelle Mohr and Mariya Hendriksen and Dawei Zhu and Hippolyte Gisserot-Boukhlef and Tom Aarsen and Jan Kostkan and Konrad Wojtasik and Taemin Lee and Marek Šuppa and Crystina Zhang and Roberta Rocca and Mohammed Hamdy and Andrianos Michail and John Yang and Manuel Faysse and Aleksei Vatolin and Nandan Thakur and Manan Dey and Dipam Vasani and Pranjal Chitale and Simone Tedeschi and Nguyen Tai and Artem Snegirev and Michael Günther and Mengzhou Xia and Weijia Shi and Xing Han Lù and Jordan Clive and Gayatri Krishnakumar and Anna Maksimova and Silvan Wehrli and Maria Tikhonova and Henil Panchal and Aleksandr Abramov and Malte Ostendorff and Zheng Liu and Simon Clematide and Lester James Miranda and Alena Fenogenova and Guangyu Song and Ruqiya Bin Safi and Wen-Ding Li and Alessia Borghini and Federico Cassano and Hongjin Su and Jimmy Lin and Howard Yen and Lasse Hansen and Sara Hooker and Chenghao Xiao and Vaibhav Adlakha and Orion Weller and Siva Reddy and Niklas Muennighoff}, publisher = {arXiv}, journal={arXiv preprint arXiv:2502.13595}, year={2025}, url={https://arxiv.org/abs/2502.13595}, doi = {10.48550/arXiv.2502.13595}, } @article{muennighoff2022mteb, author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Loïc and Reimers, Nils}, title = {MTEB: Massive Text Embedding Benchmark}, publisher = {arXiv}, journal={arXiv preprint arXiv:2210.07316}, year = {2022} url = {https://arxiv.org/abs/2210.07316}, doi = {10.48550/ARXIV.2210.07316}, } ``` # Dataset Statistics