File size: 4,138 Bytes
ed91596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17f4397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
dataset_info:
  features:
  - name: text
    dtype: string
  - name: embedding
    list: float32
  splits:
  - name: go
    num_bytes: 343267175
    num_examples: 100000
  - name: java
    num_bytes: 345865330
    num_examples: 100000
  - name: javascript
    num_bytes: 358994438
    num_examples: 100000
  - name: php
    num_bytes: 352121017
    num_examples: 100000
  - name: python
    num_bytes: 359909795
    num_examples: 100000
  - name: ruby
    num_bytes: 337841463
    num_examples: 100000
  download_size: 1941677770
  dataset_size: 2097999218
configs:
- config_name: default
  data_files:
  - split: go
    path: data/go-*
  - split: java
    path: data/java-*
  - split: javascript
    path: data/javascript-*
  - split: php
    path: data/php-*
  - split: python
    path: data/python-*
  - split: ruby
    path: data/ruby-*
---

# minishlab/tokenlearn-cornstack-docs-coderankembed-v2 Dataset Card

This dataset was created with [Tokenlearn](https://github.com/MinishLab/tokenlearn) for training [Model2Vec](https://github.com/MinishLab/model2vec) models on code retrieval. It contains mean token embeddings produced by [nomic-ai/CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed), used as training targets for static embedding distillation.

The dataset contains code documents from [CornStack](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1) across 6 programming languages (100,000 rows per language, 600,000 total).

## Dataset Details

| Field | Value |
|---|---|
| **Source** | CornStack (nomic-ai) |
| **Embedding model** | [nomic-ai/CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed) |
| **Embedding dimension** | 768 |
| **Languages** | Python, Java, PHP, Go, JavaScript, Ruby |
| **Rows per language** | 100,000 |
| **Total rows** | 600,000 |
| **Field** | `document` |

## Source Datasets

| Language | Source |
|---|---|
| `python` | [nomic-ai/cornstack-python-v1](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1) |
| `java` | [nomic-ai/cornstack-java-v1](https://huggingface.co/datasets/nomic-ai/cornstack-java-v1) |
| `php` | [nomic-ai/cornstack-php-v1](https://huggingface.co/datasets/nomic-ai/cornstack-php-v1) |
| `go` | [nomic-ai/cornstack-go-v1](https://huggingface.co/datasets/nomic-ai/cornstack-go-v1) |
| `javascript` | [nomic-ai/cornstack-javascript-v1](https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1) |
| `ruby` | [nomic-ai/cornstack-ruby-v1](https://huggingface.co/datasets/nomic-ai/cornstack-ruby-v1) |

## Dataset Structure

| Column | Type | Description |
|---|---|---|
| `text` | `string` | Truncated input text (tokenizer max length 512) |
| `embedding` | `list[float32]` | Mean token embedding from `nomic-ai/CodeRankEmbed`, excluding BOS/EOS tokens |

## Usage

Load a single language config:

```python
from datasets import load_dataset

# Load Python code documents
dataset = load_dataset("minishlab/tokenlearn-cornstack-docs-coderankembed", name="python")

# Load all languages and concatenate
from datasets import concatenate_datasets
all_langs = concatenate_datasets([
    load_dataset("minishlab/tokenlearn-cornstack-docs-coderankembed", name=lang)["train"]
    for lang in ["python", "java", "php", "go", "javascript", "ruby"]
])
```

## Creation

Featurized from CornStack using [nomic-ai/CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed) with mean token pooling (BOS/EOS excluded). Two sampling seeds (42 and 100) were used with a 10k streaming shuffle buffer to maximise diversity. Texts are truncated to 512 tokens.

## Library Authors

Tokenlearn was developed by the [Minish](https://github.com/MinishLab) team consisting of [Stephan Tulkens](https://github.com/stephantul) and [Thomas van Dongen](https://github.com/Pringled).

## Citation

```
@software{minishlab2024model2vec,
  author       = {Stephan Tulkens and {van Dongen}, Thomas},
  title        = {Model2Vec: Fast State-of-the-Art Static Embeddings},
  year         = {2024},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.17270888},
  url          = {https://github.com/MinishLab/model2vec},
  license      = {MIT}
}
```