Datasets:

Modalities:
Text
Formats:
json
ArXiv:
Libraries:
Datasets
Dask
License:
Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
return boolean as string 'true' / 'false'
function bool2str($bool) { if($bool ===false) return 'false'; else return 'true'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bool_s($boolean) {\n\treturn ($boolean ? 'true' : 'false');\n}", "public static function strbool($bool){\r\n return ($bool) ? \"true\" : \"false\";\r\n }", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "function bool_to_string($value) {\n ...
[ "0.80348504", "0.80206877", "0.78751075", "0.7846424", "0.76890635", "0.7611359", "0.7559533", "0.7543506", "0.7523593", "0.75164706", "0.74617386", "0.7412224", "0.7410573", "0.7393141", "0.73901856", "0.7379897", "0.73708546", "0.7250726", "0.7164452", "0.71530366", "0.7104...
0.8142804
0
compare two objects. Arguments are passed byreference test: equals, not equal, equal identity, not equal identity
function compareObjects(&$ob1, &$ob2) { print_pre('o1 == o2 : ' . bool2str($ob1 == $ob2)); print_pre('o1 != o2 : ' . bool2str($ob1 != $ob2)); print_pre('o1 === o2 : ' . bool2str($ob1 === $ob2)); print_pre('o1 !== o2 : ' . bool2str($ob1 !== $ob2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equals($other);", "public function equals( $A, $B );", "public function equals($other) { return $this->obj==Sandbox::unwrap($other); }", "protected function compareObjects(object $a, object $b): int\n {\n // see https://github.com/php/php-src/issues/10513\n return strcmp(spl_object_...
[ "0.6673335", "0.65883684", "0.6582047", "0.6493526", "0.6361353", "0.6307741", "0.62992543", "0.6271147", "0.6259657", "0.62595", "0.62512934", "0.6212965", "0.62024915", "0.614383", "0.61387986", "0.60835725", "0.6081624", "0.60350287", "0.6030523", "0.60098636", "0.6003072"...
0.7712369
0
Private function used to create flash messages.
private function create($message, $type, $icon) { session()->flash('flash_message', [ 'type' => $type, 'message' => $message, 'icon' => $icon ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addFlashMessages() {}", "protected function renderFlashMessages() {}", "public function renderFlashMessages() {}", "public function prepareFlashMessages()\n {\n global $session;\n\n $messages = [];\n foreach ($session->getFlashBag()->all() as $msgType => $msg) {\n ...
[ "0.7982978", "0.7585968", "0.7531636", "0.7033895", "0.6959473", "0.6919559", "0.6755891", "0.67464936", "0.6726649", "0.6724016", "0.66906536", "0.6656272", "0.66116333", "0.6606081", "0.6582779", "0.65679413", "0.65459204", "0.6528431", "0.6479382", "0.6456712", "0.6441896"...
0.0
-1
Returns a rules checker object that will be used for validating application integrity.
public function buildRules(RulesChecker $rules) { $rules->add($rules->existsIn(['community_id'], 'Communities')); return $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildRules(RulesChecker $rules): RulesChecker\n {\n return $rules;\n }", "private static function rules() : mixed\n {\n return AppContainer::get(Constants::validatorRules);\n }", "protected function getValidatorInstance()\n {\n return app(ValidationFactory::c...
[ "0.64002764", "0.6388235", "0.6269912", "0.62365985", "0.61949646", "0.60835993", "0.6026187", "0.6018978", "0.60069567", "0.59928614", "0.5965456", "0.59599984", "0.59508055", "0.59508055", "0.58873993", "0.58730704", "0.5868297", "0.58623487", "0.5858684", "0.58502865", "0....
0.0
-1
Determine whether the user can view any dictations.
public function viewAny(User $user) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function canView(): bool\n {\n return true;\n }", "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "public function canViewSuggestions(){\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n if(!empty($viewer_id)){\n ...
[ "0.7072534", "0.7014345", "0.6995714", "0.6938637", "0.6833039", "0.67313796", "0.6724647", "0.6687632", "0.6654833", "0.6518234", "0.6486282", "0.6467284", "0.64662343", "0.6464162", "0.64623916", "0.644497", "0.6425268", "0.6425268", "0.6425268", "0.6418657", "0.6400825", ...
0.0
-1
Determine whether the user can view the dictation.
public function view(User $user, Dictation $dictation) { return $user->id === $dictation->user_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function canView(): bool\n {\n return true;\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function isViewAllowed()\n {\n ...
[ "0.74905837", "0.7298032", "0.7290971", "0.72378844", "0.7138538", "0.70307034", "0.6966617", "0.6963488", "0.69623107", "0.69537485", "0.6918316", "0.69056845", "0.6903895", "0.6873843", "0.6839047", "0.68114954", "0.6795878", "0.67919475", "0.67753685", "0.6734841", "0.6711...
0.6753222
19
Determine whether the user can create dictations.
public function create(User $user) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canCreate();", "public function canCreate();", "public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }", "protected function canCreate() {}", "function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "pu...
[ "0.7158591", "0.7158591", "0.7004075", "0.69176805", "0.68762827", "0.6832613", "0.67593026", "0.6733605", "0.6602696", "0.65521336", "0.65363324", "0.6513328", "0.64837", "0.64715225", "0.6460786", "0.6424019", "0.6411944", "0.64056706", "0.63699055", "0.6365257", "0.6364605...
0.0
-1
Determine whether the user can update the dictation.
public function update(User $user, Dictation $dictation) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }","sta(...TRUNCATED)
["0.78191936","0.7513647","0.7455891","0.7445574","0.73001844","0.7274134","0.72438014","0.7217646",(...TRUNCATED)
0.0
-1
Determine whether the user can delete the dictation.
public function delete(User $user, Dictation $dictation) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : f(...TRUNCATED)
["0.79159534","0.78139716","0.76370144","0.74723876","0.74192196","0.7407923","0.73950195","0.738611(...TRUNCATED)
0.0
-1
Determine whether the user can restore the dictation.
public function restore(User $user, Dictation $dictation) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["private function can_restore() {\n return isset( $_POST[ self::NAME ] ) &&\n $_P(...TRUNCATED)
["0.76101106","0.68357676","0.6747794","0.6736294","0.6730892","0.6663075","0.6510922","0.63686544",(...TRUNCATED)
0.58742285
15
End of preview. Expand in Data Studio

CoRNStack PHP Dataset

The CoRNStack Dataset, accepted to ICLR 2025, is a large-scale high quality training dataset specifically for code retrieval across multiple programming languages. This dataset comprises of <query, positive, negative> triplets used to train nomic-embed-code, CodeRankEmbed, and CodeRankLLM.

CoRNStack Dataset Curation

Starting with the deduplicated Stackv2, we create text-code pairs from function docstrings and respective code. We filtered out low-quality pairs where the docstring wasn't English, too short, or that contained URLs, HTML tags, or invalid characters. We additionally kept docstrings with text lengths of 256 tokens or longer to help the model learn long-range dependencies.

image/png

After the initial filtering, we used dual-consistency filtering to remove potentially noisy examples. We embed each docstring and code pair and compute the similarity between each docstring and every code example. We remove pairs from the dataset if the corresponding code example is not found in the top-2 most similar examples for a given docstring.

During training, we employ a novel curriculum-based hard negative mining strategy to ensure the model learns from challenging examples. We use a softmax-based sampling strategy to progressively sample hard negatives with increasing difficulty over time.

Join the Nomic Community

Citation

If you find the model, dataset, or training code useful, please cite our work:

@misc{suresh2025cornstackhighqualitycontrastivedata,
      title={CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking}, 
      author={Tarun Suresh and Revanth Gangi Reddy and Yifei Xu and Zach Nussbaum and Andriy Mulyar and Brandon Duderstadt and Heng Ji},
      year={2025},
      eprint={2412.01007},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.01007}, 
}
Downloads last month
508

Models trained or fine-tuned on nomic-ai/cornstack-php-v1

Collection including nomic-ai/cornstack-php-v1

Paper for nomic-ai/cornstack-php-v1