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
| 10 |
+
- lance
|
| 11 |
+
- multimodal
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# MMEB Training Dataset (Lance Format)
|
| 15 |
+
|
| 16 |
+
This is a **Lance-format** version of the [TIGER-Lab/MMEB-train](https://huggingface.co/datasets/TIGER-Lab/MMEB-train) dataset, optimized for efficient storage and fast random access.
|
| 17 |
+
|
| 18 |
+
The original dataset is used for training VLM2Vec models in the paper [VLM2Vec: Training Vision-Language Models for Massive Multimodal Embedding Tasks](https://arxiv.org/abs/2410.05160) (ICLR 2025).
|
| 19 |
+
|
| 20 |
+
## Why Lance Format?
|
| 21 |
+
|
| 22 |
+
| Metric | Original (Parquet + Images) | Lance |
|
| 23 |
+
|--------|----------------------------|-------|
|
| 24 |
+
| Storage Size | 94 GB | 47 GB (**-50%**) |
|
| 25 |
+
| File Count | 1,353,735 | 252 (**-99.98%**) |
|
| 26 |
+
| Random Access | Slow (many small files) | Fast (columnar + indexed) |
|
| 27 |
+
|
| 28 |
+
## Directory Structure
|
| 29 |
+
|
| 30 |
+
```
|
| 31 |
+
TIGER-Lab_MMEB-train/
|
| 32 |
+
└── data/
|
| 33 |
+
├── A-OKVQA/
|
| 34 |
+
│ ├── train.lance/ # Training metadata
|
| 35 |
+
│ ├── original.lance/ # Original instructions
|
| 36 |
+
│ └── diverse.lance/ # Diverse instructions
|
| 37 |
+
├── MSCOCO/
|
| 38 |
+
│ └── ...
|
| 39 |
+
└── images/
|
| 40 |
+
├── A-OKVQA.lance/ # Images (binary)
|
| 41 |
+
├── MSCOCO.lance/
|
| 42 |
+
└── ...
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
## Schema
|
| 46 |
+
|
| 47 |
+
### Metadata (`{dataset}/{variant}.lance`)
|
| 48 |
+
|
| 49 |
+
| Field | Type | Description |
|
| 50 |
+
|-------|------|-------------|
|
| 51 |
+
| `qry` | string | Query text (may contain `<\|image_1\|>` placeholder) |
|
| 52 |
+
| `qry_image_id` | string | Query image path (empty if text-only) |
|
| 53 |
+
| `pos_text` | string | Positive sample text |
|
| 54 |
+
| `pos_image_id` | string | Positive sample image path |
|
| 55 |
+
| `neg_text` | string | Negative sample text (optional) |
|
| 56 |
+
| `neg_image_id` | string | Negative sample image path (optional) |
|
| 57 |
+
|
| 58 |
+
### Images (`images/{dataset}.lance`)
|
| 59 |
+
|
| 60 |
+
| Field | Type | Description |
|
| 61 |
+
|-------|------|-------------|
|
| 62 |
+
| `image_id` | string | Image path identifier |
|
| 63 |
+
| `data` | binary | Image binary data (JPEG) |
|
| 64 |
+
|
| 65 |
+
## Usage
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
import lance
|
| 69 |
+
|
| 70 |
+
# Load metadata
|
| 71 |
+
metadata = lance.dataset("TIGER-Lab_MMEB-train/data/A-OKVQA/train.lance")
|
| 72 |
+
df = metadata.to_table().to_pandas()
|
| 73 |
+
|
| 74 |
+
# Load images
|
| 75 |
+
images = lance.dataset("TIGER-Lab_MMEB-train/data/images/A-OKVQA.lance")
|
| 76 |
+
|
| 77 |
+
# Create index for fast lookup (optional, one-time)
|
| 78 |
+
images.create_scalar_index("image_id", "BTREE")
|
| 79 |
+
|
| 80 |
+
# Query image by ID
|
| 81 |
+
result = images.to_table(
|
| 82 |
+
filter="image_id = 'images/A-OKVQA/Train/A-OKVQA_image_0.jpg'"
|
| 83 |
+
)
|
| 84 |
+
image_bytes = result["data"][0].as_py()
|
| 85 |
+
|
| 86 |
+
# Batch query
|
| 87 |
+
ids = ["images/A-OKVQA/Train/A-OKVQA_image_0.jpg",
|
| 88 |
+
"images/A-OKVQA/Train/A-OKVQA_image_1.jpg"]
|
| 89 |
+
in_clause = ", ".join([f"'{id}'" for id in ids])
|
| 90 |
+
result = images.to_table(filter=f"image_id IN ({in_clause})")
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
## Dataset Statistics
|
| 94 |
+
|
| 95 |
+
| Dataset | Samples | Images |
|
| 96 |
+
|---------|---------|--------|
|
| 97 |
+
| A-OKVQA | 17,056 | 17,056 |
|
| 98 |
+
| ChartQA | 28,299 | 28,299 |
|
| 99 |
+
| CIRR | 26,116 | 16,640 |
|
| 100 |
+
| DocVQA | 39,463 | 39,463 |
|
| 101 |
+
| HatefulMemes | 8,500 | 8,500 |
|
| 102 |
+
| ImageNet_1K | 100,000 | 100,000 |
|
| 103 |
+
| InfographicsVQA | 23,946 | 4,406 |
|
| 104 |
+
| MSCOCO | 100,000 | 59,969 |
|
| 105 |
+
| MSCOCO_i2t | 113,287 | 113,287 |
|
| 106 |
+
| MSCOCO_t2i | 100,000 | 70,414 |
|
| 107 |
+
| N24News | 48,988 | 48,988 |
|
| 108 |
+
| NIGHTS | 15,941 | 31,882 |
|
| 109 |
+
| OK-VQA | 9,009 | 9,009 |
|
| 110 |
+
| SUN397 | 19,850 | 19,850 |
|
| 111 |
+
| VisDial | 123,287 | 123,287 |
|
| 112 |
+
| Visual7W | 69,817 | 14,366 |
|
| 113 |
+
| VisualNews_i2t | 100,000 | 100,000 |
|
| 114 |
+
| VisualNews_t2i | 99,903 | 99,903 |
|
| 115 |
+
| VOC2007 | 7,844 | 7,844 |
|
| 116 |
+
| WebQA | 17,166 | 12,873 |
|
| 117 |
+
|
| 118 |
+
Each dataset has 3 variants: `train`, `original`, and `diverse` (same sample count, different instruction templates).
|
| 119 |
+
|
| 120 |
+
## Original Dataset
|
| 121 |
+
|
| 122 |
+
This dataset is derived from [TIGER-Lab/MMEB-train](https://huggingface.co/datasets/TIGER-Lab/MMEB-train). For evaluation, please refer to [TIGER-Lab/MMEB-eval](https://huggingface.co/datasets/TIGER-Lab/MMEB-eval).
|
| 123 |
+
|
| 124 |
+
## Citation
|
| 125 |
+
|
| 126 |
+
```bibtex
|
| 127 |
+
@article{jiang2024vlm2vec,
|
| 128 |
+
title={VLM2Vec: Training Vision-Language Models for Massive Multimodal Embedding Tasks},
|
| 129 |
+
author={Jiang, Ziyan and Meng, Rui and Yang, Xinyi and Yavuz, Semih and Zhou, Yingbo and Chen, Wenhu},
|
| 130 |
+
journal={arXiv preprint arXiv:2410.05160},
|
| 131 |
+
year={2024}
|
| 132 |
+
}
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
## License
|
| 136 |
+
|
| 137 |
+
Apache-2.0 (same as the original dataset)
|