Datasets:

Modalities:
Text
Formats:
json
ArXiv:
Libraries:
Datasets
Dask
License:
Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Set number to adapter.
private void setNumber(final int pos, final String number) { if (pos < 0 || pos >= this.objects.size()) { Preferences.this.objects.add(number); } else { Preferences.this.objects.set(pos, number); } Preferences.this.adapter.notifyDataSetChanged(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setNumber(int num) {\r\n\t\tnumber = num;\r\n\t}", "public void setNumber(int number)\n {\n this.number = number;\n }", "public void setNumber(int number) {\r\n\t\tthis.num = number;\r\n\t}", "public void setNumber(String name, int value) {\n itemNumbers.put(name, value);\n }", "pub...
[ "0.6909254", "0.68034095", "0.6791689", "0.6770674", "0.675652", "0.6753719", "0.672215", "0.66374177", "0.6621348", "0.6605304", "0.6605304", "0.6605304", "0.65497255", "0.64965963", "0.64202344", "0.6316056", "0.6302861", "0.627217", "0.62647384", "0.6241831", "0.6182982", ...
0.6601253
12
Add or edit an item.
private void addEdit(final int pos) { final AlertDialog.Builder b = new AlertDialog.Builder(this); b.setTitle(R.string.add_number); b.setCancelable(true); final EditText et = new EditText(this); if (pos >= 0) { et.setText(this.objects.get(pos)); } b.setView(et); b.setNegativeButton(android.R.string.cancel, null); b.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { final String number = et.getText().toString(); if (number == null || number.length() == 0) { return; } Preferences.this.setNumber(pos, number); Preferences.this.findViewById(R.id.add_hint) .setVisibility(View.GONE); } }); b.setNeutralButton(R.string.contacts, new DialogInterface.OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { final Intent intent = ContactsWrapper.getInstance() .getPickPhoneIntent(); Preferences.this .startActivityForResult(intent, pos + 1); } }); b.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void editItem();", "void add(Item item);", "public abstract void addItem(AbstractItemAPI item);", "public void setEditedItem(Object item) {editedItem = item;}", "Item update(Item item);", "@attribute(value = \"\", required = false)\r\n\tpublic void addItem(Item i) {\r\n\t}", "public ...
[ "0.7420294", "0.72789234", "0.69057184", "0.6886352", "0.6876168", "0.6724139", "0.65786666", "0.6551235", "0.6545374", "0.6541552", "0.6491439", "0.648827", "0.64581114", "0.64581114", "0.64224887", "0.6384609", "0.6384481", "0.6379958", "0.637201", "0.63693637", "0.63522774...
0.0
-1
Export un fichier SRT sous forme de flux.
public byte[] export() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { for (Ligne ligne : lignes) { if (ligne.getTraduit() != null) { bos.write(ligne.getTraduit().getBytes()); } else { bos.write(ligne.getOriginal().getBytes()); } bos.write("\r\n".getBytes()); } } catch (IOException ex) { ex.printStackTrace(); } return bos.toByteArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void export(String URN) {\n try {\n DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance();\n fabrique.setValidating(true);\n DocumentBuilder constructeur = fabrique.newDocumentBuilder();\n Document document = constructeur.newDocument();\n ...
[ "0.61432517", "0.59426624", "0.56408376", "0.5593061", "0.5550418", "0.5460113", "0.54494035", "0.5405103", "0.5370357", "0.5366678", "0.53499836", "0.53424656", "0.53193134", "0.5318653", "0.5314959", "0.53107893", "0.5308951", "0.5292381", "0.5274626", "0.525102", "0.523981...
0.525263
19
base case: verify that a word, a whitespace token, and a punctuation mark each count as one token
"@Test\n\tpublic void testParse() {\n\t\tSentence s = new Sentence();\n\t\ts.parseSentence(BASE_STRI(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["public static void checkPunctuation(List<Token> token) {\r\n\t\tfor (Token tk : token) {\r\n\t\t\t(...TRUNCATED)
["0.69662774","0.6747211","0.6424397","0.640992","0.6175242","0.5913263","0.5903798","0.5858258","0.(...TRUNCATED)
0.0
-1
Interface to be used while getting the section type of the item
public interface Item { boolean isSection(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["public String getSectionType() {\n\treturn sectionType;\n }","SectionType createSectionType();"(...TRUNCATED)
["0.73157513","0.6732766","0.66432995","0.6617953","0.64287835","0.63825434","0.6362256","0.6280955"(...TRUNCATED)
0.67849755
1
private void signSetter(String[] lines, Player p, Block s)
"private void signSetter(Block b, Player p, String[] lines) \n\t{\t\t\n\t\t//TODO: virer debug\n\t\t(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["void updateSignToPlayer(Player player, Location location, String[] lines);","public void setChest((...TRUNCATED)
["0.75891334","0.63917273","0.61865866","0.6100723","0.60475695","0.58892536","0.58086187","0.574983(...TRUNCATED)
0.83206785
0
TODO virer debug p.sendMessage(plugin.chatPrefix + "displaySignInfo");
"public void displaySignInfo(Block b, Player p) \n\t{\n\t\t\n\t\tBoutiqueSign bs = getBoutiqueSign(b(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["@SuppressWarnings(\"finally\")\n\t@Override\n\tpublic Response showSignature() {\n\t\tBaseResponse(...TRUNCATED)
["0.64014196","0.59764016","0.5920605","0.5916014","0.5915829","0.5879527","0.5822003","0.5818665","(...TRUNCATED)
0.7373652
0
Double costAmount = bs.getMoneyTo();
"public boolean getDonation(BoutiqueSign bs, Player p)\n\t{\n\t\t\n\t\tString signOwner = bs.getOwne(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["double getMoney();","public Money getCost(){\r\n return this.cost;\r\n }","org.adscale.f(...TRUNCATED)
["0.76533526","0.7470142","0.72322387","0.7154191","0.7131233","0.7111577","0.70155936","0.69375885"(...TRUNCATED)
0.0
-1
TODO Autogenerated method stub
public void saveGlobalSigns() { plugin.fileio.saveGlobalSigns(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}","@Override\n\tpublic void comer() {\n\t\t(...TRUNCATED)
["0.6671074","0.6567672","0.6523024","0.6481211","0.6477082","0.64591026","0.64127725","0.63762105",(...TRUNCATED)
0.0
-1
/ Enregistre le coffre pour un BoutiqueSignChest
"public void setChest(Block sign, Chest chest, Player p)\n\t{\n\t\tBoutiqueSign bs = this.getBoutiqu(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["@RequiresApi(api = Build.VERSION_CODES.M)\n private void enregistrerCours()\n {\n cou(...TRUNCATED)
["0.68283004","0.584956","0.57410794","0.57351005","0.57296467","0.5677461","0.5673804","0.5672335",(...TRUNCATED)
0.6351957
1
End of preview. Expand in Data Studio

CoRNStack Python 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
244

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

Collection including nomic-ai/cornstack-java-v1

Paper for nomic-ai/cornstack-java-v1