ericssonbear commited on
Commit
724e2a4
·
verified ·
1 Parent(s): 2b4207d

Add corpus, queries and pseudo-label pairs (parquet) + dataset card

Browse files
README.md ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ language:
4
+ - zh
5
+ - en
6
+ task_categories:
7
+ - text-retrieval
8
+ tags:
9
+ - multimodal-retrieval
10
+ - traditional-chinese
11
+ - cross-lingual
12
+ - wikipedia
13
+ - image-captioning
14
+ pretty_name: Mr. Right zh-TW (Traditional Chinese Multimodal Retrieval Corpus)
15
+ size_categories:
16
+ - 100K<n<1M
17
+ configs:
18
+ - config_name: corpus
19
+ data_files:
20
+ - split: train
21
+ path: corpus/train-*.parquet
22
+ - config_name: queries-test
23
+ data_files:
24
+ - split: test
25
+ path: queries_test/train-00000.parquet
26
+ - config_name: queries-val
27
+ data_files:
28
+ - split: validation
29
+ path: queries_val/train-00000.parquet
30
+ - config_name: queries-mt-en
31
+ data_files:
32
+ - split: train
33
+ path: queries_mt_en/train-00000.parquet
34
+ - config_name: pseudo-pairs-zh
35
+ data_files:
36
+ - split: train
37
+ path: pseudo_pairs_zh/train-00000.parquet
38
+ - config_name: pseudo-pairs-hard
39
+ data_files:
40
+ - split: train
41
+ path: pseudo_pairs_hard/train-00000.parquet
42
+ ---
43
+
44
+ # Mr. Right zh-TW — Traditional-Chinese Multimodal Retrieval Corpus
45
+
46
+ A **bilingual (Traditional Chinese + English) multimodal document retrieval** corpus:
47
+ 769,245 Wikipedia-derived documents, each with an English title/body, a Traditional-Chinese
48
+ (Taiwan) translation, and a **machine-generated Traditional-Chinese caption of the document's
49
+ image** — plus test/validation query sets and the pseudo-labelled pairs used to fine-tune a
50
+ retriever on it.
51
+
52
+ This is a derivative of the [Mr. Right](https://github.com/hsiehjackson/Mr.Right) collection
53
+ (Hsieh et al., 2022), translated into Traditional Chinese and enriched with image captions.
54
+ To our knowledge it is the first Traditional-Chinese multimodal IR corpus of this scale on the Hub.
55
+
56
+ **Images are not redistributed here.** Every row carries `img_url` (Wikimedia) and `sha1`, so
57
+ the image tree is reproducible; see [Getting the images](#getting-the-images).
58
+
59
+ Companion repositories:
60
+ - Retriever adapters: [`ericssonbear/qwen3-vl-emb-8b-mrright-zhtw-lora`](https://huggingface.co/ericssonbear/qwen3-vl-emb-8b-mrright-zhtw-lora)
61
+ - Pre-computed document embeddings: [`ericssonbear/mr-right-zhtw-embeddings`](https://huggingface.co/datasets/ericssonbear/mr-right-zhtw-embeddings)
62
+
63
+ ---
64
+
65
+ ## ⚠️ Read this before you evaluate: the `query_multi` image trap
66
+
67
+ The upstream `multi` query type ships **with a query image**. We found that **1,992 of ~2,000**
68
+ test queries use the *same image file* as their gold document. A completely untrained backbone
69
+ scores **Recall@10 = .952** on that field — it is measuring image hashing, not retrieval.
70
+
71
+ **Use `query_multi` / `query_multi_zhtw` as plain text and do not feed the query image.**
72
+ All numbers in the companion model card are produced under this text-only protocol.
73
+ If you skip this, your results will be systematically inflated and incomparable.
74
+
75
+ Second protocol note — **the clean subset**: 96 of the 2,047 test queries point at documents
76
+ whose image URL is a dead link, so those documents are absent from the corpus and are
77
+ unreachable by any system. Scoring on all 2,047 imposes a recall ceiling of .953. We report on
78
+ the **clean** subset (gold document present in the corpus, n = 1,951).
79
+
80
+ ---
81
+
82
+ ## Configs
83
+
84
+ | config | rows | what it is |
85
+ |---|---:|---|
86
+ | `corpus` | 769,245 | the documents (English + zh-TW text, zh-TW image caption, image URL) |
87
+ | `queries-test` | 2,047 | test queries, 3 types × 2 languages |
88
+ | `queries-val` | 100 | validation queries, same schema |
89
+ | `queries-mt-en` | 2,147 | machine-translated English `query_multi` for test+val (cross-lingual baseline) |
90
+ | `pseudo-pairs-zh` | 32,359 | pseudo-labelled training pairs (round-trip ranked) |
91
+ | `pseudo-pairs-hard` | 27,055 | hard-negative-mined pairs with an LLM judge score |
92
+
93
+ ```python
94
+ from datasets import load_dataset
95
+
96
+ corpus = load_dataset("ericssonbear/mr-right-zhtw", "corpus", split="train")
97
+ queries = load_dataset("ericssonbear/mr-right-zhtw", "queries-test", split="test")
98
+ ```
99
+
100
+ ### `corpus` schema
101
+
102
+ | field | type | notes |
103
+ |---|---|---|
104
+ | `id` | int64 | upstream Mr. Right document id — **non-contiguous** (37,112 of 806,357 dropped) |
105
+ | `title`, `doc_text` | string | English original |
106
+ | `title_zhtw`, `doc_text_zhtw` | string | Traditional-Chinese translation (upstream `g4` split) |
107
+ | `img_caption` | string | zh-TW caption of the image, machine-generated |
108
+ | `img_url` | string | Wikimedia URL of the image |
109
+ | `caption_source` | string | `own` (187,057) or `external` (582,188) — see below |
110
+ | `sha1` | string | SHA-1 of the image bytes; stable join key since `id` is gappy |
111
+ | `image_path` | string | `<sha1[:2]>/<sha1>.<ext>` — the content-addressed layout to reproduce locally |
112
+
113
+ ### `queries-*` schema
114
+
115
+ `id` (the gold document), `img_url`, `title`, `doc_text`, and three query types in both
116
+ languages: `query_img` / `query_text` / `query_multi` and their `_zhtw` counterparts.
117
+ `id` joins to `corpus.id`; relevance is one gold document per query.
118
+
119
+ ### `pseudo-pairs-*` schema
120
+
121
+ `id` (gold document), `query_multi_zhtw`, `query_multi`, `rt_rank_zh`, `rt_rank_en`
122
+ (round-trip rank of the gold document under the zh/en query — lower is a cleaner pair;
123
+ `null` = not retrieved), and for `hard`, `judge_score` (LLM judge, higher is better).
124
+
125
+ ---
126
+
127
+ ## How it was built
128
+
129
+ ```
130
+ Wikipedia (CC BY-SA)
131
+ └─ Mr. Right collection (Hsieh et al. 2022, CC BY-SA 4.0) — 806,357 docs, English
132
+ └─ g4 split: Traditional-Chinese translation of title + doc_text [upstream]
133
+ └─ images fetched from Wikimedia by img_url → SHA-1 content-addressed tree
134
+ └─ zh-TW caption per image
135
+ └─ keep a doc iff its image resolved AND its caption passed the quality gate
136
+ → 769,245 docs (this dataset)
137
+ ```
138
+
139
+ **Captions.** Two sources, recorded per row in `caption_source`:
140
+ - `own` (187,057 docs) — generated for this project with **Qwen3-VL-8B-Instruct** under vLLM,
141
+ greedy decoding, zh-TW instruction prompt, 256 max tokens.
142
+ - `external` (582,188 docs) — three caption sets produced by other members of the same lab
143
+ with their own VLM pipelines, joined by document id.
144
+
145
+ **Quality gate.** A document is kept only if its image was successfully fetched *and* its
146
+ caption is non-empty, contains no replacement characters, and has at least 10 CJK characters.
147
+ 37,112 documents were dropped (dead image links or failed captions) — hence the gappy `id`.
148
+
149
+ ## Getting the images
150
+
151
+ The image tree is ~1.2 TB / 769,217 files, so it is not redistributed. Rebuild it from
152
+ `img_url` and verify each file against `sha1`:
153
+
154
+ ```python
155
+ import hashlib, pathlib, requests
156
+ from datasets import load_dataset
157
+
158
+ UA = "your-project/1.0 (your-contact@example.com)" # Wikimedia requires a real UA
159
+ root = pathlib.Path("images")
160
+
161
+ for row in load_dataset("ericssonbear/mr-right-zhtw", "corpus", split="train", streaming=True):
162
+ dst = root / row["image_path"]
163
+ if dst.exists():
164
+ continue
165
+ r = requests.get(row["img_url"], headers={"User-Agent": UA}, timeout=30)
166
+ r.raise_for_status()
167
+ assert hashlib.sha1(r.content).hexdigest() == row["sha1"], row["id"]
168
+ dst.parent.mkdir(parents=True, exist_ok=True)
169
+ dst.write_bytes(r.content)
170
+ ```
171
+
172
+ Wikimedia rate-limits to roughly **1 image/s per egress IP** and expects a descriptive
173
+ User-Agent and honoured `Retry-After`. A full rebuild from one IP takes on the order of
174
+ 9 days; plan accordingly. Content addressing means parallel downloaders cannot collide.
175
+
176
+ If you only need the document vectors, skip the images and use the
177
+ [pre-computed embeddings](https://huggingface.co/datasets/ericssonbear/mr-right-zhtw-embeddings).
178
+
179
+ ## Limitations
180
+
181
+ - **Captions are machine-generated** and inherit VLM failure modes (hallucinated detail, OCR
182
+ errors, occasional English leakage). They were filtered for form, not for factual accuracy.
183
+ - **`doc_text_zhtw` is machine-translated**, not human-authored or human-reviewed. Spot checks
184
+ found residual Chinese/English mixing in a small fraction of translated queries (~2.6% in the
185
+ MT English query set).
186
+ - **No human-authored Chinese evaluation slice.** The zh-TW queries are translations, so they
187
+ carry translationese; results on them are not a substitute for native-speaker queries.
188
+ - `caption_source` is confounded with document id range (`own` covers the high-id tail), so
189
+ it should not be read as a controlled comparison between captioning pipelines.
190
+ - The corpus is a public encyclopedia: no personal data beyond what Wikipedia already
191
+ publishes, and no human-subject research is involved.
192
+
193
+ ## License and attribution
194
+
195
+ Released under **CC BY-SA 4.0**, inherited from the upstream Mr. Right collection, which in
196
+ turn derives from Wikipedia (CC BY-SA). Any redistribution or adaptation must stay under
197
+ CC BY-SA 4.0 and credit both this dataset and the upstream authors.
198
+
199
+ Individual images remain under their own Wikimedia licenses and are **not** covered by this
200
+ dataset's license — that is one reason only URLs are shipped here.
201
+
202
+ Upstream:
203
+
204
+ ```bibtex
205
+ @article{hsieh2022mrright,
206
+ title = {Mr. Right: Multimodal Retrieval on Representation of ImaGe witH Text},
207
+ author = {Hsieh, Cheng-Ping and Chen, Jui-Ting and others},
208
+ journal = {arXiv preprint arXiv:2209.13764},
209
+ year = {2022}
210
+ }
211
+ ```
212
+
213
+ ## Citation
214
+
215
+ <!-- TODO(authors): replace the placeholder author list below before making this repo public. -->
216
+
217
+ ```bibtex
218
+ @misc{mrright_zhtw_2026,
219
+ title = {Mr. Right zh-TW: A Traditional-Chinese Multimodal Retrieval Corpus},
220
+ author = {AUTHORS_PLACEHOLDER},
221
+ year = {2026},
222
+ url = {https://huggingface.co/datasets/ericssonbear/mr-right-zhtw}
223
+ }
224
+ ```
225
+
226
+ ## Acknowledgements
227
+
228
+ Built by AUTHORS_PLACEHOLDER. Heavy compute ran on the NCHC 晶創 (Nano5) cluster via Slurm.
229
+ Image captioning for the low-id range was contributed by lab members running their own
230
+ VLM pipelines. Funded under FUNDING_PLACEHOLDER.
corpus/train-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a29bbe74fd11ff2003076ede09592e5ed96670362ca5f5abaad7a17aae35426b
3
+ size 83870001
corpus/train-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e8f5a930d0f22130a798a8aa40f015793554c824cb326c4f783143748d8dcf8
3
+ size 83650339
corpus/train-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:446bb96d681b71557b06fcbf0caa90f9dbf87704aa5f4d657f9020c6a43ff2ba
3
+ size 83812705
corpus/train-00003.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4530a1f7d01619115d44acd5ba60109aa94230c05a61bf5725338343e555034
3
+ size 83741894
corpus/train-00004.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da250bdf89f7c5a33e315c6d47caceff17b98d7500bf1bc5a60747124d8d6221
3
+ size 81531989
corpus/train-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b171410736e507abef0845b9b877387b0bfea1ff7624d5df07f0020f6fd61820
3
+ size 75750273
corpus/train-00006.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:738697b5ad9b3c77b1c5d1cb4da972b1350daa9a34bca27987908b2b8ee78261
3
+ size 52894231
corpus/train-00007.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61dd91c99a519375f717ab6c2ce86d3f4a82a4dbaff0ad617338da15f60ab26c
3
+ size 36709221
pseudo_pairs_hard/train-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0a4263bd21a9da9af43d1ec90b512ce9991c099b104cea9ac32c3d4ff309a35
3
+ size 1705260
pseudo_pairs_zh/train-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ea4a4d019934f25231fc0a64a7e4966b014abc3c76db2f2792997dddca6f81a
3
+ size 2856850
queries_mt_en/train-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45ffa786bcd28cf39243a2171834483d96824ddeb0320e8df8f698918b4b1f68
3
+ size 90477
queries_test/train-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6c46dbb4f643412bcf83bb67fb1888d42828682a0284c258cc8c7eb3a5ab0e2
3
+ size 1209438
queries_val/train-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d52e5e8e61f327bb6e8cf758c38ab7dbba2773cf20fbb075f68e1bd67f1c4da
3
+ size 30837