--- license: cc-by-sa-4.0 language: - multilingual - tr - en task_categories: - sentence-similarity - feature-extraction tags: - embeddings - distillation - retrieval - wikipedia - embeddinggemma pretty_name: Wikipedia 40 Languages with EmbeddingGemma-2 Retrieval Embeddings source_datasets: - alibayram/wikipedia-40-langs dataset_info: features: - name: lang dtype: string - name: title dtype: string - name: text dtype: string - name: url dtype: string - name: truncated dtype: bool - name: original_text_chars dtype: int32 - name: embedgemma2_query_embedding list: float32 length: 768 - name: embedgemma2_document_embedding list: float32 length: 768 splits: - name: test num_bytes: 629625358 num_examples: 58000 - name: validation num_bytes: 1889874358 num_examples: 174000 - name: train num_bytes: 6706701076 num_examples: 580000 download_size: 6180693596 dataset_size: 8596575434 configs: - config_name: default data_files: - split: test path: data/test-* - split: validation path: data/validation-* - split: train path: data/train-* --- # Wikipedia 40 Languages with EmbeddingGemma-2 Retrieval Embeddings Precomputed teacher embeddings from [google/embeddinggemma-2](https://huggingface.co/google/embeddinggemma-2) for offline embedding distillation, built on [alibayram/wikipedia-40-langs](https://huggingface.co/datasets/alibayram/wikipedia-40-langs). It is the distillation corpus for [alibayram/embeddingmagibu2](https://huggingface.co/alibayram/embeddingmagibu2), following the pipeline of [arXiv:2605.29992](https://arxiv.org/abs/2605.29992). > **Status:** splits are added as they finish (test → validation → train). > Live progress and ETA: [`progress.json`](./progress.json). Files under `progress/` are partial > chunks of the split being encoded and are removed once that split is pushed. ## Splits | Split | Rows | |---|---| | test | 58,000 | | validation | 174,000 | | train | 580,000 | ## Columns | Column | Description | |---|---| | `lang`, `title`, `url` | From the source dataset | | `text` | Article text, **clipped** so the document fits 8,192 tokens in both tokenizers (see below). This is exactly the text that was embedded. | | `truncated` | `true` if `text` was clipped (~2.6% of rows) | | `original_text_chars` | Character length of the unclipped article | | `embedgemma2_query_embedding` | Teacher embedding of `task: search result \| query: {title}` (768-d, L2-normalized) | | `embedgemma2_document_embedding` | Teacher embedding of `title: {title} \| text: {text}` (768-d, L2-normalized) | Both targets use EmbeddingGemma's retrieval prompt formats, so a student can learn query and document representations; the title query and its article form a natural positive pair. ## Clipping to both tokenizers The student model uses the Turkish-optimized [magibu/Altus](https://huggingface.co/magibu/Altus) tokenizer, which needs ~21% fewer tokens for Turkish but up to ~15% more for some languages (e.g. Russian). To guarantee that student and teacher always see the **same** input, each rendered document (`title: … | text: …`) was clipped at the first character where *either* the teacher tokenizer or Altus exceeds 8,184 tokens (8,192 minus a reserve for special tokens), preferring a word boundary. No row exceeds 8,192 tokens in either tokenizer. ## How it was made - Teacher: `google/embeddinggemma-2`, bf16 on a single H200, mean pooling, normalized outputs. Verified against fp32 `SentenceTransformer.encode` (cosine ≥ 0.9997). - Global length sorting with token-budget batching; script: `prepare_distillation_dataset.py`. ## Usage ```python from datasets import load_dataset ds = load_dataset("alibayram/wikipedia-40-langs-with-embeddings-embeddinggemma2", split="test") row = ds[0] doc_input = f"title: {row['title']} | text: {row['text']}" # student input for the document target query_input = f"task: search result | query: {row['title']}" # student input for the query target ``` ## License Text is from Wikipedia under CC BY-SA 4.0; embeddings are derived from it.