Add tokenlearn docs data for CornStack (CodeRankEmbed embeddings)
Browse files
README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_info:
|
| 3 |
+
- config_name: go
|
| 4 |
+
splits:
|
| 5 |
+
- name: train
|
| 6 |
+
num_bytes: 0
|
| 7 |
+
num_examples: 50000
|
| 8 |
+
- config_name: java
|
| 9 |
+
splits:
|
| 10 |
+
- name: train
|
| 11 |
+
num_bytes: 0
|
| 12 |
+
num_examples: 50000
|
| 13 |
+
- config_name: javascript
|
| 14 |
+
splits:
|
| 15 |
+
- name: train
|
| 16 |
+
num_bytes: 0
|
| 17 |
+
num_examples: 50000
|
| 18 |
+
- config_name: php
|
| 19 |
+
splits:
|
| 20 |
+
- name: train
|
| 21 |
+
num_bytes: 0
|
| 22 |
+
num_examples: 50000
|
| 23 |
+
- config_name: python
|
| 24 |
+
splits:
|
| 25 |
+
- name: train
|
| 26 |
+
num_bytes: 0
|
| 27 |
+
num_examples: 50000
|
| 28 |
+
- config_name: ruby
|
| 29 |
+
splits:
|
| 30 |
+
- name: train
|
| 31 |
+
num_bytes: 0
|
| 32 |
+
num_examples: 50000
|
| 33 |
+
configs:
|
| 34 |
+
- config_name: go
|
| 35 |
+
data_files:
|
| 36 |
+
- split: train
|
| 37 |
+
path: go/train-*
|
| 38 |
+
- config_name: java
|
| 39 |
+
data_files:
|
| 40 |
+
- split: train
|
| 41 |
+
path: java/train-*
|
| 42 |
+
- config_name: javascript
|
| 43 |
+
data_files:
|
| 44 |
+
- split: train
|
| 45 |
+
path: javascript/train-*
|
| 46 |
+
- config_name: php
|
| 47 |
+
data_files:
|
| 48 |
+
- split: train
|
| 49 |
+
path: php/train-*
|
| 50 |
+
- config_name: python
|
| 51 |
+
data_files:
|
| 52 |
+
- split: train
|
| 53 |
+
path: python/train-*
|
| 54 |
+
default: true
|
| 55 |
+
- config_name: ruby
|
| 56 |
+
data_files:
|
| 57 |
+
- split: train
|
| 58 |
+
path: ruby/train-*
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
# Pringled/cornstack-docs-tokenlearn Dataset Card
|
| 62 |
+
|
| 63 |
+
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.
|
| 64 |
+
|
| 65 |
+
The dataset contains code documents from [CornStack](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1) across 6 programming languages (50,000 rows per language, 300,000 total).
|
| 66 |
+
|
| 67 |
+
## Dataset Details
|
| 68 |
+
|
| 69 |
+
| Field | Value |
|
| 70 |
+
|---|---|
|
| 71 |
+
| **Source** | CornStack (nomic-ai) |
|
| 72 |
+
| **Embedding model** | [nomic-ai/CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed) |
|
| 73 |
+
| **Embedding dimension** | 768 |
|
| 74 |
+
| **Languages** | Python, Java, PHP, Go, JavaScript, Ruby |
|
| 75 |
+
| **Rows per language** | 50,000 |
|
| 76 |
+
| **Total rows** | 300,000 |
|
| 77 |
+
| **Field** | `document` |
|
| 78 |
+
|
| 79 |
+
## Source Datasets
|
| 80 |
+
|
| 81 |
+
| Language | Source |
|
| 82 |
+
|---|---|
|
| 83 |
+
| `python` | [nomic-ai/cornstack-python-v1](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1) |
|
| 84 |
+
| `java` | [nomic-ai/cornstack-java-v1](https://huggingface.co/datasets/nomic-ai/cornstack-java-v1) |
|
| 85 |
+
| `php` | [nomic-ai/cornstack-php-v1](https://huggingface.co/datasets/nomic-ai/cornstack-php-v1) |
|
| 86 |
+
| `go` | [nomic-ai/cornstack-go-v1](https://huggingface.co/datasets/nomic-ai/cornstack-go-v1) |
|
| 87 |
+
| `javascript` | [nomic-ai/cornstack-javascript-v1](https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1) |
|
| 88 |
+
| `ruby` | [nomic-ai/cornstack-ruby-v1](https://huggingface.co/datasets/nomic-ai/cornstack-ruby-v1) |
|
| 89 |
+
|
| 90 |
+
## Dataset Structure
|
| 91 |
+
|
| 92 |
+
| Column | Type | Description |
|
| 93 |
+
|---|---|---|
|
| 94 |
+
| `text` | `string` | Truncated input text (tokenizer max length 512) |
|
| 95 |
+
| `embedding` | `list[float32]` | Mean token embedding from `nomic-ai/CodeRankEmbed`, excluding BOS/EOS tokens |
|
| 96 |
+
|
| 97 |
+
## Usage
|
| 98 |
+
|
| 99 |
+
Load a single language config:
|
| 100 |
+
|
| 101 |
+
```python
|
| 102 |
+
from datasets import load_dataset
|
| 103 |
+
|
| 104 |
+
# Load Python code documents
|
| 105 |
+
dataset = load_dataset("Pringled/cornstack-docs-tokenlearn", name="python")
|
| 106 |
+
|
| 107 |
+
# Load all languages and concatenate
|
| 108 |
+
from datasets import concatenate_datasets
|
| 109 |
+
all_langs = concatenate_datasets([
|
| 110 |
+
load_dataset("Pringled/cornstack-docs-tokenlearn", name=lang)["train"]
|
| 111 |
+
for lang in ["python", "java", "php", "go", "javascript", "ruby"]
|
| 112 |
+
])
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
## Creation
|
| 116 |
+
|
| 117 |
+
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.
|
| 118 |
+
|
| 119 |
+
## Library Authors
|
| 120 |
+
|
| 121 |
+
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).
|
| 122 |
+
|
| 123 |
+
## Citation
|
| 124 |
+
|
| 125 |
+
```
|
| 126 |
+
@software{minishlab2024model2vec,
|
| 127 |
+
author = {Stephan Tulkens and {van Dongen}, Thomas},
|
| 128 |
+
title = {Model2Vec: Fast State-of-the-Art Static Embeddings},
|
| 129 |
+
year = {2024},
|
| 130 |
+
publisher = {Zenodo},
|
| 131 |
+
doi = {10.5281/zenodo.17270888},
|
| 132 |
+
url = {https://github.com/MinishLab/model2vec},
|
| 133 |
+
license = {MIT}
|
| 134 |
+
}
|
| 135 |
+
```
|
go/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:957e0d37ef3f3d98e35bd37b6d7a6943ea8a8b0c4be8d20c04ad60e940f09d26
|
| 3 |
+
size 162535968
|
java/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75c8a6a239eb998e117cd37ffa7161cfc66b202d111dcd99f6db68f7fbf2adf0
|
| 3 |
+
size 162824204
|
javascript/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e973de485d7569b52dc3b456fc40706a5ad3cc8f7b48e0c5f817fb6d0c914e3
|
| 3 |
+
size 165820807
|
php/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96d9f581bfbdec3437eb9b3a61f92d2decdfd502168cf020dd2066276273ff0d
|
| 3 |
+
size 164029668
|
python/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a07dbeea9a0e0108e14fb75884c4d681d42ff8d2c4fe46c87d1aabe1dc424521
|
| 3 |
+
size 165712675
|
ruby/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e725a563ba15b8d41a09a9620187095121955e39c2810e1eb1d6cb13ae4c9b2
|
| 3 |
+
size 160832628
|