--- dataset_info: - config_name: eval features: - name: query dtype: string - name: image dtype: image - name: negative_0 dtype: image - name: negative_1 dtype: image - name: negative_2 dtype: image - name: negative_3 dtype: image splits: - name: train num_bytes: 356052075 num_examples: 300 download_size: 328567541 dataset_size: 356052075 - config_name: full features: - name: query dtype: string - name: image dtype: image - name: negative_0 dtype: image - name: negative_1 dtype: image - name: negative_2 dtype: image - name: negative_3 dtype: image splits: - name: train num_bytes: 62370383388 num_examples: 53512 download_size: 57161629955 dataset_size: 62370383388 - config_name: train features: - name: query dtype: string - name: image dtype: image - name: negative_0 dtype: image - name: negative_1 dtype: image - name: negative_2 dtype: image - name: negative_3 dtype: image splits: - name: train num_bytes: 11548548625 num_examples: 10000 download_size: 10570074118 dataset_size: 11548548625 configs: - config_name: eval data_files: - split: train path: eval/train-* - config_name: full data_files: - split: train path: full/train-* - config_name: train data_files: - split: train path: train/train-* license: apache-2.0 language: - en pretty_name: Visual Document Retrieval Dataset --- # llamaindex-vdr-en-train-preprocessed This dataset is a preprocessed English subset of [llamaindex/vdr-multilingual-train](https://huggingface.co/datasets/llamaindex/vdr-multilingual-train), prepared for training multimodal [Sentence Transformer](https://sbert.net) embedding models on document screenshot retrieval. ## Changes from the original dataset The original [llamaindex/vdr-multilingual-train](https://huggingface.co/datasets/llamaindex/vdr-multilingual-train) dataset stores hard negatives as a list of ID strings that reference other rows. This dataset makes two key changes: 1. **English only**: Only the English subset (53,512 samples) is included. 2. **Resolved negatives as images**: 4 out of the 16 hard negatives are resolved from IDs into the actual document screenshot images, stored as `negative_0` through `negative_3`. This makes the dataset directly usable for training with Sentence Transformers without any additional preprocessing. ## Dataset Structure Each sample contains: | Column | Type | Description | |---|---|---| | `query` | `string` | A synthetic text query associated with the document screenshot | | `image` | `image` | The positive document screenshot (PDF page rendered as an image) | | `negative_0` | `image` | Hard negative document screenshot (closest) | | `negative_1` | `image` | Hard negative document screenshot | | `negative_2` | `image` | Hard negative document screenshot | | `negative_3` | `image` | Hard negative document screenshot (furthest) | ## Configs | Config | Samples | Description | |---|---|---| | `full` | 53,512 | All English samples | | `train` | 10,000 | The first 10,000 samples (0–9,999) from the `full` dataset | | `eval` | 300 | The next 300 samples (10,000–10,299) from the `full` dataset | You can certainly train on the `full` dataset, and then you're recommended to make your own eval/test splits. Do not combine `full` and `eval`, as you'll train and evaluate on the same data. ## Usage ```python from datasets import load_dataset # Load the training split train_dataset = load_dataset("tomaarsen/llamaindex-vdr-en-train-preprocessed", "train", split="train") # Load the evaluation split eval_dataset = load_dataset("tomaarsen/llamaindex-vdr-en-train-preprocessed", "eval", split="train") # Load all English samples full_dataset = load_dataset("tomaarsen/llamaindex-vdr-en-train-preprocessed", "full", split="train") ``` ## Training This dataset can be used to finetune a multimodal Sentence Transformer model for document screenshot embedding. See the [training example](https://github.com/huggingface/sentence-transformers/blob/main/examples/sentence_transformer/training/multimodal/training_document_screenshot_embedding.py) for a full training script. ## Source This dataset is derived from [llamaindex/vdr-multilingual-train](https://huggingface.co/datasets/llamaindex/vdr-multilingual-train), which consists of 500k multilingual query-image samples collected and generated from public internet PDFs. Queries were synthetically generated using VLMs (gemini-1.5-pro and Qwen2-VL-72B). See the original dataset card for full details on the data collection and curation process.