Update README.md
Browse files
README.md
CHANGED
|
@@ -42,3 +42,79 @@ configs:
|
|
| 42 |
- split: ruby
|
| 43 |
path: data/ruby-*
|
| 44 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
- split: ruby
|
| 43 |
path: data/ruby-*
|
| 44 |
---
|
| 45 |
+
|
| 46 |
+
# minishlab/tokenlearn-cornstack-docs-coderankembed-v2 Dataset Card
|
| 47 |
+
|
| 48 |
+
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.
|
| 49 |
+
|
| 50 |
+
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).
|
| 51 |
+
|
| 52 |
+
## Dataset Details
|
| 53 |
+
|
| 54 |
+
| Field | Value |
|
| 55 |
+
|---|---|
|
| 56 |
+
| **Source** | CornStack (nomic-ai) |
|
| 57 |
+
| **Embedding model** | [nomic-ai/CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed) |
|
| 58 |
+
| **Embedding dimension** | 768 |
|
| 59 |
+
| **Languages** | Python, Java, PHP, Go, JavaScript, Ruby |
|
| 60 |
+
| **Rows per language** | 100,000 |
|
| 61 |
+
| **Total rows** | 600,000 |
|
| 62 |
+
| **Field** | `document` |
|
| 63 |
+
|
| 64 |
+
## Source Datasets
|
| 65 |
+
|
| 66 |
+
| Language | Source |
|
| 67 |
+
|---|---|
|
| 68 |
+
| `python` | [nomic-ai/cornstack-python-v1](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1) |
|
| 69 |
+
| `java` | [nomic-ai/cornstack-java-v1](https://huggingface.co/datasets/nomic-ai/cornstack-java-v1) |
|
| 70 |
+
| `php` | [nomic-ai/cornstack-php-v1](https://huggingface.co/datasets/nomic-ai/cornstack-php-v1) |
|
| 71 |
+
| `go` | [nomic-ai/cornstack-go-v1](https://huggingface.co/datasets/nomic-ai/cornstack-go-v1) |
|
| 72 |
+
| `javascript` | [nomic-ai/cornstack-javascript-v1](https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1) |
|
| 73 |
+
| `ruby` | [nomic-ai/cornstack-ruby-v1](https://huggingface.co/datasets/nomic-ai/cornstack-ruby-v1) |
|
| 74 |
+
|
| 75 |
+
## Dataset Structure
|
| 76 |
+
|
| 77 |
+
| Column | Type | Description |
|
| 78 |
+
|---|---|---|
|
| 79 |
+
| `text` | `string` | Truncated input text (tokenizer max length 512) |
|
| 80 |
+
| `embedding` | `list[float32]` | Mean token embedding from `nomic-ai/CodeRankEmbed`, excluding BOS/EOS tokens |
|
| 81 |
+
|
| 82 |
+
## Usage
|
| 83 |
+
|
| 84 |
+
Load a single language config:
|
| 85 |
+
|
| 86 |
+
```python
|
| 87 |
+
from datasets import load_dataset
|
| 88 |
+
|
| 89 |
+
# Load Python code documents
|
| 90 |
+
dataset = load_dataset("minishlab/tokenlearn-cornstack-docs-coderankembed", name="python")
|
| 91 |
+
|
| 92 |
+
# Load all languages and concatenate
|
| 93 |
+
from datasets import concatenate_datasets
|
| 94 |
+
all_langs = concatenate_datasets([
|
| 95 |
+
load_dataset("minishlab/tokenlearn-cornstack-docs-coderankembed", name=lang)["train"]
|
| 96 |
+
for lang in ["python", "java", "php", "go", "javascript", "ruby"]
|
| 97 |
+
])
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
## Creation
|
| 101 |
+
|
| 102 |
+
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.
|
| 103 |
+
|
| 104 |
+
## Library Authors
|
| 105 |
+
|
| 106 |
+
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).
|
| 107 |
+
|
| 108 |
+
## Citation
|
| 109 |
+
|
| 110 |
+
```
|
| 111 |
+
@software{minishlab2024model2vec,
|
| 112 |
+
author = {Stephan Tulkens and {van Dongen}, Thomas},
|
| 113 |
+
title = {Model2Vec: Fast State-of-the-Art Static Embeddings},
|
| 114 |
+
year = {2024},
|
| 115 |
+
publisher = {Zenodo},
|
| 116 |
+
doi = {10.5281/zenodo.17270888},
|
| 117 |
+
url = {https://github.com/MinishLab/model2vec},
|
| 118 |
+
license = {MIT}
|
| 119 |
+
}
|
| 120 |
+
```
|