williamium commited on
Commit
9f7cd4d
Β·
verified Β·
1 Parent(s): 05d2e39

add README.md

Browse files
Files changed (1) hide show
  1. README.md +190 -0
README.md ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: "mit"
3
+ pretty_name: "M-BEIR"
4
+ task_categories:
5
+ - text-retrieval
6
+ - text-to-image
7
+ - image-to-text
8
+ - visual-question-answering
9
+ language:
10
+ - "en"
11
+ configs:
12
+ - config_name: query
13
+ data_files:
14
+ - split: train
15
+ path: "query/train/*.jsonl"
16
+ - split: union_train
17
+ path: "query/union_train/*.jsonl"
18
+ - split: val
19
+ path: "query/val/*.jsonl"
20
+ - split: test
21
+ path: "query/test/*.jsonl"
22
+ - config_name: cand_pool
23
+ data_files:
24
+ - split: mbeir_local
25
+ path: "cand_pool/local/*.jsonl"
26
+ - split: mbeir_global
27
+ path: "cand_pool/global/*.jsonl"
28
+ ---
29
+
30
+ ### **UniIR: Training and Benchmarking Universal Multimodal Information Retrievers** (ECCV 2024)
31
+ [**🌐 Homepage**](https://tiger-ai-lab.github.io/UniIR/) | [**πŸ€— Model(UniIR Checkpoints)**](https://huggingface.co/TIGER-Lab/UniIR) | [**πŸ€— Paper**](https://huggingface.co/papers/2311.17136) | [**πŸ“– arXiv**](https://arxiv.org/pdf/2311.17136.pdf) | [**GitHub**](https://github.com/TIGER-AI-Lab/UniIR)
32
+
33
+ <a href="#install-git-lfs" style="color: red;">How to download the M-BEIR Dataset</a>
34
+
35
+ ## πŸ””News
36
+
37
+ - **πŸ”₯[2023-12-21]: Our M-BEIR Benchmark is now available for use.**
38
+
39
+ ## **Dataset Summary**
40
+
41
+ **M-BEIR**, the **M**ultimodal **BE**nchmark for **I**nstructed **R**etrieval, is a comprehensive large-scale retrieval benchmark designed to train and evaluate unified multimodal retrieval models (**UniIR models**).
42
+ The M-BEIR benchmark comprises eight multimodal retrieval tasks and ten datasets from a variety of domains and sources.
43
+ Each task is accompanied by human-authored instructions, encompassing 1.5 million queries and a pool of 5.6 million retrieval candidates in total.
44
+
45
+
46
+ ## **Dataset Structure Overview**
47
+ The M-BEIR dataset is structured into five primary components: Query Data, Candidate Pool, Instructions, Qrels, and Images.
48
+
49
+ ### Query Data
50
+
51
+ Below is the directory structure for the query data:
52
+ ```
53
+ query/
54
+ β”‚
55
+ β”œβ”€β”€ train/
56
+ β”‚ β”œβ”€β”€ mbeir_cirr_train.jsonl
57
+ β”‚ β”œβ”€β”€ mbeir_edis_train.jsonl
58
+ β”‚ ...
59
+ β”œβ”€β”€ union_train/
60
+ β”‚ └── mbeir_union_up_train.jsonl
61
+ β”œβ”€β”€ val/
62
+ β”‚ β”œβ”€β”€ mbeir_visualnews_task0_val.jsonl
63
+ β”‚ β”œβ”€β”€ mbeir_visualnews_task3_val.jsonl
64
+ β”‚ ...
65
+ └── test/
66
+ β”œβ”€β”€ mbeir_visualnews_task0_test.jsonl
67
+ β”œβ”€β”€ mbeir_visualnews_task3_test.jsonl
68
+ ...
69
+ ```
70
+ `train`: Contains all the training data from 8 different datasets formatted in the M-BEIR style.
71
+
72
+ `mbeir_union_up_train.jsonl`: This file is the default training data for in-batch contrastive training specifically designed for UniIR models.
73
+ It aggregates all the data from the train directory and datasets with relatively smaller sizes have been upsampled to balance the training process.
74
+
75
+ `val`: Contains separate files for validation queries, organized by task.
76
+
77
+ `test`: Contains separate files for test queries, organized by task.
78
+
79
+ Every M-BEIR query instance has at least one positive candidate data and possibly no negative candidate data
80
+ Each line in a Query Data file represents a unique query. The structure of each query JSON object is as follows::
81
+ ```json
82
+ {
83
+ "qid": "A unique identifier formatted as {dataset_id}:{query_id}",
84
+ "query_txt": "The text component of the query",
85
+ "query_img_path": "The file path to the associated query image",
86
+ "query_modality": "The modality type of the query (text, image or text,image)",
87
+ "query_src_content": "Additional content from the original dataset, presented as a string by json.dumps()",
88
+ "pos_cand_list": [
89
+ {
90
+ "did": "A unique identifier formatted as {dataset_id}:{doc_id}"
91
+ }
92
+ // ... more positive candidates
93
+ ],
94
+ "neg_cand_list": [
95
+ {
96
+ "did": "A unique identifier formatted as {dataset_id}:{doc_id}"
97
+ }
98
+ // ... more negative candidates
99
+ ]
100
+ }
101
+ ```
102
+
103
+ ### Candidate Pool
104
+ The Candidate Pool contains potential matching documents for the queries.
105
+
106
+ #### M-BEIR_5.6M
107
+ Within the global directory, the default retrieval setting requires models to retrieve positive candidates from a heterogeneous pool encompassing various modalities and domains.
108
+ The M-BEIR's global candidate pool, comprising 5.6 million candidates, includes the retrieval corpus from all tasks and datasets.
109
+
110
+ #### M-BEIR_local
111
+ Within the local directory, we provide dataset-task-specific pool as M-BEIR_local. Dataset-task-specific pool contains homogeneous candidates that originate from by the original dataset.
112
+
113
+ Below is the directory structure for the candidate pool:
114
+ ```
115
+ cand_pool/
116
+ β”‚
117
+ β”œβ”€β”€ global/
118
+ β”‚ β”œβ”€β”€ mbeir_union_val_cand_pool.jsonl
119
+ β”‚ └──mbeir_union_test_cand_pool.jsonl
120
+ β”‚
121
+ └── local/
122
+ β”œβ”€β”€ mbeir_visualnews_task0_cand_pool.jsonl
123
+ β”œβ”€β”€ mbeir_visualnews_task3_cand_pool.jsonl
124
+ ...
125
+ ```
126
+ The structure of each candidate JSON object in cand_pool file is as follows::
127
+ ```json
128
+ {
129
+ "did": "A unique identifier for the document, formatted as {dataset_id}:{doc_id}",
130
+ "txt": "The text content of the candidate document",
131
+ "img_path": "The file path to the candidate document's image",
132
+ "modality": "The modality type of the candidate (e.g., text, image or text,image)",
133
+ "src_content": "Additional content from the original dataset, presented as a string by json.dumps()"
134
+ }
135
+ ```
136
+
137
+ ### Instructions
138
+ `query_instructions.tsv` contains human-authorized instructions within the UniIR framework. Each task is accompanied by four human-authored instructions. For detailed usage, please refer to [**GitHub Repo**](https://github.com/TIGER-AI-Lab/UniIR).
139
+
140
+ ### Qrels
141
+ Within the `qrels` directory, you will find qrels for both the validation and test sets. These files serve the purpose of evaluating UniIR models. For detailed information, please refer to [**GitHub Repo**](https://github.com/TIGER-AI-Lab/UniIR).
142
+
143
+ ## **How to Use**
144
+ ### Downloading the M-BEIR Dataset
145
+ <a name="install-git-lfs"></a>
146
+ #### Step 1: Install Git Large File Storage (LFS)
147
+ Before you begin, ensure that **Git LFS** is installed on your system. Git LFS is essential for handling large data files. If you do not have Git LFS installed, follow these steps:
148
+
149
+ Download and install Git LFS from the official website.
150
+ After installation, run the following command in your terminal to initialize Git LFS:
151
+ ```
152
+ git lfs install
153
+ ```
154
+
155
+ #### Step 2: Clone the M-BEIR Dataset Repository
156
+ Once Git LFS is set up, you can clone the M-BEIR repo from the current Page. Open your terminal and execute the following command:
157
+ ```
158
+ git clone https://huggingface.co/datasets/TIGER-Lab/M-BEIR
159
+ ```
160
+ Please note that the M-BEIR dataset is quite large, and downloading it can take several hours, depending on your internet connection.
161
+ During this time, your terminal may not show much activity. The terminal might appear stuck, but if there's no error message, the download process is still ongoing.
162
+
163
+ ### Decompressing M-BEIR Images
164
+ After downloading, you will need to decompress the image files. Follow these steps in your terminal:
165
+ ```bash
166
+ # Navigate to the M-BEIR directory
167
+ cd path/to/M-BEIR
168
+
169
+ # Combine the split tar.gz files into one
170
+ sh -c 'cat mbeir_images.tar.gz.part-00 mbeir_images.tar.gz.part-01 mbeir_images.tar.gz.part-02 mbeir_images.tar.gz.part-03 > mbeir_images.tar.gz'
171
+
172
+ # Extract the images from the tar.gz file
173
+ tar -xzf mbeir_images.tar.gz
174
+ ```
175
+ Now, you are ready to use the M-BEIR benchmark.
176
+
177
+ ### Dataloader and Evaluation Pipeline
178
+ We offer a dedicated dataloader and evaluation pipeline for the M-BEIR benchmark. Please refer to [**GitHub Repo**](https://github.com/TIGER-AI-Lab/UniIR) for detailed information.
179
+
180
+ ## **Citation**
181
+ Please cite our paper if you use our data, model or code.
182
+
183
+ ```
184
+ @article{wei2023uniir,
185
+ title={UniIR: Training and Benchmarking Universal Multimodal Information Retrievers},
186
+ author={Wei, Cong and Chen, Yang and Chen, Haonan and Hu, Hexiang and Zhang, Ge and Fu, Jie and Ritter, Alan and Chen, Wenhu},
187
+ journal={arXiv preprint arXiv:2311.17136},
188
+ year={2023}
189
+ }
190
+ ```