Datasets:

Modalities:
Text
Formats:
json
ArXiv:
Libraries:
Datasets
Dask
License:
Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
query
stringlengths
7
3.85k
document
stringlengths
11
430k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns the value of the 'go_package' option of the first .proto file found in the same directory as projectFile
func detectGoPackageForProject(projectFile string) (string, error) { var goPkg string projectDir := filepath.Dir(projectFile) if err := filepath.Walk(projectDir, func(protoFile string, info os.FileInfo, err error) error { // already set if goPkg != "" { return nil } if !strings.HasSuffix(protoFile, ".proto") { return nil } // search for go_package on protos in the same dir as the project.json if projectDir != filepath.Dir(protoFile) { return nil } content, err := ioutil.ReadFile(protoFile) if err != nil { return err } lines := strings.Split(string(content), "\n") for _, line := range lines { goPackage := goPackageStatementRegex.FindStringSubmatch(line) if len(goPackage) == 0 { continue } if len(goPackage) != 2 { return errors.Errorf("parsing go_package error: from %v found %v", line, goPackage) } goPkg = goPackage[1] break } return nil }); err != nil { return "", err } if goPkg == "" { return "", errors.Errorf("no go_package statement found in root dir of project %v", projectFile) } return goPkg, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (g *Generator) GoFilePackage(depfile *fdep.DepFile) string {\n\treturn fproto_wrap.BaseName(g.GoWrapPackage(depfile))\n}", "func (g *Generator) GoPackage(depfile *fdep.DepFile) string {\n\tfor _, o := range depfile.ProtoFile.Options {\n\t\tif o.Name == \"go_package\" {\n\t\t\treturn o.Value.String()\n\t\t}\...
[ "0.6514599", "0.6418956", "0.62568474", "0.6100058", "0.6059389", "0.6033528", "0.5760218", "0.571393", "0.56766814", "0.56747204", "0.55886865", "0.55810106", "0.55710924", "0.5528127", "0.5502348", "0.55021805", "0.5456921", "0.5454185", "0.54367715", "0.54307157", "0.54025...
0.7273096
0
NewQueueManager instantiates a new QueueManager object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed
func NewQueueManager(name string, clusters []string, aliasQueues []AliasQueue, remoteQueues []RemoteQueue, clusterQueues []ClusterQueue, ) *QueueManager { this := QueueManager{} this.Name = name this.Clusters = clusters this.AliasQueues = aliasQueues this.RemoteQueues = remoteQueues this.ClusterQueues = clusterQueues return &this }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewQueueManager(logger log.Logger, cfg config.QueueConfig, externalLabels labels.Labels, relabelConfigs []*relabel.Config, client StorageClient, flushDeadline time.Duration) *QueueManager {\n\tif logger == nil {\n\t\tlogger = log.NewNopLogger()\n\t} else {\n\t\tlogger = log.With(logger, \"queue\", client.Name...
[ "0.6894487", "0.6460588", "0.6222042", "0.61513555", "0.6091006", "0.606205", "0.60386145", "0.6006943", "0.59639966", "0.594565", "0.5942067", "0.59363455", "0.5910915", "0.5891163", "0.5883823", "0.5868089", "0.5867437", "0.58120775", "0.579116", "0.57845575", "0.5739835", ...
0.6490378
1
NewQueueManagerWithDefaults instantiates a new QueueManager object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set
func NewQueueManagerWithDefaults() *QueueManager { this := QueueManager{} return &this }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewQueueManager(logger log.Logger, cfg config.QueueConfig, externalLabels labels.Labels, relabelConfigs []*relabel.Config, client StorageClient, flushDeadline time.Duration) *QueueManager {\n\tif logger == nil {\n\t\tlogger = log.NewNopLogger()\n\t} else {\n\t\tlogger = log.With(logger, \"queue\", client.Name...
[ "0.6368561", "0.5929313", "0.5928396", "0.59103316", "0.5819523", "0.58130354", "0.5753316", "0.5739753", "0.568538", "0.5661701", "0.5606484", "0.5487868", "0.54643965", "0.5463153", "0.54630005", "0.5449085", "0.544472", "0.54301214", "0.540289", "0.5370558", "0.535047", ...
0.7690877
0
GetName returns the Name field value
func (o *QueueManager) GetName() string { if o == nil { var ret string return ret } return o.Name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *SingleSelectFieldField) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (f *Field) GetName() string {\n\treturn formatGoName(f.Name)\n}", "func (e *Entry) GetName() string {\n\tif len(e.NameRaw) > 0 {\n\t\treturn string(e.NameRaw)\n\t}\n\tretu...
[ "0.8270152", "0.79907626", "0.7765679", "0.76368356", "0.7604266", "0.7600852", "0.75710016", "0.7564642", "0.7548394", "0.75191027", "0.7517443", "0.7511258", "0.7505484", "0.74717504", "0.7460151", "0.7448915", "0.7438394", "0.7437716", "0.7437274", "0.74279296", "0.7417602...
0.0
-1
GetNameOk returns a tuple with the Name field value and a boolean to check if the value has been set.
func (o *QueueManager) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *SingleSelectFieldField) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *FormField) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Credit1099Payer) GetNam...
[ "0.78737646", "0.7743277", "0.76780003", "0.76587296", "0.7625746", "0.7576448", "0.7566445", "0.754901", "0.7547995", "0.7547995", "0.7546563", "0.7531728", "0.74989444", "0.7477683", "0.7444606", "0.74311113", "0.74224156", "0.7415727", "0.73950857", "0.73914826", "0.737795...
0.0
-1
SetName sets field value
func (o *QueueManager) SetName(v string) { o.Name = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cli *SetWrapper) SetName(name string) error {\n\treturn cli.set.SetValue(fieldSetName, name)\n}", "func (m *ModelStructRecord) SetField(name string, value reflect.Value) {\n\tif name == \"\" {\n\t\treturn\n\t}\n\tfieldValue := m.FieldValues[name]\n\t//if value.Kind() == reflect.Ptr {\n\t//\tpanic(\"RecordF...
[ "0.6978644", "0.67127097", "0.6554158", "0.6535701", "0.648949", "0.6488116", "0.64872724", "0.64611167", "0.641035", "0.63914317", "0.6386742", "0.6377272", "0.63651955", "0.6351144", "0.6337588", "0.6311778", "0.6311778", "0.6304745", "0.62829113", "0.6272751", "0.6268671",...
0.0
-1
GetClusters returns the Clusters field value
"func (o *QueueManager) GetClusters() []string {\n\tif o == nil {\n\t\tvar ret []string\n\t\treturn(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["func (c *Config) GetClusters(ctx context.Context, quiet bool, filterMap map[string]string, cluster(...TRUNCATED)
["0.7150111","0.70848936","0.7050372","0.69830257","0.69812804","0.68225586","0.6785897","0.67075115(...TRUNCATED)
0.76226926
0
"GetClustersOk returns a tuple with the Clusters field value and a boolean to check if the value has(...TRUNCATED)
"func (o *QueueManager) GetClustersOk() (*[]string, bool) {\n\tif o == nil {\n\t\treturn nil, false(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["func NewGetClustersOK() *GetClustersOK {\n\treturn &GetClustersOK{}\n}","func (o *ResourceLimits) (...TRUNCATED)
["0.6719827","0.65017885","0.6465093","0.646219","0.6398727","0.63660103","0.63552487","0.63049424",(...TRUNCATED)
0.8224033
0
SetClusters sets field value
func (o *QueueManager) SetClusters(v []string) { o.Clusters = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["func (s *RaftDatabase) SetClusters(clusters int) {\n\ts.clusters = clusters\n}","func (s *RaftData(...TRUNCATED)
["0.623222","0.5735698","0.55403745","0.5447475","0.5413994","0.5402886","0.53507334","0.5320656","0(...TRUNCATED)
0.680183
0
GetAliasQueues returns the AliasQueues field value
"func (o *QueueManager) GetAliasQueues() []AliasQueue {\n\tif o == nil {\n\t\tvar ret []AliasQueue\(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["func (o *QueueManager) GetAliasQueuesOk() (*[]AliasQueue, bool) {\n\tif o == nil {\n\t\treturn ni(...TRUNCATED)
["0.69151425","0.6435573","0.6247431","0.6227677","0.6098082","0.59897524","0.58581173","0.5692911",(...TRUNCATED)
0.7781025
0
End of preview. Expand in Data Studio

CoRNStack Go 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
648

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

Collection including nomic-ai/cornstack-go-v1

Paper for nomic-ai/cornstack-go-v1